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

Establish consistent distinction between non-existing partition and NULL value for LWTs on static columns

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Severity:
      Normal

      Description

      When executing following CQL commands:

      CREATE KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': '1' };
      USE test;
      CREATE TABLE testtable (a int, b int, s1 int static, s2 int static, v int, PRIMARY KEY (a, b));
      INSERT INTO testtable (a,b,s1,s2,v) VALUES (2,2,2,null,2);
      DELETE s1 FROM testtable WHERE a = 2 IF s2 IN (10,20,30);
      

      The output is different between 2.x and 3.x:

      2.x:

      cqlsh:test> DELETE s1 FROM testtable WHERE a = 2 IF s2 = 5;
      
       [applied] | s2
      -----------+------
           False | null
      

      3.x:

      cqlsh:test> DELETE s1 FROM testtable WHERE a = 2 IF s2 = 5;
      
       [applied]
      -----------
           False
      

      2.x would although return same result if executed on a partition that does not exist at all:

      cqlsh:test> DELETE s1 FROM testtable WHERE a = 5 IF s2 = 5;
      
       [applied]
      -----------
           False
      

      It might be related to static column LWTs, as I could not reproduce same behaviour with non-static column LWTs. The most recent change was CASSANDRA-10532, which enabled LWT operations on static columns with partition keys only. Another possible relation is CASSANDRA-9842, which removed distinction between null column and non-existing row. (striked through since same happens on pre-CASSANDRA-9842 code.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              ifesdjeen Alex Petrov Assign to me
              Reporter:
              ifesdjeen Alex Petrov
              Authors:
              Alex Petrov
              Reviewers:
              Sylvain Lebresne

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment