cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Kumar <>
Subject What is wrong in this token function
Date Thu, 10 Mar 2016 21:44:02 GMT

C*  3.0.3

I have a table table1 which has the primary key on ((customer_id,event_id)).

I loaded 1.03 million rows from a csv file.

Business case: Show me all events for a given customer in a given time frame

In RDBMS it will be


where customer_id = '289'
and event_time >= '2016-03-01 18:45:00+0000' and event_time <= '2016-03-12 19:05:00+0000'

But C* does not allow >= <= on PKY cols. It suggested token function.

So I did this:


where token(customer_id,event_time) >= token('289','2016-03-01 18:45:00+0000')
and token(customer_id,event_time) <= token('289','2016-03-12 19:05:00+0000')  ;

I am seeing 75% more rows than what it should be. It should be 99K rows, it shows 163K.

I checked the output with the csv file itself.  To double check I loaded the csv in another
with modified PKY so that the first query (Query1) can be executed. It also showed 99K rows.

Am I using token function incorrectly ?

View raw message