Hi Enrico,

I have the impression that UPSERT is currently supported only at the parser
level [1] so it seems normal that you don't find something relevant in
LogicalTableModify etc. Note that the SQL standard equivalent is the MERGE
statement [2] but this also seems to be supported only at the
parser/validator level [2].
I guess it is not necessary to introduce more things in TableModify since
UPSERT seems to be syntactic sugar. I think that most of the work can be
done in RelToSqlConverter [4] and possibly the rest of the code can be left
intact.

Best,
Stamatis

[1] https://issues.apache.org/jira/browse/CALCITE-492
[2] https://en.wikipedia.org/wiki/Merge_(SQL)
[3] https://issues.apache.org/jira/browse/CALCITE-985
[4]
https://github.com/apache/calcite/blob/d234626227954eefffe49f42abec65c649ffe3a6/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java#L2395

On Sun, Mar 15, 2020 at 6:53 PM Enrico Olivelli <eolive...@gmail.com> wrote:

> Hi,
> I am trying to use UPSERT but it seems to me that in TableModify (or
> best LogicalTableModify or EnumerableTableModify) there is no way to
> distinguish an INSERT from an UPSERT.
>
> Am I missing something?
>
> Regards
> Enrico
>

Reply via email to