Search code examples
c#cassandradatastaxcqlsh

Cassandra Query works fine in cqlsh but gives exception via CSharpDriver


I have the following CQL query:

SELECT * FROM Posts WHERE idObject = ? AND status IN ('LEGIT', 'POTENTIAL_SPAM') ALLOW FILTERING

and status is a non-primary key column.

Now if I run this query in cqlsh console, it works fine but when I run this query via CassandraCSharpDriver its giving me the following exception:

IN predicates on non-primary-key columns (status) is not yet supported

Can someone point out why is this happening?


Solution

  • These kind of queries are currently not supported by the c# driver.

    You need to workaround by issuing two distinct (and possibly async) queries, one for each status, and then combine the results at application level.