Benjamin Lerer created CASSANDRA-14182:
------------------------------------------

             Summary: 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


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