My CQL3 table is like this
CREATE TABLE stringindice (
id text,
colname text,
colvalue blob,
PRIMARY KEY (id, colname, colvalue)
) WITH COMPACT STORAGE
and I have inserted some values in it. Now when I am trying to do something like this:
QueryBuilder.select().all().from(keySpace, indTastringindice ble).where().and(QueryBuilder.eq("id", 'rowKey")).and(QueryBuilder.in("colname", "string1", "string2"));
which is essentially
select * from stringindice where id = "rowkey" and colname IN ("string1", "string2")
I am getting following exception:
com.datastax.driver.core.exceptions.InvalidQueryException: PRIMARY KEY part colname cannot be restricted by IN relation
at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:35)
at com.datastax.driver.core.ResultSetFuture.extractCauseFromExecutionException(ResultSetFuture.java:214)
at com.datastax.driver.core.ResultSetFuture.getUninterruptibly(ResultSetFuture.java:169)
at com.datastax.driver.core.Session.execute(Session.java:110)
In the documentation of CQL3, it is written that
"Moreover, the IN relation is only allowed on the last column of the partition key and on the last column of the full primary key."
So it seems that it is not supported!! If yes, then what is the way if I have to use something like IN for equating many values at once?