Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Normal
Description
I think I have found more cases where 2i behave different in different Cassandra versions, CASSANDRA-11510 solved one such case but I think there are a few more.
I get one behaviour with 2.1.14 and Trunk and I think this is the correct one. With 2.2.7 and 3.0.6 the behaviour is different.
To test this I used ccm to setup one node clusters with the different versions, I prepared each cluster with these commands:
CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '1' }; CREATE TABLE test.table1 (name text,class int,inter text,foo text,power int,PRIMARY KEY (name, class, inter, foo)) WITH CLUSTERING ORDER BY (class DESC, inter ASC); CREATE INDEX table1_power ON test.table1 (power) ; CREATE TABLE test.table2 (name text,class int,inter text,foo text,power int,PRIMARY KEY (name, class, inter, foo)) WITH CLUSTERING ORDER BY (class DESC, inter ASC); CREATE INDEX table2_inter ON test.table2 (inter) ;
I executed two select quieries on each cluster:
SELECT * FROM test.table1 where name='R1' AND class>0 AND class<4 AND inter='int1' AND power=18 ALLOW FILTERING; SELECT * FROM test.table2 where name='R1' AND class>0 AND class<4 AND inter='int1' AND foo='aa' ALLOW FILTERING;
On 2.1.14 and Trunk they where successful. But on 2.2.7 and 3.0.6 they failed, the first one with InvalidRequest: code=2200 [Invalid query] message="Clustering column "inter" cannot be restricted (preceding column "class" is restricted by a non-EQ relation)" and the second one with InvalidRequest: code=2200 [Invalid query] message="Clustering column "foo" cannot be restricted (preceding column "inter" is restricted by a non-EQ relation)".
I could get the queries to execute successfully on 2.2.7 and 3.0.6 by creating two more 2i:
CREATE INDEX table1_inter ON test.table1 (inter) ; CREATE INDEX table2_foo ON test.table2 (foo) ;
Attachments
Issue Links
- is related to
-
CASSANDRA-11510 Clustering key and secondary index
-
- Resolved
-