-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support unique secondary index #322
Comments
For e.g.
} |
hi @rohitjoshi : Currently, we don't support Lua scripting in our our Redis-compatible offering. For now, for multiple table ACID or multi-key ACID operations spanning shards- we suggest using our Cassandra based interface with the extensions (YCQL). But we can look into adding this type of capability in the Redis interface in the future. In your specific example, did you mean for both keys to have the same regards, |
@kmuthukk thanks. thanks correcting. I am looking for |
Summary: This revision implements unique secondary index with conditional DML support. In addition, this revision changes the status row returned when a conditional DML fails due to failed conditions. Apart from the existing values of the non-key columns that are read to check the conditions, the row now includes the primary key of the row being modified (or just the hash key if the DML modifies only the hash key or the static columns). For example: ``` cqlsh:k> create table t (k int primary key, c int); cqlsh:k> insert into t (k, c) values (1, 2); cqlsh:k> select * from t; k | c ---+--- 1 | 2 cqlsh:k> insert into t (k, c) values (1, 2) if not exists or c <> 2; [applied] | k | c -----------+---+--- False | 1 | 2 ``` Test Plan: TestIndex.testUniqueIndex Reviewers: kannan, mihnea Reviewed By: mihnea Subscribers: kannan, bogdan, yql, bharat Differential Revision: https://phabricator.dev.yugabyte.com/D4958
Unique secondary index for YCQL has been implemented in commit 3769c97. |
👍 looking forward to try this out. |
Thx @rohitjoshi . We'll get an updated release tar ball with this change out soon. |
Summary: This revision fixes the YCQL proxy to abort the transaction if a conditional DML fails to apply due to unsatisfied condition. Test Plan: TestIndex.testConditionalDML Reviewers: mihnea Reviewed By: mihnea Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D4978
… violation Summary: Always raise unique constraint error for when inserting duplicate value in a unique secondary index even when executing via an IF NOT EXISTS conditional DML statement. Test Plan: TestIndex.testConditionalDML Reviewers: mihnea Reviewed By: mihnea Subscribers: kannan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D4982
Currently, YugaByte DB supports non-unique secondary index. In some use cases, the application may require the index to be unique.
For example, consider an
employee
table which hasid
as the primary key column, and anotheremail
column where the entries need to be unique. This could be achieved as follows:Insert statements would look as follows:
The text was updated successfully, but these errors were encountered: