Monday, 26 August 2013

Keeping sorted values in Column Family

Keeping sorted values in Column Family

I need data to be sorted in columnfamily. While discovering about
cassandra I found clustering order by option for columnfamily. But while
creating columnfamilies dynamically I am unable to set this option.
Via cqlsh when I create "CREATE TABLE con1(day timestamp,ts
timestamp,value double, PRIMARY KEY(day,ts)) WITH CLUSTERING ORDER BY (ts
DESC); It stores ts values as sorted.
When I created columnfamily via hector dynamically it defaults to compact
storage.I am unable to define clustering order by using hector.
Any solution for this problem?
Is there any other way to keep values sorted in columnfamily?

No comments:

Post a Comment