YCQL Drivers: Identify if an upsert operation inserts or updates the row

Hi,

is there a way to identify if an upsert operation like the one shown below, inserts or either updates the row e.g., with the Java or Golang driver?

UPDATE test set value = 'value1', checkpoint = 'cas1' WHERE key = 'key1' IF checkpoint = '' OR NOT EXISTS;

Regards

You can use RETURNS STATUS AS ROW as documented here: https://docs.yugabyte.com/preview/api/ycql/dml_update/#returns-status-as-row

@Alan_Caldera

I tried the following, and it does not seem to work for me. Insert and Update cannot be distinguished.

ycqlsh> create keyspace ks;
ycqlsh> use ks;
ycqlsh:ks> create table test(key text primary key, value text, checkpoint text);

# Inserting a new row
ycqlsh:ks> update test set value='v1', checkpoint='c1' where key='k1' if checkpoint='' or not exists returns status as row;

[applied] | [message] | key  | value | checkpoint
-----------+-----------+------+-------+------------
      True |      null | null |  null |       null


# Updating an existing row
ycqlsh:ks> update test set value='v1', checkpoint='c1' where key='k1' if checkpoint='c1' or not exists returns status as row;

[applied] | [message] | key  | value | checkpoint
-----------+-----------+------+-------+------------
      True |      null | null |  null |       null

For the insert I would expect applied=false