You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Evens Max Pierrelouis (Jira)" <ji...@apache.org> on 2022/10/28 16:04:00 UTC

[jira] [Updated] (PHOENIX-792) Support UPSERT SET command

     [ https://issues.apache.org/jira/browse/PHOENIX-792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evens Max Pierrelouis  updated PHOENIX-792:
-------------------------------------------
    Attachment: 198416324-4ede2959-0d83-4f64-80e1-5d975d235a13.jpg

> 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
>         Attachments: 198416324-4ede2959-0d83-4f64-80e1-5d975d235a13.jpg
>
>
> 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)