Details
-
Improvement
-
Status: Resolved
-
Low
-
Resolution: Fixed
Description
Given a table with only a primary key, like
CREATE TABLE test (k int PRIMARY KEY)
there is currently no way to CAS a row in that table into existing because:
- INSERT doesn't currently support IF
- UPDATE has no way to update such table
So we should probably allow IF conditions on INSERT statements.
In addition (or alternatively), we could work on allowing UPDATE to update such table. One motivation for that could be to make UPDATE always be more general to INSERT. That is currently, there is a bunch of operation that INSERT cannot do (counter increments, collection appends), but that "primary key table" case is, afaik, the only case where you need to use INSERT. However, because CQL forces segregation of PK value to the WHERE clause and not to the SET one, the only syntax that I can see work would be:
UPDATE WHERE k=0;
which maybe is too ugly to allow?
Attachments
Attachments
Issue Links
- is related to
-
CASSANDRA-5832 DELETE CAS on 'primary key only' table
- Resolved