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

Sylvain Lebresne commented on CASSANDRA-7396:
---------------------------------------------

bq. am I correct, that 
org.apache.cassandra.db.filter.ColumnFilter.Builder#addSubSelection would be 
the "key" method to query individual elements / slices from collections (sets + 
maps)?

You are.

But I'll note that for this ticket my preference would be to stick to basically 
expose what {{ColumnFilter.Builder#addSubSelection}} basically provides 
internally. In particular, I'd rather not add anything for lists as we can't 
make dealing with lists efficient. In fact, I'd rather make it clear that lists 
are a second class citizen that is rarely useful and only if you know what 
you're doing.

I'm also not entirely convinced by the {{?}} syntax suggested above. In 
particular, having {{map?\[key\]}} return a boolean but {{map?\[key1...key2\]}} 
a set of value is a bit inconsistent. I'm also not sure that syntax is common 
enough that it's worth adding specific syntax for it. We could for instance 
have {{has(set, key1)}} if we just want to test an element existence. For 
{{map?\[key1...key2\]}}, an alternative could be to have a {{keys()}} function 
that applied to a map returns the set of keys.


> Allow selecting Map key, List index
> -----------------------------------
>
>                 Key: CASSANDRA-7396
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7396
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: CQL
>            Reporter: Jonathan Ellis
>            Assignee: Robert Stupp
>              Labels: cql
>             Fix For: 3.x
>
>         Attachments: 7396_unit_tests.txt
>
>
> Allow "SELECT map['key]" and "SELECT list[index]."  (Selecting a UDT subfield 
> is already supported.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to