New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YCQL] Identify if an upsert operation inserts or updates fails #13606
Comments
But the row is inserted (because of Updates in YCQL are like UPSERTS. Example ycqlsh:ks> update test set value='v1', checkpoint='c1' where key='k2' returns status as row;
[applied] | [message] | key | value | checkpoint
-----------+-----------+------+-------+------------
True | null | null | null | null
ycqlsh:ks> select * from test;
key | value | checkpoint
-----+-------+------------
k2 | v1 | c1
(1 rows)
|
@ddorian If this behavior is intended, what is the best way to distinguish/identify if a value is inserted or updated when using an upsert statement? |
It's not currently possible to distinguish because it doesn't do a read to check if the row exists or not. |
@ddorian What do you think, does it make sense to support such kind of feature? |
@beatrausch personally, no. This feature is already supported in YSQL, so you can use that API if you need it. YCQL is supposed to compete with Cassandra (where this feature has very low chance of landing) |
@ddorian If you want to use the TTL feature from YCQL that is not possible with YSQL right? |
@in-cloud-opensource no, it's not. Can you explain your complete use case for this table where you need TTL & UPSERT ? |
Jira Link: DB-3181
Description
Hi,
we try to identify if an upsert statement inserts or updates the row based on the RETURNS STATUS AS ROW.
When we run the following example with YB Version 2.14.1.0 it does not seem to work as expected:
For the insert we would expect applied=false
Works as expected
The text was updated successfully, but these errors were encountered: