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

Hanumath Rao Maduri edited comment on CALCITE-6178 at 1/8/24 7:06 PM:
----------------------------------------------------------------------

[~julianhyde]  This 
[PR|https://github.com/apache/calcite/commit/22b424e5f2084dd1c352ddeb752a8fd8bfa288b0]
 was already merged. I can take care of the suggestion in an other commit.

[~mbudiu] -Can you please close the Jira as FIXED.-


was (Author: hanu.ncr):
[~julianhyde]  This 
[PR|https://github.com/apache/calcite/commit/22b424e5f2084dd1c352ddeb752a8fd8bfa288b0]
 was already merged. I can take care of the suggestion in an other commit.

[~mbudiu] Can you please close the Jira as FIXED.

> WITH RECURSIVE query when cloned using SqlShuttle loses RECURSIVE property
> --------------------------------------------------------------------------
>
>                 Key: CALCITE-6178
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6178
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: Hanumath Rao Maduri
>            Assignee: Hanumath Rao Maduri
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.37.0
>
>
> Here is a test case which shows that a recursive query becomes a non 
> recursive query when cloned using SqlShuttle. 
> Copy paste the below test case in SqlParserTest
> {code:java}
>  @Test void testRecursiveQueryCloned() throws Exception {
>     SqlNode sqlNode = sql("with RECURSIVE emp2 as "
>         + "(select * from emp union select * from emp2) select * from 
> emp2").parser().parseStmt();
>     SqlNode sqlNode1 = sqlNode.accept(new SqlShuttle() {
>    @Override public SqlNode visit(SqlIdentifier identifier) {
>              return new SqlIdentifier(identifier.names, 
> identifier.getParserPosition());
>            }
>   });
>       System.out.println(sqlNode1.toSqlString(c -> 
> c.withAlwaysUseParentheses(false)).getSql());
>   }{code}
> The above test case generates following output.
> {code:java}
> WITH "EMP2" AS (SELECT *
>             FROM "EMP"
>             UNION
>             SELECT *
>             FROM "EMP2") SELECT *
>         FROM "EMP2"{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to