I am trying to store data with following schema:
CREATE TABLE temp_humidity_data (
asset_id text,
date text,
event_time timestamp,
temprature int,
humidity int,
PRIMARY KEY((asset_id, date),event_time)
)
I have followed datastax article 'Getting Started with Time Series Modeling' - http://planetcassandra.org/blog/post/getting-started-with-time-series-data-modeling/
however with this data model one thing that is not working is query that returns me data between two dates. How do I do that?
If I do this:
select * from temp_humidity_data
where asset_id='1234' AND date >= '2010-04-02' AND date <= '2011-04-03';
It gives me following error:
code=2200 [Invalid query] message="Only EQ and IN relation are supported on the partition key (unless you use the token() function)"
In understand there is a way to do IN operator but I don't want to put all those dates in a 'IN' operator. Is there a way to query when using the above table definition data between two dates?