How do I select all rows from two clustering columns in cassandra database

Viewed 71

I have a Partion key: A

Clustering columns: B, C

I do understand I can query like this

    Select * from table where A = ?
    Select * from table where A = ? and B = ?
    Select * from table where A = ? and B = ? and C = ?

Now I have a scenario where I need to fetch results from only B and C. Is there a way to this with out using Allow Filtering.

1 Answers

You cannot fetch on basis of 'B' and 'C' (the clustering columns) without partition key without using Allow Filtering. Though you can use spark and spark-cassandra-connector for filtering out the results on basis of 'B' and 'C'. Behind the scene it also used allow filtering but it has efficient mechanism to scan the table the right way.

Related