You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2013/11/20 15:23:37 UTC

[jira] [Commented] (CASSANDRA-6382) Allow indexing nested types

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

Sylvain Lebresne commented on CASSANDRA-6382:
---------------------------------------------

As said on CASSANDRA-4511, there is no real technical challenge on the indexing part here (unless there's one I miss), but I'm not at all sure about what syntax to go with. The difficulty being that, because user types are mostly useful inside collections, we'd want to allow indexing a specific field of the value of a collection. To make things concrete, if we have the following table:
{noformat}
CREATE TYPE pair (x int, y int);
CREATE TABLE test (
   k int PRIMARY KEY,
   s set<pair>
);
{noformat}
We'd want to index the 'y' field of the values of 's'.

And there is 2 bits for which we need a syntax: 1) to declare the index in the first place and 2) to actually query it.

For 1), I might suggest something like:
{noformat}
CREATE INDEX ON test(values(s).y);
{noformat}
and we would have a keys() pseudo-function for maps too, which could be the syntax we use for CASSANDRA-6383 (in which case, {{CREATE INDEX ON test(s)}} would basically be a shortcut for {{CREATE INDEX ON test(values(s))}}).

For 2), I don't have any good idea so far, outside of my suggestion from CASSANDRA-4511, i.e:
{noformat}
SELECT * FROM bar WHERE $e.y = 'foo' FOR $e IN s;
{noformat}
but that a tad complex maybe.

> Allow indexing nested types
> ---------------------------
>
>                 Key: CASSANDRA-6382
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6382
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)