cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-4511) Secondary index support for CQL3 collections
Date Tue, 19 Nov 2013 08:33:27 GMT


Sylvain Lebresne commented on CASSANDRA-4511:

bq. How could this extend to user types?

Technically, we'd need versions of the existing CompositesIndex (the one on "regular" columns
and the 2 new ones introduced by this patch for user types within collections) that knows
how to reach into the value to find the actual value indexed. But that should be fairly straightforward.

Syntax-wise, that's a harder problem :). For user types not in a collection, the simplest
solution seems to just use the dot notation (so SELECT * FROM bar WHERE x.y = 'foo') but I
suppose your meant user types in collections, i.e, given
CREATE USER TYPE sometype (y text, z text)
CREATE TABLE bar (k int PRIMARY KEY, x set<sometype>)
how do you index the 'y' field of the values in 'x'. In which case I don't really have a good
syntax to offer so far, not even to declare the index in the first place. Maybe we'd have
to resort to some sort of variable binding, something like
SELECT * FROM bar WHERE $e.y = 'foo' FOR $e IN x
(where I use a '$' to make it clear that '$e' would just be some form of query-local variable
but we can do without it)

bq. Since maps are basically one of the big replacements for dynamic columns

Oh My...

> Secondary index support for CQL3 collections 
> ---------------------------------------------
>                 Key: CASSANDRA-4511
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>    Affects Versions: 1.2.0 beta 1
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 2.1
>         Attachments: 4511.txt
> We should allow to 2ndary index on collections. A typical use case would be to add a
'tag set<String>' to say a user profile and to query users based on what tag they have.

This message was sent by Atlassian JIRA

View raw message