cassandra-driver-core 3.1 automatic pagination is not working with IN queries

124 views
Skip to first unread message

hemabs

unread,
Sep 6, 2016, 2:56:49 PM9/6/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

I have upgraded cassandra driver core from 2.1.10 to 3.1.0.

After using manual paging with in clause in my query as described in the documentation link here:
ResultSet rs = session.execute("your query");
for (Row row : rs) {
    if (rs.getAvailableWithoutFetching() == 100 && !rs.isFullyFetched())
        rs.fetchMoreResults(); // this is asynchronous
    // Process the row ...
    System.out.println(row);
}

I see that the last row from previous page is getting added to next page. And this returns duplicate rows in the final results. When I searched for if any issue is seen with 3.1.0 version, there is one in JIRA. Here is the link:

does not mention of the above fix.

Can you please let me know when this fix will be checked into 3.1.0?

Thanks
hbs

Kevin Gallardo

unread,
Sep 7, 2016, 11:44:49 AM9/7/16
to java-dri...@lists.datastax.com
Hi, 

This problem does not seem to be requiring a fix in the Java driver, however the Cassandra side has been corrected. 

I have been able to test on a simple example that duplicate rows are not returned any more in the same page on a C* 3.0.8 local node, but I had observed there was indeed duplicates on against 3.0.0 node.

Against which version of Cassandra have you been testing?

Cheers.

--
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.



--
Kévin Gallardo.
Software Engineer in Drivers and Tools Team at DataStax.
 

hemabs

unread,
Sep 7, 2016, 7:53:48 PM9/7/16
to DataStax Java Driver for Apache Cassandra User Mailing List
I am using cassandra 3.4 server, I am seeing the issue. Can you verify if this change is available?
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

hemabs

unread,
Sep 7, 2016, 8:07:07 PM9/7/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Issue is I see last row from previous page getting added as first row in the next page.

hemabs

unread,
Sep 7, 2016, 8:17:20 PM9/7/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Then the bug I mentioned on Cassandra is not related to my issue. But why do last row returns on next page navigation. Looks like this is a java-driver issue only.

Kevin Gallardo

unread,
Sep 8, 2016, 6:56:03 AM9/8/16
to java-dri...@lists.datastax.com
Hi,

The issue as far as I can tell is on the Cassandra side, indeed I was able to reproduce the issue you describe (the last row of page 1 gets added when as the first row of page 2 with a "SELECT .... IN ..." CQL query) against Cassandra 3.4, updating to Cassandra 3.7 or Cassandra 3.0.8 resolves the issue.

So far it does not seem like a driver issue, if you have an example to share I could test against a Cassandra 3.7 node, or if you could check that your are able to reproduce your issue against a Cassandra 3.7 node, that would help.

Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-user+unsubscribe@lists.datastax.com.

hemabs

unread,
Sep 11, 2016, 8:28:27 PM9/11/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Thanks Kevin. I am able to work it out with 3.7 version without any issues. 
Appreciate your help.
Reply all
Reply to author
Forward
0 new messages