Closed trushkevich closed 10 years ago
Right, I forgot that I had created a modified version of cassandra-cql. The actual one doesn't support consistency at all (everything is QUORUM), but I absolutely needed the ability to specify it. You can find the version I used here if you want: https://github.com/jasonmk/cassandra-cql. I've actually got a branch though where I'm moving off of cassandra-cql over to cql-rb. It uses the newer binary protocol (no more thrift!) and supports a lot more features, including consistency. I'm not sure when it will be ready though. The typing stuff needs to be completely re-written for it.
I've actually got a branch though where I'm moving off of cassandra-cql over to cql-rb. It uses the newer binary protocol (no more thrift!) and supports a lot more features, including consistency.
great!
I'm not sure when it will be ready though. The typing stuff needs to be completely re-written for it.
It's open-source and you work alone, so there's no surprise ;-)
As for your fork https://github.com/jasonmk/cassandra-cql I get the following error when I run "rake ds:migrate":
rake aborted! CassandraCQL::Error::InvalidRequestException: Undefined name key_alias in selection clause /home/antoha/.rvm/gems/ruby-2.1.1/bundler/gems/cassandra-cql-8fb9e0eafdb4/lib/cassandra-cql/database.rb:126:in 'rescue in execute_cql_query' /home/antoha/.rvm/gems/ruby-2.1.1/bundler/gems/cassandra-cql-8fb9e0eafdb4/lib/cassandra-cql/database.rb:115:in 'execute_cql_query' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/cql/base.rb:26:in 'execute' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/cassandra.rb:111:in 'check_key_name' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/migrator.rb:76:in 'check_schema_migrations' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/migrator.rb:13:in 'initialize' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/tasks/ds.rake:6:in 'new' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/tasks/ds.rake:6:in 'block (2 levels) in [top (required)]' /home/antoha/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in 'eval' /home/antoha/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in '[main]' CassandraCQL::Thrift::InvalidRequestException: Undefined name key_alias in selection clause /home/antoha/.rvm/gems/ruby-2.1.1/bundler/gems/cassandra-cql-8fb9e0eafdb4/vendor/1.2/gen-rb/cassandra.rb:631:in 'recv_execute_cql3_query' /home/antoha/.rvm/gems/ruby-2.1.1/bundler/gems/cassandra-cql-8fb9e0eafdb4/vendor/1.2/gen-rb/cassandra.rb:621:in 'execute_cql3_query' /home/antoha/.rvm/gems/ruby-2.1.1/gems/thrift_client-0.9.2/lib/thrift_client/abstract_thrift_client.rb:165:in 'block in handled_proxy' /home/antoha/.rvm/gems/ruby-2.1.1/gems/thrift_client-0.9.2/lib/thrift_client/abstract_thrift_client.rb:146:in 'ensure_socket_alignment' /home/antoha/.rvm/gems/ruby-2.1.1/gems/thrift_client-0.9.2/lib/thrift_client/abstract_thrift_client.rb:165:in 'handled_proxy' /home/antoha/.rvm/gems/ruby-2.1.1/gems/thrift_client-0.9.2/lib/thrift_client/abstract_thrift_client.rb:53:in 'execute_cql3_query' /home/antoha/.rvm/gems/ruby-2.1.1/bundler/gems/cassandra-cql-8fb9e0eafdb4/lib/cassandra-cql/database.rb:121:in 'execute_cql_query' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/cql/base.rb:26:in 'execute' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/cassandra.rb:111:in 'check_key_name' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/migrator.rb:76:in 'check_schema_migrations' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/schema/migrator.rb:13:in 'initialize' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/tasks/ds.rake:6:in 'new' /home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/tasks/ds.rake:6:in 'block (2 levels) in [top (required)]' /home/antoha/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in 'eval' /home/antoha/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in '[main]' Tasks: TOP =] ds:migrate =] ds:configure
Hmm.. but in rails console I can query cassandra successfully via the class which inherits from DatastaxRails::Base.
Again, version 2.0.0 should fix all of this as I've done away with the cassandra-cql gem all-together.
Ruby 2.1.1. Rails 4.1.0. This is a continuation of https://github.com/jasonmk/datastax_rails/issues/17.
I commented out this to see what happens next:
/home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/attribute_assignment.rb
in this case "rake ds:migrate" causes
This code in /home/antoha/.rvm/gems/ruby-2.1.1/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:117:in `execute_cql_query' is being called twice:
I checked in Pry: for the first time value of compression is 2 (integer) and for the second time - {:consistency=>2} and of course that's wrong value:
/home/antoha/.rvm/gems/ruby-2.1.1/gems/cassandra-cql-1.2.2/vendor/0.8/gen-rb/cassandra_types.rb
Previous line in backtrace is "/home/antoha/.rvm/gems/ruby-2.1.1/gems/datastax_rails-1.2.3/lib/datastax_rails/cql/base.rb:25:in `execute'":