-
Notifications
You must be signed in to change notification settings - Fork 24
1.2.2 Release Notes (2023 07 07)
IHEII edited this page Jul 7, 2023
·
2 revisions
Previous Release Notes: 1.2.1 Release Notes (2023 07 04)
We now support filter in insert operation.
Autoincrement column is a new feature in OBKV. We add some cases on this feature to check whether it works as we expected.
Here is a simple demo of insert with filter
ObTableValueFilter filter = compareVal(ObCompareOp.EQ, "c2", 1);
MutationResult insertResult = client.insert("mutation_table")
.setRowKey(colVal("c1", 2)).setFilter(filter)
.addScanRange(new Object[] { 1 }, new Object[] { 200 })
.addMutateRow(row(colVal("c2", 2)).execute();
Insert with Filter in OBKV is a kind of operation very similar to CheckAndPut in HBase. That is, server will check whether a row of data getting from scan range satisfies the filter field. More examples could be found at example and tests. And we will write a document for this feature in the future.
Notes:
- Data that you want to check must be in the same partition where you want to insert. You could easily satisfy this restriction by setting the same partition key in both scanRange and operation.
- Remember to set scanRange otherwise it may take more time to filter the data.
You could learn more about autoincrement column in OBKV from tests or example
Notes:
- The partition key can not be used as the auto-increment column.
- Only the column with the type of tinyint / int / bigint can be set as an auto-increment column.