I have a table like this:
CREATE TABLE test ( partitionkey text, rowkey text, date timestamp, policyid text, policyname text, primary key (partitionkey, rowkey));
with some data:
partitionkey | rowkey | policyid | policyname | date
p1 | r1 | pl1 | plicy1 | 2007-01-02 00:00:00+0000 p1 | r2 | pl2 | plicy2 | 2007-01-03 00:00:00+0000 p2 | r3 | pl3 | plicy3 | 2008-01-03 00:00:00+0000
I want to be able to find:
1/ data from a particular partition key
2/ data from a particular partition key & rowkey
3/ Range query on date given a partitionkey
1/ and 2/ are trivial:
select * from test where partitionkey='p1';
partitionkey | rowkey | policyid | policyname | range
p1 | r1 | pl1 | plicy1 | 2007-01-02 00:00:00+0000 p1 | r2 | pl2 | plicy2 | 2007-01-03 00:00:00+0000
but what about 3/? Even with an index it doesnt work:
create index i1 on test (date);
select * from test where partitionkey='p1' and date = '2007-01-02';
partitionkey | rowkey | policyid | policyname | date
p1 | r1 | pl1 plicy1 | 2007-01-02 00:00:00+0000
but
select * from test where partitionkey='p1' and date > '2007-01-02';
Bad Request: No indexed columns present in by-columns clause with Equal operator
Any idea? thanks, Matt