You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Runkang He (Jira)" <ji...@apache.org> on 2023/05/14 23:36:00 UTC

[jira] [Commented] (CALCITE-5626) Sub-query with fully qualified table name throws table not found exception in validation phase

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

Runkang He commented on CALCITE-5626:
-------------------------------------

[~julianhyde] would you like to help review if you have time? The PR is [PR-3201|https://github.com/apache/calcite/pull/3201]

> Sub-query with fully qualified table name throws table not found exception in validation phase
> ----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5626
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5626
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Roman Churganov
>            Assignee: Runkang He
>            Priority: Blocker
>
> If query has a sub-query in EXIXST function and full column names used in  sub-query , like  
> {code:sql}
>   SELECT sch1.foo.c11 FROM sch1.foo 
>                           WHERE exists ( SELECT sch2.tab.c41 FROM sch2.tab where sch2.tab.c41 = 1 )
> {code}
> it fails with exception:
> {noformat}
>        .....
>    	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:787)
> 	at org.apache.calcite.prepare.PlannerImpl.validate(PlannerImpl.java:226)
> 	... 73 more
> Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Table 'SCH2.TAB' not found
> 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
> 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
> 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
> 	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505)
> 	at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:599)
> 	... 98 more
> {noformat}
> also need to have a different table in the outer query to reproduce



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