cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frens Jan Rumph (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-7711) composite column not sliced when using IN clause on (other) composite columns
Date Thu, 07 Aug 2014 10:21:12 GMT
Frens Jan Rumph created CASSANDRA-7711:
------------------------------------------

             Summary: 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


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.2#6252)

Mime
View raw message