I play with Cassandra 3. I added a secondary index to the integer column, then I want to make a range query. First he made a mistake:
InvalidRequest: code=2200 [Invalid query] message="No supported secondary index found for the non primary key columns restrictions"
So I added "Allow Filtering"
cqlsh:mykeyspace> SELECT * FROM test ; id | id2 | age | extra ----+-----+-----+------- 1 | 1 | 1 | 1 2 | 2 | 2 | 2 (2 rows) cqlsh:mykeyspace > CREATE INDEX test_age on test (extra) ; cqlsh:mykeyspace > select * FROM test WHERE extra < 2 ALLOW FILTERING ; id | id2 | age | extra ----+------+-----+------- 1 | 1 | 1 | 1 2 | null | 2 | null (2 rows)
Why is this going to happen? Is it design or is it a mistake?
source share