Search code examples
apache-sparkcassandracassandra-lucene-index

With Cassandra, How can I achieve order by any columns or any key in a map?


I want to store any key value in DB and display the data with sort and filter. What should I do with cassandra to support this?

I understand Cassandra is very stable and scalable.

I know that cassandra can only sort by clustering keys. But I do need the sorting on any column and I dont want to copy data around.

I am really curious about how people do this with Cassandra.

Or Cassandra users never do those kind of things?

And finally, I want to store customized key,value pairs in DB and also be able to query the key with sort and filter. Should I use Cassandra with Spark to support all those features? Or Can I use Cassandra-Lucene plugin to support sort by any column? any drawback it will bring?

Appreciate your comment!


Solution

  • I found that Cassandra Lucence plugin can help on sorting by any column. Especially, it can sort by any key in a map. So that I can store <key,value> pair in map and sort/search by the key in the map. I am not sure whether this is the preferred solution or there are any other better solution. Cassandra Lucene index for search in map type