cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6706) Duplicate rows returned when in clause has repeated values
Date Wed, 21 Jan 2015 13:19:35 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-6706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14285616#comment-14285616
] 

Robert Stupp commented on CASSANDRA-6706:
-----------------------------------------

+1 on the 2.1 patch. It triggers the warning once for the example in the ticket description.

The trunk patch should have tests for duplicate IN values on the partition key.
It checks on duplicate IN values on the clustering key (even 2.1 does not return duplicates
on CK duplicates).
You can simply add other assertions like {{SELECT * FROM %s WHERE k1 IN (?, ?) AND k2 = ?}}
or {{SELECT * FROM %s WHERE k1 IN (?, ?) AND k2 IN (?, ?)}}.

> Duplicate rows returned when in clause has repeated values
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-6706
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6706
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Found on 
> [cqlsh 4.1.0 | Cassandra 2.0.3-SNAPSHOT | CQL spec 3.0.0 | Thrift protocol 19.38.0]
>            Reporter: Gavin Casey
>            Assignee: Benjamin Lerer
>              Labels: cql
>             Fix For: 3.0
>
>         Attachments: CASSANDRA-6706-2.1.txt, CASSANDRA-6706-trunk.txt
>
>
> If a value is repeated within an IN clause then repeated rows are returned for  the repeats:
> cqlsh> create table t1(c1 text primary key);
> cqlsh> insert into t1(c1) values ('A');
> cqlsh> select * from t1;
>  c1
> ----
>   A
> cqlsh> select * from t1 where c1 = 'A';
>  c1
> ----
>   A
> cqlsh> select * from t1 where c1 in( 'A');
>  c1
> ----
>   A
> cqlsh:dslog> select * from t1 where c1 in( 'A','A');
>  c1
> ----
>   A
>   A



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message