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

CQL3 does handle List append or prepend with a "Prepared" list

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.2.0 beta 3
    • None
    • None
    • CQL3 Thrift methods (new)

    • Low

    Description

      I can successfully update a List using the "literal" syntax:

      UPDATE testcollection SET L = [98,99,100] + L WHERE k = 1;
      

      And I can successfully "upsert" a List using the "Prepared" syntax:

      UPDATE testcollection SET L = ? WHERE k = 1
      

      by providing a decoded List<Integer> in the bind values.

      But using the "prepared" syntax for an prepend like:

      UPDATE testcollection SET L = ? + L WHERE k = 1
      

      fails with the following message:

      java.sql.SQLSyntaxErrorException: InvalidRequestException(why:line 1:33 mismatched input '+' expecting K_WHERE)
      	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.<init>(CassandraPreparedStatement.java:92)
      ...
      ...
      

      and an append of a "prepared" syntax like:

      UPDATE testcollection SET L = L + ? WHERE k = 1
      

      fails as follows:

      java.sql.SQLSyntaxErrorException: InvalidRequestException(why:invalid operation for non commutative columnfamily testcollection)
      	at org.apache.cassandra.cql.jdbc.CassandraPreparedStatement.<init>(CassandraPreparedStatement.java:92)
      ...
      ...
      

      Attachments

        1. 4945.txt
          32 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            ardot Rick Shaw
            Sylvain Lebresne
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: