Nico Kruber created FLINK-16282:
-----------------------------------

             Summary: Wrong exception using DESCRIBE SQL command
                 Key: FLINK-16282
                 URL: https://issues.apache.org/jira/browse/FLINK-16282
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.10.0
            Reporter: Nico Kruber


When trying to describe a table like this


{code:java}
Table facttable = tEnv.sqlQuery("DESCRIBE fact_table");
{code}

currently, you get a strange exception which should rather be a "not supported" 
exception

{code}
Exception in thread "main" org.apache.flink.table.api.ValidationException: SQL 
validation failed. From line 1, column 10 to line 1, column 19: Column 
'fact_table' not found in any table
        at 
org.apache.flink.table.calcite.FlinkPlannerImpl.validateInternal(FlinkPlannerImpl.scala:130)
        at 
org.apache.flink.table.calcite.FlinkPlannerImpl.validate(FlinkPlannerImpl.scala:105)
        at 
org.apache.flink.table.sqlexec.SqlToOperationConverter.convert(SqlToOperationConverter.java:124)
        at org.apache.flink.table.planner.ParserImpl.parse(ParserImpl.java:66)
        at 
org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlQuery(TableEnvironmentImpl.java:464)
        at com.ververica.LateralTableJoin.main(LateralTableJoin.java:92)
Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, 
column 10 to line 1, column 19: Column 'fact_table' not found in any table
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:834)
        at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:819)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:4841)
        at 
org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:259)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateIdentifier(SqlValidatorImpl.java:2943)
        at 
org.apache.calcite.sql.SqlIdentifier.validateExpr(SqlIdentifier.java:297)
        at org.apache.calcite.sql.SqlOperator.validateCall(SqlOperator.java:407)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateCall(SqlValidatorImpl.java:5304)
        at org.apache.calcite.sql.SqlCall.validate(SqlCall.java:116)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:943)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:650)
        at 
org.apache.flink.table.calcite.FlinkPlannerImpl.validateInternal(FlinkPlannerImpl.scala:126)
        ... 5 more
Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Column 
'fact_table' not found in any table
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
        at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at 
org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:463)
        at org.apache.calcite.runtime.Resources$ExInst.ex(Resources.java:572)
        ... 17 more

{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to