You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benjamin Lerer (JIRA)" <ji...@apache.org> on 2017/01/09 14:34:58 UTC
[jira] [Commented] (CASSANDRA-13017) DISTINCT queries on partition
keys and static column might not return all the results
[ https://issues.apache.org/jira/browse/CASSANDRA-13017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15811909#comment-15811909 ]
Benjamin Lerer commented on CASSANDRA-13017:
--------------------------------------------
Because the {{lastReturnedName}} was not ignored in {{RangeSliceQueryPager}} for {{distinct}} queries, Cassandra was fetching one row less than what it should have. Due to that, it was considering the data exhausted even if there were some remaining rows to return.
||branch||utests||dtests||
|[2.1|https://github.com/apache/cassandra/compare/trunk...blerer:13017-2.1]|[2.1|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-13017-2.1-testall/]|[2.1|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-13017-2.1-dtest/]|
|[2.2|https://github.com/apache/cassandra/compare/trunk...blerer:13017-2.2]|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-13017-2.2-testall/]|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-13017-2.2-dtest/]|
The PR for the new DTest is [here|https://github.com/riptano/cassandra-dtest/pull/1421]
[~thobbs] could you review?
> DISTINCT queries on partition keys and static column might not return all the results
> -------------------------------------------------------------------------------------
>
> Key: CASSANDRA-13017
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13017
> Project: Cassandra
> Issue Type: Bug
> Components: CQL
> Reporter: Benjamin Lerer
> Assignee: Benjamin Lerer
> Fix For: 2.1.x, 2.2.x
>
>
> In {{2.1}} and {{2.2}}, a {{DISTINCT}} query on partition keys and static columns might not return all the data if some rows have no data and the static columns have also no values.
> The problem can be reproduced using the Java driver with the following code:
> {code}
> session = cluster.connect();
> session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : '1'}");
> session.execute("USE test");
> session.execute("DROP TABLE IF EXISTS test");
> session.execute("CREATE TABLE test (pk int, c int, v int, s int static, primary key(pk, c))");
> PreparedStatement prepare = session.prepare("INSERT INTO test (pk, c, v, s) VALUES (?, ?, ?, ?)");
> for (int i = 0; i < 10; i++)
> for (int j = 0; j < 1; j++)
> session.execute(prepare.bind(i, j, null, null));
> for (Row row : session.execute(new SimpleStatement("SELECT DISTINCT token(pk), pk, s FROM test").setFetchSize(2)))
> {
> System.out.println(row);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)