java driver upgrade 3.x problems

62 views
Skip to first unread message

Adil

unread,
Aug 10, 2016, 6:18:37 PM8/10/16
to java-dri...@lists.datastax.com
Hi guys,

we have upgraded our cassandra cluster from 2.1.2 to 3.0.8 and also java driver from 2.1.5 to 3.0.3, we have some errors like this one (prevoiusly worked fine with C* 2.1.2 and driver 2.1.5):

java.util.concurrent.ExecutionException: 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 java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_05]


and also some queries return zero results even if data exists in the table.

any help?

thanks

adil

Olivier Michallat

unread,
Aug 10, 2016, 7:14:25 PM8/10/16
to java-dri...@lists.datastax.com
Hi,

The first issue is the result of CASSANDRA-6722. The rationale is that the ORDER BY is supposed to be applied globally on your result set, but if you query multiple partitions and the query also happens to be paged, Cassandra can't sort the results globally since it returns them in multiple pages.
As the message suggests, you could disable paging, i.e. increase the fetch size to include all results, but that can become impractical for large result sets. So the best route is probably to adapt your client code to get rid of either the ORDER BY or the IN.


and also some queries return zero results even if data exists in the table.

That's a bit hard to diagnose without any more details. Do you have a test case that reproduces it consistently?

--

Olivier Michallat

Driver & tools engineer, DataStax


--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

Adil

unread,
Aug 11, 2016, 8:29:00 AM8/11/16
to java-dri...@lists.datastax.com
Hi Olivier,
ok now by setting the fetchSize to Integer.MAX_VALUE at query level solves the problem of executing the query with IN and ORDER BY.
for the second problem, i don't have a test case, but i have noticed that all queries executed on a indexed column returns zero values, it happens with cqlsh and java driver, if i exclude the indexed column from the where condition then it works, so i'm thinking that with the upgrade of C* something is missed for indexes.

Adil

Adil

unread,
Aug 11, 2016, 10:59:56 AM8/11/16
to java-dri...@lists.datastax.com
Hi Olivier,

i have inserted a new record via the webapp and i can see it as result of the query, so all the oldest records before migration are not read, when i migrated the java-driver i changed the method from setDate to setTimestamp, i don't know if it's related or not

2016-08-11 14:28 GMT+02:00 Adil <adil....@gmail.com>:
Hi Olivier,
ok now by setting the fetchSize to Integer.MAX_VALUE at query level solves the problem of executing the query with IN and ORDER BY.
for the second problem, i don't have a test case, but i have noticed that all queries executed on a indexed column returns zero values, it happens with cqlsh and java driver, if i exclude the indexed column from the where condition then it works, so i'm thinking that with the upgrade of C* something is missed for indexes.

Adil
Reply all
Reply to author
Forward
0 new messages