[
https://issues.apache.org/jira/browse/CASSANDRA-7711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benjamin Lerer updated CASSANDRA-7711:
--------------------------------------
Component/s: CQL
> composite column not sliced when using IN clause on (other) composite columns
> -----------------------------------------------------------------------------
>
> Key: CASSANDRA-7711
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7711
> Project: Cassandra
> Issue Type: Bug
> Components: CQL
> Environment: cassandra 2.0.9
> Reporter: Frens Jan Rumph
> Assignee: Benjamin Lerer
> Priority: Minor
> Labels: cql
> Fix For: 2.0.11, 2.1.1
>
> Attachments: CASSANDRA-7711-V2.txt, CASSANDRA-7711.txt
>
>
> Hi,
> I'm storing data points in cassandra keyed by a number of values and a
> timestamp. I'd want to use IN clauses to select points and sliced by time.
> The in clauses work, but I can't get it to work in combination with the
> slicing: all values are returned / the range in the where clause seems to be
> ignored.
> A dumbed down abstract version of my layout and some sample data:
> {code}
> create table tbl (
> a text,
> b text,
> c int,
> d int,
> primary key ((a), b, c)
> );
> insert into tbl (a,b,c,d) values ('a1', 'b1', 1, 1);
> insert into tbl (a,b,c,d) values ('a1', 'b1', 2, 2);
> insert into tbl (a,b,c,d) values ('a1', 'b2', 1, 1);
> insert into tbl (a,b,c,d) values ('a1', 'b2', 2, 2);
> insert into tbl (a,b,c,d) values ('a2', 'b1', 1, 1);
> insert into tbl (a,b,c,d) values ('a2', 'b1', 2, 2);
> insert into tbl (a,b,c,d) values ('a3', 'b2', 1, 1);
> insert into tbl (a,b,c,d) values ('a3', 'b2', 2, 2);
> {code}
> So the table contains:
> {code}
> a | b | c | d
> ----+----+---+---
> a1 | b1 | 1 | 1
> a1 | b1 | 2 | 2
> a1 | b2 | 1 | 1
> a1 | b2 | 2 | 2
> a2 | b1 | 1 | 1
> a2 | b1 | 2 | 2
> a3 | b2 | 1 | 1
> a3 | b2 | 2 | 2
> {code}
> When performing {{select * from tbl where a in ('a1', 'a2') and (b) in
> (('b1'), ('b2')) and c > 1;}} I get:
> {code}
> a | b | c | d
> ----+----+---+---
> a1 | b1 | 1 | 1
> a1 | b1 | 2 | 2
> a1 | b2 | 1 | 1
> a1 | b2 | 2 | 2
> a2 | b1 | 1 | 1
> a2 | b1 | 2 | 2
> {code}
> But I expected:
> {code}
> a | b | c | d
> ----+----+---+---
> a1 | b1 | 2 | 2
> a1 | b2 | 2 | 2
> a2 | b1 | 2 | 2
> {code}
> Am I doing something wrong? Or is {{c > 1}} incorrectly ignored?
> {{select * from tbl where a in ('a1', 'a2') and b='b1' and c > 1;}} does
> correctly produce:
> {code}
> a | b | c | d
> ----+----+---+---
> a1 | b1 | 2 | 2
> a2 | b1 | 2 | 2
> {code}
> So I expect this behaviour to relate to the interworking of the IN clause on
> the clustering column b and the > predicate on column c.
> Cheers,
> Frens Jan
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)