virajjasani opened a new pull request, #2203: URL: https://github.com/apache/phoenix/pull/2203
Jira: PHOENIX-7648 Phoenix provides two types of Atomic Update operations: `ON DUPLICATE KEY IGNORE` and `ON DUPLICATE KEY UPDATE`. The purpose of `ON DUPLICATE KEY IGNORE` is to perform the insertion of new row i.e. if the row does not exist, add the row, else ignore the update operation. The purpose of `ON DUPLICATE KEY UPDATE` is to provide atomic update based on the expressions provided on the various non-pk columns. For the conditional updates that include `CASE` expression, the atomic update goes through successfully only if the condition is satisfied on the row. However, if the row does not already exist, `ON DUPLICATE KEY UPDATE` performs the insertion anyways regardless of the condition provided. There are valid use cases that consider the absence of the row as condition not being satisfied i.e. if the row does not exist, the condition provided with `CASE` statement is not satisfied anyways. Therefore, the purpose of this PR is to introduce new type of atomic update operation with statement `ON DUPLICATE KEY UPDATE_ONLY`, that performs the condition evaluation similar to `ON DUPLICATE KEY UPDATE`, however if the row does not exist, `UPDATE_ONLY` is not expected to perform any insertion. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
