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 2014/09/02 15:51:21 UTC
[jira] [Commented] (CASSANDRA-7711) composite column not sliced
when using IN clause on (other) composite columns
[ https://issues.apache.org/jira/browse/CASSANDRA-7711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14118208#comment-14118208 ]
Benjamin Lerer commented on CASSANDRA-7711:
-------------------------------------------
The problem comes from the fact that {quote} (b) in (('b1'), ('b2')) {quote} is a multi column relation. We do not support the mix of single column relations and multi column relations but have no check to prevent it.
> 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: Core
> Environment: cassandra 2.0.9
> Reporter: Frens Jan Rumph
> Assignee: Benjamin Lerer
> Labels: cql
> Fix For: 2.0.11
>
>
> 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)