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

Lists inserts are not truly idempotent

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Legacy/Core
    • Labels:
      None
    • Severity:
      Normal
    • Since Version:

      Description

      List of UDT can't be updated properly when using USING TIMESTAMP

      Observe:

      cqlsh:t360> CREATE TYPE fullname ( 
      ... fname text, 
      ... lname text 
      ... );
      
      cqlsh:t360> CREATE TABLE users ( 
      ... id text PRIMARY KEY, 
      ... names list<frozen <fullname>>, 
      ... phone text 
      ... ); 
      
      cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 'fname3', lname: 'lname3'}] WHERE id='a'; 
      cqlsh:t360> select * from users;
      
      id | names | phone 
      ----+--------------------------------------------------------------------------------------------------------------+------- 
      a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}] | null
      
      (1 rows) 
      cqlsh:t360> UPDATE users USING TIMESTAMP 1458019725701 SET names = [{ fname: 'fname1', lname: 'lname1'},{ fname: 'fname2', lname: 'lname2'},{ fname: 'fname3', lname: 'lname3'}] WHERE id='a'; 
      cqlsh:t360> select * from users;
      
      id | names | phone 
      ----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------- 
      a | [{lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}, {lname: 'lname1', fname: 'fname1'}, {lname: 'lname2', fname: 'fname2'}, {lname: 'lname3', fname: 'fname3'}] | null
      
      (1 rows)
      
      

      => the list doesn't get replaced, it gets appended, which is not the expected/desired result

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thatran Thanh
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: