You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2014/04/18 15:13:15 UTC

[jira] [Updated] (CASSANDRA-7052) Query on compact storage with limit returns extra rows

     [ https://issues.apache.org/jira/browse/CASSANDRA-7052?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne updated CASSANDRA-7052:
----------------------------------------

    Attachment: 7052.txt

We do (sometimes) asks for one more result than the user LIMIT with compact tables to handle exclusive bounds (since without a CompositeType underneath, all we support is inclusive bounds internally) and we're properly adjusting post-query on 2.0. Attaching fix (and pushed the repro test above to dtests).

> Query on compact storage with limit returns extra rows
> ------------------------------------------------------
>
>                 Key: CASSANDRA-7052
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7052
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Stuart Freeman
>            Assignee: Sylvain Lebresne
>             Fix For: 2.0.8
>
>         Attachments: 7052.txt
>
>
> I tested this on Cassandra 2.0.6 and 2.0.3 and got the same result on both:
> {code}
> cqlsh> create KEYSPACE "test" WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
> cqlsh> USE "test";
> cqlsh:test> CREATE COLUMNFAMILY "VerifyPagedColumnQueryStartAndEnd" ("keyId" text, "columnName" text, "value" text, PRIMARY KEY ("keyId", "columnName")) WITH COMPACT STORAGE;
> cqlsh:test> INSERT INTO "VerifyPagedColumnQueryStartAndEnd" ("keyId", "columnName", "value") VALUES ( 'key', 'a', '1' )  ;
> cqlsh:test> INSERT INTO "VerifyPagedColumnQueryStartAndEnd" ("keyId", "columnName", "value") VALUES ( 'key', 'b', '1' )  ;
> cqlsh:test> INSERT INTO "VerifyPagedColumnQueryStartAndEnd" ("keyId", "columnName", "value") VALUES ( 'key', 'c', '1' )  ;
> cqlsh:test> INSERT INTO "VerifyPagedColumnQueryStartAndEnd" ("keyId", "columnName", "value") VALUES ( 'key', 'd', '1' )  ;
> cqlsh:test> INSERT INTO "VerifyPagedColumnQueryStartAndEnd" ("keyId", "columnName", "value") VALUES ( 'key', 'e', '1' )  ;
> cqlsh:test> SELECT * FROM "VerifyPagedColumnQueryStartAndEnd" WHERE "keyId" = 'key' AND "columnName" > '' AND "columnName" <= 'e' LIMIT 2;
>  keyId | columnName | value
> -------+------------+-------
>    key |          a |     1
>    key |          b |     1
>    key |          c |     1
> (3 rows)
> cqlsh:test>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)