[
https://issues.apache.org/jira/browse/CALCITE-5216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18097732#comment-18097732
]
Yu Xu commented on CALCITE-5216:
--------------------------------
Fixed in
[https://github.com/apache/calcite/commit/be6f24a1e325bbe76f320a84078e77e36bd3b1ac]
Thank you for the review [~mbudiu] [~jensen]
> Cannot parse parenthesized nested WITH clause
> ---------------------------------------------
>
> Key: CALCITE-5216
> URL: https://issues.apache.org/jira/browse/CALCITE-5216
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.30.0
> Reporter: Wenrui Meng
> Assignee: Julian Hyde
> Priority: Major
> Labels: pull-request-available
>
> CALCITE-35 introduced issues to parse the parenthesized sub-query such as
> union and nested with. It's considered as a regression.
> CALCITE-5194 resolved the parenthesized union issue while the nested with
> still failed on parsing.
>
> Here is a sample nested with SQL statement that fails the parsing
>
> {code:java}
> with a as (with b as (select 1)(select 1)) select * from a {code}
>
> Here is the stack trace summary
> {code:java}
> at
> org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.parseStmtAndHandleEx(SqlParserTest.java:10184)
> at
> org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.check(SqlParserTest.java:10169)
> at
> org.apache.calcite.sql.parser.SqlParserFixture.ok(SqlParserFixture.java:83)
> at
> org.apache.calcite.sql.parser.SqlParserTest.testNestedWith(SqlParserTest.java:7941)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at
> org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
> at
> org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
> ..........
> Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "("
> at line 1, column 32. {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)