cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Krupansky <jack.krupan...@gmail.com>
Subject Re: select from table with list collection
Date Sun, 15 Feb 2015 23:25:29 GMT
That should work. File a Jira. While release of Cassandra are you using?
There were some bugs is indexing for set collections; maybe that affected
list as well.

Out of curiosity, does a SELECT with only "contains 'b'" work?

Also, try using "set" rather than "list".

-- Jack Krupansky

On Sun, Feb 15, 2015 at 4:35 PM, reader 1001 <007reader@gmail.com> wrote:

> I have a simple table with an indexed list<text> field, but it shows
> unexpected behavior when I query the list. Am i doing something incorrect?
>
> create table test (whole text PRIMARY KEY, parts list<text>);
> create index on test (parts);
> insert into test (whole,parts) values('a', ['a']);
> insert into test (whole,parts) values('b', ['b']);
> insert into test (whole,parts) values('c', ['c']);
> insert into test (whole,parts) values('a.a', ['a','a']);
> insert into test (whole,parts) values('a.b', ['a','b']);
> insert into test (whole,parts) values('a.c', ['a','c']);
> insert into test (whole,parts) values('b.a', ['b','a']);
> insert into test (whole,parts) values('b.b', ['b','b']);
> insert into test (whole,parts) values('b.c', ['b','c']);
> insert into test (whole,parts) values('c.c', ['c','c']);
> insert into test (whole,parts) values('c.b', ['c','b']);
> insert into test (whole,parts) values('c.a', ['c','a']);
>
> This is expected behavior:
> ------------------------------------------
> select * from test where parts contains 'a' ALLOW FILTERING;
>
>  whole | parts
> -------+------------
>      a |      ['a']
>    b.a | ['b', 'a']
>    a.c | ['a', 'c']
>    a.b | ['a', 'b']
>    a.a | ['a', 'a']
>    c.a | ['c', 'a']
>
> From the following query I expect a subset of the previous query result,
> but it returns no data
> ---------------------------------------------------
> select * from test where parts contains 'a' and parts contains 'b' ALLOW
> FILTERING;
>
>  whole | parts
> -------+-------
>
>
> Thank you.
>

Mime
View raw message