[jira] [Created] (FLINK-15509) Use sql cilents create view occur Unexpected exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-15509) Use sql cilents create view occur Unexpected exception

Shang Yuanchun (Jira)
Xianxun Ye created FLINK-15509:
----------------------------------

             Summary: Use sql cilents create view occur Unexpected exception
                 Key: FLINK-15509
                 URL: https://issues.apache.org/jira/browse/FLINK-15509
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Client
            Reporter: Xianxun Ye


version:master.

Firstly I created a table sucessful by sql clients,  and then throw an unexcepetd exp when created a view.

My steps:

Flink SQL> create table myTable (id int);

*[INFO] Table has been created.*

Flink SQL> show tables ;

myTable

Flink SQL> describe myTable ;

root

 |-- id: INT

Flink SQL> create view myView as select * from myTable;

 

Exception in thread "main" org.apache.flink.table.client.SqlClientException: Unexpected exception. This is a bug. Please consider filing an issue.

 at org.apache.flink.table.client.SqlClient.main(SqlClient.java:190)

Caused by: org.apache.flink.table.api.ValidationException: SQL validation failed. findAndCreateTableSource failed.

 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 org.apache.flink.table.client.gateway.local.LocalExecutor.addView(LocalExecutor.java:300)

 at org.apache.flink.table.client.cli.CliClient.callCreateView(CliClient.java:579)

 at org.apache.flink.table.client.cli.CliClient.callCommand(CliClient.java:308)

 at java.util.Optional.ifPresent(Optional.java:159)

 at org.apache.flink.table.client.cli.CliClient.open(CliClient.java:200)

 at org.apache.flink.table.client.SqlClient.openCli(SqlClient.java:125)

 at org.apache.flink.table.client.SqlClient.start(SqlClient.java:104)

 at org.apache.flink.table.client.SqlClient.main(SqlClient.java:178)

Caused by: org.apache.flink.table.api.TableException: findAndCreateTableSource failed.

 at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:55)

 at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:92)

 at org.apache.flink.table.catalog.DatabaseCalciteSchema.convertCatalogTable(DatabaseCalciteSchema.java:138)

 at org.apache.flink.table.catalog.DatabaseCalciteSchema.convertTable(DatabaseCalciteSchema.java:97)

 at org.apache.flink.table.catalog.DatabaseCalciteSchema.lambda$getTable$0(DatabaseCalciteSchema.java:86)

 at java.util.Optional.map(Optional.java:215)

 at org.apache.flink.table.catalog.DatabaseCalciteSchema.getTable(DatabaseCalciteSchema.java:76)

 at org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83)

 at org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:289)

 at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:143)

 at org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99)

 at org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:203)

 at org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:105)

 at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:177)

 at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1005)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:965)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3125)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:3107)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3379)

 at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)

 at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:1005)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:965)

 at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:216)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:940)

 at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:647)

 at org.apache.flink.table.calcite.FlinkPlannerImpl.validateInternal(FlinkPlannerImpl.scala:126)

 ... 12 more

Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in

the classpath.

 

Reason: Required context properties mismatch.

 

The following properties are requested:

schema.0.data-type=INT

schema.0.name=id

 

The following factories have been considered:

org.apache.flink.table.sources.CsvBatchTableSourceFactory

org.apache.flink.table.sources.CsvAppendTableSourceFactory

 at org.apache.flink.table.factories.TableFactoryService.filterByContext(TableFactoryService.java:326)

 at org.apache.flink.table.factories.TableFactoryService.filter(TableFactoryService.java:191)

 at org.apache.flink.table.factories.TableFactoryService.findSingleInternal(TableFactoryService.java:144)

 at org.apache.flink.table.factories.TableFactoryService.find(TableFactoryService.java:97)

 at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:52)

 ... 39 more

 

Shutting down the session...

done.

 

 



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