cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhishek Singh Bailoo <abhishek.singh.bai...@gmail.com>
Subject query contains IN on the partition key and an ORDER BY
Date Sat, 02 May 2015 17:46:46 GMT
Hi

I have run into the following issue
https://issues.apache.org/jira/browse/CASSANDRA-6722 when running a query
(contains IN on the partition key and an ORDER BY ) using datastax driver
for Java.

However, I am able to run this query alright in cqlsh.

cqlsh:> show version;
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3]

cqlsh:gps> select * from log where imeih in ('862170011627815@2015-01-29
@03','862170011627815@2015-01-30@21','862170011627815@2015-01-30@04') and
dtime < '2015-01-30 23:59:59' order by dtime desc limit 1;

The same query when run via datastax Java driver gives the following error:

Exception in thread "main"
com.datastax.driver.core.exceptions.InvalidQueryException: Cannot page
queries with both ORDER BY and a IN restriction on the partition key; you
must either remove the ORDER BY or the IN and sort client side, or disable
paging for this query
    at
com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:35)

Any ideas?

Thanks,
Abhishek.

Mime
View raw message