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

Andrés de la Peña commented on CASSANDRA-14182:
-----------------------------------------------

Nice patch, +1 assuming CI looks good.

Just a trivial detail that can be addressed during commit: can you change [this 
{{row(null)}}|https://github.com/blerer/cassandra/blob/bc0d444c18a963465e8758cbb3759030a6442932/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java#L1818]
 by {{row((Map) null)}} to prevent the build warning, as it is done 
[here|https://github.com/blerer/cassandra/blob/bc0d444c18a963465e8758cbb3759030a6442932/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java#L1874]?

> Sub-range selection for non-frozen collections should return null instead of 
> empty
> ----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14182
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14182
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>            Priority: Minor
>
> For non frozen collections, Cassandra cannot differentiate an empty 
> collection from a {{null}} one. Due to that Cassandra returns always {{null}} 
> for non-frozen empty collection.
> When selecting a sub range from a non-frozen collection, if the range does 
> not contains any data an empty collection will be returned. It is counter 
> intuitive and a {{null}} value should be returned instead.
>  
> {code:sql}
> CREATE TABLE IF NOT EXISTS t (k int PRIMARY KEY, v set<int>);
> INSERT INTO t (k, v) VALUES (1, {});
> SELECT v FROM t; -- null
> SELECT v[1] FROM t; -- null
> SELECT v[1..] FROM t; -- null
> INSERT INTO t (k, v) VALUES (1, {0});
> SELECT v FROM t; -- {0}
> SELECT v[1] FROM t; -- null
> SELECT v[1..] FROM t; -- {}
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to