Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-14182

Sub-range selection for non-frozen collections should return null instead of empty

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      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.

      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; -- {}
      

        Attachments

          Activity

            People

            • Assignee:
              blerer Benjamin Lerer
              Reporter:
              blerer Benjamin Lerer
              Authors:
              Benjamin Lerer
              Reviewers:
              Andres de la Peña
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: