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

Strange result of several list updates in a single request

    XMLWordPrintableJSON

Details

    • Low

    Description

      Let's assume that we have a row with the 'listColumn' column and value {1,2,3,4}.
      For me it looks logical to expect that the following two pieces of code will ends up with the same result but it isn't so.
      Code1:

      UPDATE t SET listColumn[2] = 7, listColumn[2] = 8  WHERE id = 1;
      

      Expected result: listColumn={1,2,8,4}
      Actual result: listColumn={1,2,7,8,4}

      Code2:

      UPDATE t SET listColumn[2] = 7  WHERE id = 1;
      UPDATE t SET listColumn[2] = 8  WHERE id = 1;
      

      Expected result: listColumn={1,2,8,4}
      Actual result: listColumn={1,2,8,4}

      So the question is why Code1 and Code2 give different results?
      Looks like Code1 should give the same result as Code2.

      Attachments

        Activity

          People

            blerer Benjamin Lerer
            mkrupits_jb Mikhail Krupitskiy
            Benjamin Lerer
            Sylvain Lebresne
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: