cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russ Hatch (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8147) Secondary indexing of map keys does not work properly when mixing contains and contains_key
Date Mon, 20 Oct 2014 21:22:34 GMT

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

Russ Hatch commented on CASSANDRA-8147:
---------------------------------------

I think there is not currently support for indexing both values and keys (ref: http://www.datastax.com/dev/blog/cql-in-2-1)

In the example above the index is on keys only, but the select is attempting to query a values
index too. So the empty result is sort of correct, but there should probably be a warning
message to prevent confusion about this ("index does not exist" or something like that).

/cc [~slebresne]

> Secondary indexing of map keys does not work properly when mixing contains and contains_key
> -------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8147
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8147
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Priority: Minor
>
> If you have a table with a map column and an index on the map key selecting data using
a contains key and a contains will not return the expected data.
> The problem can be reproduced using the following unit test:
> {code}
>     @Test
>     public void testMapKeyContainsAndValueContains() throws Throwable
>     {
>         createTable("CREATE TABLE %s (account text, id int, categories map<text,text>,
PRIMARY KEY (account, id))");
>         createIndex("CREATE INDEX ON %s(keys(categories))");
>         execute("INSERT INTO %s (account, id , categories) VALUES (?, ?, ?)", "test",
5, map("lmn", "foo"));
>         assertRows(execute("SELECT * FROM %s WHERE account = ? AND id = ? AND categories
CONTAINS KEY ? AND categories CONTAINS ? ALLOW FILTERING", "test", 5, "lmn", "foo"), row("test",
5, map("lmn", "foo")));  
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message