cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Mechler <rmech...@sencha.com>
Subject Select on indexed columns and with IN clause for the PRIMARY KEY
Date Fri, 11 May 2012 16:43:49 GMT
I am using C* 1.1 and CQL 3.0. Am trying to do a select with an IN clause
for the primary key, and on an indexed column, which appears to not be
supported:

    cqlsh:Keyspace1> SELECT * FROM TestTable WHERE id IN ('1', '2') AND
data = 'b';
    Bad Request: Select on indexed columns and with IN clause for the
PRIMARY KEY are not supported

Any chance this will be supported in the future?


Full example:

cqlsh:Keyspace1> CREATE TABLE TestTable (id text PRIMARY KEY, data text);
cqlsh:Keyspace1> CREATE INDEX ON TestTable (data);
cqlsh:Keyspace1> INSERT INTO TestTable (id, data) VALUES ('1', 'a');
cqlsh:Keyspace1> INSERT INTO TestTable (id, data) VALUES ('2', 'b');
cqlsh:Keyspace1> INSERT INTO TestTable (id, data) VALUES ('3', 'b');
cqlsh:Keyspace1> SELECT * FROM TestTable WHERE id IN ('1', '2');
 id | data
----+------
  1 |    a
  2 |    b

cqlsh:Keyspace1> SELECT * FROM TestTable WHERE data = 'b';
 id | data
----+------
  3 |    b
  2 |    b

cqlsh:Keyspace1> SELECT * FROM TestTable WHERE id IN ('1', '2') AND data =
'b';
Bad Request: Select on indexed columns and with IN clause for the PRIMARY
KEY are not supported
cqlsh:Keyspace1>

-Roland

Mime
View raw message