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

Benjamin Lerer commented on CASSANDRA-8147:
-------------------------------------------

The empty result is not correct, no matter how you look at it. There are only 
two things that can happen in response to the query:
you either get the good result back or you get an error with a message telling 
you what you did wrong.
I agree that querying a key and a value and on map does not make a lot of 
sense, so an error message will be perfectly acceptable.  

> 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)

Reply via email to