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

Russ Hatch commented on CASSANDRA-4511:
---------------------------------------

I'm running into a bit of trouble testing here. When indexing a list column, 
and providing a list literal at insert, I get no results back when querying 
using contains. If create the row without the list, then do an update to add 
the list, the query returns the expected result.

basic steps to reproduce:
{noformat}
I'm working with a single node. I tried the test below with a list<text> and 
list<uuid> types and get the same behavior.

Connected to test_cluster at 127.0.0.1:9160.
[cqlsh 4.1.1 | Cassandra 2.1-SNAPSHOT | CQL spec 3.1.1 | Thrift protocol 
19.39.0]
Use HELP for help.
cqlsh> create keyspace list_index_search with replication = 
{'class':'SimpleStrategy', 'replication_factor':1} ;
cqlsh> CREATE TABLE list_index_search.users (
   ... user_id uuid PRIMARY KEY,
   ... email text,
   ... tags list<text>
   ... );
cqlsh> CREATE INDEX user_uuids on list_index_search.users (tags);
cqlsh> INSERT INTO list_index_search.users (user_id, email, tags)
   ... values (370e0d97-9c23-4718-9f74-ac5778bd8636, 't...@example.com', 
['awesome']);
cqlsh> select * from list_index_search.users where tags contains 'awesome';
-- aaaaaaaaaargh, no rows!
(0 rows)

cqlsh> UPDATE list_index_search.users SET tags = ['awesome'] where user_id = 
370e0d97-9c23-4718-9f74-ac5778bd8636;
cqlsh> select * from list_index_search.users where tags contains 'awesome';

 user_id                              | email            | tags
--------------------------------------+------------------+-------------
 370e0d97-9c23-4718-9f74-ac5778bd8636 | t...@example.com | ['awesome']

(1 rows)

cqlsh> 
{noformat}

> Secondary index support for CQL3 collections 
> ---------------------------------------------
>
>                 Key: CASSANDRA-4511
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4511
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.2.0 beta 1
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1
>
>         Attachments: 4511.txt
>
>
> We should allow to 2ndary index on collections. A typical use case would be 
> to add a 'tag set<String>' to say a user profile and to query users based on 
> what tag they have.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to