You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yuki Morishita (JIRA)" <ji...@apache.org> on 2014/02/27 03:17:19 UTC

[jira] [Resolved] (CASSANDRA-6776) Secondary Index on Map type isn't returning the expected result

     [ https://issues.apache.org/jira/browse/CASSANDRA-6776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuki Morishita resolved CASSANDRA-6776.
---------------------------------------

    Resolution: Not A Problem

Your way of indexing on map creates index on map *values*. If you want to create index on map *keys*, you have to do so by

{code}
CREATE INDEX keyword_index on testks.test2 (KEYS(keywords));
{code}

Notice KEYS keyword.
In this way, you can use index with CONTAINS KEY syntax.

Note that current Cassandra only can create either map keys or map values.

> Secondary Index on Map type isn't returning the expected result
> ---------------------------------------------------------------
>
>                 Key: CASSANDRA-6776
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6776
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: windows 7 64bit, jdk1.7 64bit, latest code from github today
>            Reporter: Peter
>             Fix For: 2.1
>
>         Attachments: c21-list-indexmap-test.cql, testks-test2.keyword_index-ka-1-Index.db
>
>
> I am attaching the cql script I use to test. The output I get from the query returns zero rows.
> cqlsh:testks> select * from testks.test2 where keywords CONTAINS KEY 'cool';
> (0 rows)
> cqlsh:testks>
> When I run a query for set<text> it works fine.
> cqlsh:testks> select * from testks.test2 where nicknames CONTAINS 'barb';
>  user_name | birth_year | gender | keywords                   | nicknames                     | password | session_token | state
> -----------+------------+--------+----------------------------+-------------------------------+----------+---------------+-------
>     user10 |       1968 |      f | {'cool': '3', 'lame': '1'} | {'barb', 'barbara', 'barbie'} |     null |          null |    co
> (1 rows)
> I exit cqlsh and run nodetool flush. When I look at the index file for keywords index, it doesn't look right. Seems to be missing entries. The file is also attached.



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