Hi Experts,
  We have a design requirement, for example,
  Create table test(
     vin text,
     create_date int,
     create_time timestamp,
a text,
     b text,
     primary key ((vin,create_date),create_time))
  with clustering order by (create_time DESC);
  we store data in this table like this:
ZD41578123DSAFWE12313 |20180316| 2018-03-16 20:51:33.000000+0800 |  P023  | P001
ZD41578123DSAFWE12313 |20180315| 2017-03-15 20:51:33.000000+0800 |  P000  | P001
ZD41578123DSAFWE12313 |20180314| 2017-03-14 20:51:33.000000+0800 |  P456  | P001
            3431241241234 |20180317| 2017-03-17 20:51:33.000000+0800 |  P000  | 
P001
            3431241241234 |20180316| 2017-03-16 20:51:33.000000+0800 |  P123  | 
P001
            3431241241234 |20180315| 2017-03-15 20:51:33.000000+0800 |  P456  | 
P001
            3431241241234 |20180314| 2017-03-14 20:51:33.000000+0800 |  P789  | 
P001
ZD41578123DSAFWE13333 |20180314| 2017-03-14 20:51:33.000000+0800 |  P023  | P001
              41034800994 |20180313| 2017-03-13 08:26:55.000000+0800 | P0133  | 
P001
              41034800994 |20180312| 2017-03-12 08:26:55.000000+0800 | P0420  | 
P001
We know that we can only use “=” or “in”for the partition key query,my question 
is that is there a convenient way to query a range result or other design for 
this requirement,for example 3 or 6 months  backward from nowadays,currently we 
can only use:
Select * from test where vin =“ZD41578123DSAFWE12313” and create_date in 
(20180416, 20180415, 20180414, 20180413, 20180412………………………………….);
But this cause the cql query is very long,and I don’t know whether there is 
limitation for the length of the cql.
Please give me some advice,thanks in advance.

Best Regards,

倪项菲/ David Ni
中移德电网络科技有限公司
Virtue Intelligent Network Ltd, co.
Add: 2003,20F No.35 Luojia creative city,Luoyu Road,Wuhan,HuBei
Mob: +86 13797007811|Tel: + 86 27 5024 2516

Reply via email to