Is there any way to prevent the CQL command Update from creating a new row if the row key 'row1' doesn't exist?
UPDATE columnfamily SET data = 'test data' WHERE key = 'row1';
Update 2015-04-10:
As of Cassandra 2.0 you can use light weight transactions to accomplish this. Be aware that although they are called "light weight" these queries require a lot more work to be done on the Cassandra cluster.
Thanks to @BSB for the update.
Pre 2.0 answer:
No. Unlike in SQL, in CQL Update
and insert
are semantically the same. You would have to do a read first to determine the existence of the row.