[
https://issues.apache.org/jira/browse/CALCITE-5326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616373#comment-17616373
]
Jiajun Xie edited comment on CALCITE-5326 at 10/12/22 11:48 AM:
----------------------------------------------------------------
[~clesaec] , there are some guidelines for commit
message.([https://calcite.apache.org/develop/)]
* Start with a capital letter.
* The message is often, but not always, the same as the JIRA subject. If the
JIRA subject is not clear, change it (perhaps move the original subject to the
description of the JIRA case, if it clarifies).
As far as I know, try not to use `fix ...`.
You only change unit test that contain *values.* Can `insertCall.getSource()`
contain `union ... limit`? Does other databases need bracket? We need more
unit test in
RelToSqlConverterTest instead of SqlParserTest.
was (Author: jiajunbernoulli):
[~clesaec] , there are some guidelines for commit
message.([https://calcite.apache.org/develop/)]
* Start with a capital letter.
* The message is often, but not always, the same as the JIRA subject. If the
JIRA subject is not clear, change it (perhaps move the original subject to the
description of the JIRA case, if it clarifies).
As far as I know, try not to use `fix ...`.
> SqlMerge generate extra bracket on toSqlString
> ----------------------------------------------
>
> Key: CALCITE-5326
> URL: https://issues.apache.org/jira/browse/CALCITE-5326
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Christophe Le Saec
> Priority: Major
> Labels: pull-requests-available
> Attachments: SqlMergeTest.java
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Following this [mails
> exchange|https://lists.apache.org/thread/pgycm37ld6v92llv1t6bdmk80wylcspj], i
> build this JIRA about SQL Merge.
> Using SQLMerge on this unit test [^SqlMergeTest.java] i tried to generate
> [SQL Merge SQL code|https://en.wikipedia.org/wiki/Merge_(SQL)].
> this generate
> {code:sql}
> MERGE INTO "OUT_TABLE" AS "Target"
> USING "IN_TABLE" AS "Source"
> ON "TARGET"."ID" = "SOURCE"."IDENT"
> WHEN MATCHED THEN UPDATE SET "TARGET"."FIELD1" = "SOURCE"."F1",
> "TARGET"."FIELD2" = "SOURCE"."F2"
> WHEN NOT MATCHED THEN INSERT ("TARGET"."ID", "TARGET"."FIELD1",
> "TARGET"."FIELD2") (VALUES ("SOURCE"."IDENT", "SOURCE"."F1", "SOURCE"."F2"))
> {code}
> that doesn't work because of the bracket before VALUES on last line.
> just removing brackets
> {code:sql}
> WHEN NOT MATCHED THEN INSERT ("TARGET"."ID", "TARGET"."FIELD1",
> "TARGET"."FIELD2") VALUES ("SOURCE"."IDENT", "SOURCE"."F1", "SOURCE"."F2")
> {code}
> make the query work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)