You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mou Wu (Jira)" <ji...@apache.org> on 2022/09/28 03:05:00 UTC
[jira] [Updated] (CALCITE-5299) JDBC adapter sometimes adds unnecessary parentheses around SELECT in WITH body
[ https://issues.apache.org/jira/browse/CALCITE-5299?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mou Wu updated CALCITE-5299:
----------------------------
Summary: JDBC adapter sometimes adds unnecessary parentheses around SELECT in WITH body (was: Unparsing should not add parentheses for SELECT in WITH body)
> 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)