So I'm trying to do a CAS (compare-and-set) type operation in Cassandra, where I want to do a data update only if a particular non-primary-key column is NULL
or < ?
where ?
is supplied by client-side code.
How do I do this? Something like the following doesn't work:
UPDATE my_dbs.foo SET col1=5 WHERE id=1 IF (col1 = NULL OR col1 < 4);
The error I get is similar to the following:
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:149 no viable alternative at input '(' (...
How do I do this in Cassandra 2.0/2.1?