Julian Hyde created CALCITE-7764:
------------------------------------

             Summary: Allow explicit tables at top-level, e.g. "TABLE emp"
                 Key: CALCITE-7764
                 URL: https://issues.apache.org/jira/browse/CALCITE-7764
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


Calcite allows explicit tables (e.g. "{{{}TABLE emp{}}}") but not at top-level. 
"\{{SELECT * FROM (TABLE emp)}}" is valid but "\{{TABLE emp}}" throws:
{code:java}
TABLE emp;
> java.sql.SQLException: Error while executing SQL "table emp": class 
> org.apache.calcite.sql.SqlBasicCall: TABLE `scott`.`EMP`
>     at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
...
> Caused by: java.lang.UnsupportedOperationException: class 
> org.apache.calcite.sql.SqlBasicCall: TABLE `scott`.`EMP`
>     at org.apache.calcite.util.Util.needToImplement(Util.java:1213)
>     at 
> org.apache.calcite.sql.validate.SqlValidatorImpl.getValidatedNodeType(SqlValidatorImpl.java:2274)
>     at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:279){code}

Also allow {{TABLE emp ORDER BY deptno}}.



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

Reply via email to