Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Error when inserting dynamic columns using CQL 2 #63

Closed
b2mdevelopment opened this issue Jul 12, 2012 · 4 comments
Closed

Error when inserting dynamic columns using CQL 2 #63

b2mdevelopment opened this issue Jul 12, 2012 · 4 comments

Comments

@b2mdevelopment
Copy link

Created a column family cf1 with no columns defined and an unset cqlVersion.

Run the following CQL using helenus:

insert into cf1 (KEY, new3,new4) values ('test', 0, 1) ;

...and the following error is received:

{ [HelenusInvalidRequestException: Unknown identifier new3] name: 'HelenusInvalidRequestException' }

My understanding is that dynamic columns are supported in insert statements in CQL2, and the insert works fine in cqlsh. Would you expect the insert to work OK using helenus?

@devdazed
Copy link
Contributor

Which version of C*?

@devdazed
Copy link
Contributor

On 1.1.0 using CQL2 here are my results:

From the cli:

create column family cf1 with default_validation_class=UTF8Type and key_validation_class=UTF8Type and comparator=UTF8Type;

test.js

var Helenus = require('helenus'),
    pool = new Helenus.ConnectionPool({
      hosts      : ['localhost:9160'],
      keyspace   : 'helenus_test'
    });

pool.on('error', function(err){
  throw(err);
});

pool.connect(function(err, keyspace){
  if(err){
    throw(err);
  }

    pool.cql("insert into cf1 (KEY, new3,new4) values ('test', 0, 1) ;", function(err, foo){
      if(err){
        throw(err);
      }

      pool.cql("SELECT new3,new4 FROM cf1 where KEY='test'", [], function(err, results){
        if(err){
          throw(err);
        }

        console.log(results[0]);
      });
    });
});

everything looks good, what version of Helenus are you running and what version of node?

@b2mdevelopment
Copy link
Author

Thanks for the sample Russ.

We have just tried your sample code as is and it's worked fine against our cassandra cluster.

We haven't figured out yet what we're doing wrong but the problem must be in our code. Sorry to trouble you, and thanks for the help.

Roy and James

@devdazed
Copy link
Contributor

no worries, let us know if you need anything else

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants