1
votes

I know that != is not supported in CQL select statements. And, I also know that != queries are not efficient. But why is it not allowed even if I am prepared to accept filtering?

For example, I want something like this: Select * from foo where PK='something' and CK1='something' and CK2!='something' allow filtering

My reasoning is that the cardinality would be low enough after PK and CK1 that I don't care if Cassandra has to read all the remaining rows.

Question: apart from doing application side filter, is there any way to do that using CQL only?

1

1 Answers

4
votes

No, there is no other way. You have to filter it from the application layer.

Cassandra supports these conditional operators in the WHERE clause: CONTAINS, CONTAINS KEY, IN, =, >, >=, <, or <=, but not all in certain situations.

Source : https://docs.datastax.com/en/cql/3.1/cql/cql_reference/select_r.html