kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Ordering of data and Relational Operator support in Kundera-cassadnra

Open Gargee opened this issue 13 years ago • 3 comments

Hi, I have this column family CREATE TABLE "ChangeStatus" ( "ChangeID" int, "ChangeStatusName" varchar, PRIMARY KEY("ChangeID") );

and i need to fetch records where the ChangeID is 1)greater than 5 and 2)also need to ORDER the data based in the ChangeID.

But when i try that i get "Bad Request: Only EQ and IN relation are supported on the partition key for random partitioners (unless you use the token() function)"

Token function doesn't seem to return consistent data. I am using Kundera-Cassandra and am using CQL_VERSION_3_0. in my code Please suggest what to do?

Gargee avatar Jul 10 '13 16:07 Gargee

Hi, Either You need to change partitioning schema from Random to Ordered partitioning to get it working, or need to devise a way using composite columns.

So if you create composite key with ChangeID as partition key and ChangeStatusName as cluster key. It should be sorted by ChangeID.

-Vivek

mevivs avatar Jul 10 '13 17:07 mevivs

Have a look at: http://www.planetcassandra.org/blog/post/composite-keys-in-apache---cassandra

for more details.

-Vivek

mevivs avatar Jul 10 '13 17:07 mevivs

Thanks Vivek that worked for me.

Gargee avatar Jul 16 '13 15:07 Gargee