[
https://issues.apache.org/jira/browse/CALCITE-5299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610797#comment-17610797
]
Benchao Li commented on CALCITE-5299:
-------------------------------------
I would take this and CALCITE-5265 both improvement instead of bug. As you have
mentioned that we do not generate {{SqlWith}} in {{RelToSqlConverter}}
currently, hence this is less important than CALCITE-5265. However, I think
this is still worth to do this improvement.
> JDBC adapter sometimes adds unnecessary parentheses around SELECT in WITH body
> ------------------------------------------------------------------------------
>
> Key: CALCITE-5299
> URL: https://issues.apache.org/jira/browse/CALCITE-5299
> Project: Calcite
> Issue Type: Bug
> Reporter: Mou Wu
> Assignee: Mou Wu
> Priority: Minor
>
> Note: This issue is related to
> https://issues.apache.org/jira/browse/CALCITE-5265
> You should view comments in CALCITE-5265 before you view this issue.
> Add a case in SqlParserTest:
>
> {code:java}
> // code placeholder
> @Test void testWithSelect() {
> final String sql = "with emp2 as (select * from emp)\n"
> + "select * from emp2\n";
> final String expected = "WITH `EMP2` AS (SELECT *\n" +
> "FROM `EMP`) SELECT *\n" +
> "FROM `EMP2`";
> sql(sql).ok(expected);
> } {code}
> will fail, because actual sql is with parentheses.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)