You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "thrylokya (Jira)" <ji...@apache.org> on 2022/10/24 12:04:00 UTC
[jira] [Assigned] (PHOENIX-792) Support UPSERT SET command
[ https://issues.apache.org/jira/browse/PHOENIX-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
thrylokya reassigned PHOENIX-792:
---------------------------------
Assignee: thrylokya
> Support UPSERT SET command
> --------------------------
>
> Key: PHOENIX-792
> URL: https://issues.apache.org/jira/browse/PHOENIX-792
> Project: Phoenix
> Issue Type: Task
> Reporter: James R. Taylor
> Assignee: thrylokya
>
> Support setting values in a table through a new UPSERT SET command like this:
> UPSERT my_table SET title = 'CEO'
> WHERE name = 'John Doe'
> UPSERT my_table SET pay_by_quarter = ARRAY[25000,25000,27000,27000]
> WHERE name = 'Carol';
> UPSERT my_table SET pay_by_quarter[4] = 15000
> WHERE name = 'Carol';
> This would essentially be syntactic sugar and use the same UpsertCompiler, mapping to an UPSERT SELECT command that simply fills in the primary key columns like this:
> UPSERT FROM my_table(name,title)
> SELECT name,'CEO' FROM my_table
> WHERE name = 'John Doe'
> UPSERT FROM my_table(name, pay_by_quarter[4])
> SELECT name,15000 FROM my_table
> WHERE name = 'Carol';
--
This message was sent by Atlassian Jira
(v8.20.10#820010)