cassandracqlcql3cqlshcqlinq

Is Cassandra Update IF statement where the condition is an inequality expression supported?


Is UPDATE IF [condition] where [condition] is an inequality, supported by Cassandra CQL?

I had a look over the language reference and it seems that CQL should not be able to support the inequality through its grammar. I used the language reference from here: https://cassandra.apache.org/doc/cql3/CQL.html#updateStmt

What is confusing is that using the C# driver or CQLSH the query is executed successfully, but when doing the same thing from Datasax DevCenter I get an error.

I'm using a query similar to the one below:

UPDATE product
SET edit_date = [new_value]
WHERE customer_id = '4' AND code = 'AMZ-ISMDB' 
IF edit_date < [new_value]

The results are as follows:


Solution

  • The issue is most likely that DevCenter has not been updated to support the latest syntax.

    Inequality conditions were added in: CASSANDRA-6839

    Looks like they missed updating the docs when that was added. I open CASSANDRA-10752 to get that fixed.