phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <>
Subject [jira] [Updated] (PHOENIX-2909) Surface checkAndPut through UPDATE statement
Date Thu, 18 Aug 2016 15:47:20 GMT


James Taylor updated PHOENIX-2909:
    Summary: Surface checkAndPut through UPDATE statement  (was: Surface checkAndPut through
UPDATE support)

> Surface checkAndPut through UPDATE statement
> --------------------------------------------
>                 Key: PHOENIX-2909
>                 URL:
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
> We can surface atomic checkAndPut like functionality through support of the SQL UPSERT
> For example, the following could use do a get under row lock to perform the row update
> {code}
> UPDATE  my_table SET counter=coalesce(counter,0) + 1 FROM my_table;
> {code}
> To force prior MVCC transactions to complete (making it serializable as an Increment
is), we'd have code like this:
> {code}
>     mvcc = region.getMVCC();
>     mvcc.completeMemstoreInsert(mvcc.beginMemstoreInsert());
> {code}
> By users setting auto commit to true and issuing an UPDATE statement over a non transactional
table, they'd get a way for row updates to be atomic. This would work especially well to support
> Note that the coalesce call above handles the case where counter is null. This could
be made prettier with support for the DEFAULT clause at CREATE TABLE time (PHOENIX-476).

This message was sent by Atlassian JIRA

View raw message