[ 
https://issues.apache.org/jira/browse/PHOENIX-3732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906933#comment-15906933
 ] 

Kevin Liew edited comment on PHOENIX-3732 at 3/13/17 6:58 AM:
--------------------------------------------------------------

The Phoenix grammar for dynamic columns in {{UPSERT}} differs from the grammar 
defined in CALCITE-493 at 
https://issues.apache.org/jira/browse/CALCITE-493?focusedCommentId=14270040&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14270040

Phoenix allows embedding dynamic column definitions in the target column list 
whereas Calcite (support for extended columns in {{INSERT/UPSERT}} isn't 
implemented yet, but I am working on a patch for that) requires that extended 
columns be specified separately from the target columns.

ie.
Phoenix
{code:sql}
UPSERT INTO EventLog
(eventId, eventTime, eventType, lastGCTime TIME, usedMemory BIGINT, maxMemory 
BIGINT)
VALUES (1, CURRENT_TIME(), ‘abc’, CURRENT_TIME(), 512, 1024);
{code}

Calcite
{code:sql}
UPSERT INTO EventLog
(lastGCTime TIME, usedMemory BIGINT, maxMemory BIGINT)
(eventId, eventTime, eventType, lastGCTime, usedMemory, maxMemory)
VALUES (1, CURRENT_TIME(), ‘abc’, CURRENT_TIME(), 512, 1024);
{code}

[~julianhyde], do we want to allow embedding extended column definitions in the 
target column list in Calcite? Or is this something that should be specific to 
Phoenix?


was (Author: kliew):
The Phoenix grammar for dynamic columns in {{UPSERT}} differs from the grammar 
defined in CALCITE-493 at 
https://issues.apache.org/jira/browse/CALCITE-493?focusedCommentId=14270040&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14270040

Phoenix allows embedding dynamic column definitions in the target column list 
whereas Calcite (support for extended columns in {{INSERT/UPSERT}} isn't 
implemented yet, but I am working on a patch for that) requires that extended 
columns be specified separately from the target columns.

[~julianhyde], do we want to allow embedding extended column definitions in the 
target column list in Calcite? Or is this something that should be specific to 
Phoenix?

> Support for dynamic columns in UPSERT in Phoenix-Calcite
> --------------------------------------------------------
>
>                 Key: PHOENIX-3732
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3732
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Kevin Liew
>              Labels: calcite
>
> https://phoenix.apache.org/dynamic_columns.html
> {quote}
> To upsert a row with dynamic columns:
> UPSERT INTO EventLog (eventId, eventTime, eventType, lastGCTime TIME, 
> usedMemory BIGINT, maxMemory BIGINT) VALUES(1, CURRENT_TIME(), ‘abc’, 
> CURRENT_TIME(), 512, 1024);
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to