cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6382) Allow indexing nested types
Date Wed, 20 Nov 2013 14:23:37 GMT


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
CREATE TYPE pair (x int, y int);
   k int PRIMARY KEY,
   s set<pair>
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:
CREATE INDEX ON test(values(s).y);
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:
SELECT * FROM bar WHERE $e.y = 'foo' FOR $e IN s;
but that a tad complex maybe.

> Allow indexing nested types
> ---------------------------
>                 Key: CASSANDRA-6382
>                 URL:
>             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

View raw message