We come from RDBMS background ,what we are trying to do is to port an existing data store to cassandra, to leverage the power of distributed database. Our requirement is to store values with respect to a key ,probably key will be time (plan to use epoch time ) and to retrieve the values between the key range
For a Test we have created ColumnFamily and inserted Data using cql (via cqlsh
):
CREATE COLUMNFAMILY Log( KEY int PRIMARY KEY,Val1 varchar,Val2 varchar);
INSERT INTO Log (KEY,val1, val2) VALUES (1,'673153106.00','448768737.33');
INSERT INTO Log (KEY,val1, val2) VALUES (2,'673153106.50','448768737.67');
INSERT INTO Log (KEY,val1, val2) VALUES (3,'673153107.00','448768738.00');
INSERT INTO Log (KEY,val1, val2) VALUES (4,'673153107.50','448768738.33');
INSERT INTO Log (KEY,val1, val2) VALUES (5,'673153108.00','448768738.67');
INSERT INTO Log (KEY,val1, val2) VALUES (6,'673153108.50','448768739.00');
INSERT INTO Log (KEY,val1, val2) VALUES (7,'673153109.00','448768739.33');
INSERT INTO Log (KEY,val1, val2) VALUES (8,'673153109.50','448768739.67');
INSERT INTO Log (KEY,val1, val2) VALUES (9,'673153110.00','448768740.00');
INSERT INTO Log (KEY,val1, val2) VALUES (10,'673153110.50','448768740.33');
But our select fails to return the correct data
select * from Log where KEY>4 and KEY<9;
KEY| val1 | val2 | 10 | 673153110.50 | 448768740.33 | 8 | 673153109.50 | 448768739.67 |
select * from Log where KEY>4 and KEY<9;
Bad Request: Start key's md5 sorts after end key's md5. This is not allowed; you probably should not specify end key at all, under RandomPartitioner
Are we doing something wrong?.Is there any solution to select values between a key Range using the randompartition