I have been trying to retrieve data from Cassandra database using this command:
select A_NO from Activity where CALL_TYPE IN ('MOC');//here CALL_TYPE is not the row id
But its showing :
Expected key 'KEY' to be present in where clause for 'Activity'
Is it not possible in cassandra to filter the data with the help of a non-primary key?
You cannot do this directly on a vanilla column family. Cassandra by default only let’s you query on key’s or a key range. You can accomplish this by creating a secondary index on a column
You would run a CQL query like this to create two indexes:
And then queried like this:
Here is more on Secondary indexes.
Here is the documentation on using CQL for this.