I am struggling with cassandra and CQL. I am defining this table schema,
CREATE TABLE useradvisits (
userid text,
adid int,
type int,
timestamp timestamp,
PRIMARY KEY (userid, adid, type)
);
I want to query like this,
SELECT * from useradvisits where userid = 'user-1' and adId in (100, 1001);
But it says, Bad Request: PRIMARY KEY part adid cannot be restricted by IN relation
I am working with latest datstax enterprise version 3.1.
cqlsh console says,
[cqlsh 3.1.2 | Cassandra 1.2.6.1 | CQL spec 3.0.0 | Thrift protocol 19.36.0]
As I need (adId + type) to be unique, that is (100 : 1), (100 : 2) both be present for a user. Can anyone help me how to workaround?