You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "YufeiLiu (Jira)" <ji...@apache.org> on 2020/06/04 03:23:00 UTC
[jira] [Updated] (FLINK-18111) LATERAL query failed when use create
view syntax
[ https://issues.apache.org/jira/browse/FLINK-18111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
YufeiLiu updated FLINK-18111:
-----------------------------
Description:
When execute sql like this will throw exception "org.apache.calcite.sql.validate.SqlValidatorException: Column 'c1' not found in any table":
{code:SQL}
CREATE VIEW my_view AS SELECT T.a, T.b FROM source, LATERAL TABLE(MY_TABLE_FUNCTION(`c1`)) AS T(`a`, `b`)
{code}
Because of in {{SqlToOperationConverter#convertCreateView}} unparse SqlNode to sql string after validate, but the LATERAL keyword was missing at this point. Plus {{SqlNode validateQuery = flinkPlanner.validate(query)}}, query == validateQuery.
I think we could use original sql to build {{CatalogViewImpl}}, they have the same functionality.
was:
When execute sql like this will throw exception "org.apache.calcite.sql.validate.SqlValidatorException: Column 'c1' not found in any table":
{code:SQL}
CREATE VIEW my_view AS SELECT T.a, T.b FROM source, LATERAL TABLE(MY_TABLE_FUNCTION(`c1`)) AS T(`a`, `b`)
{code}
Because of in {{SqlToOperationConverter#convertCreateView}} unparse SqlNode to sql string after validate, but the LATERAL keyword was missing at this point. Plus {{SqlNode validateQuery = flinkPlanner.validate(query)}}, query == validateQuery.
I think we could use original sql to build {{CatalogViewImpl}}, they have the same functionality.
> LATERAL query failed when use create view syntax
> ------------------------------------------------
>
> Key: FLINK-18111
> URL: https://issues.apache.org/jira/browse/FLINK-18111
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / API
> Affects Versions: 1.11.0
> Reporter: YufeiLiu
> Priority: Major
>
> When execute sql like this will throw exception "org.apache.calcite.sql.validate.SqlValidatorException: Column 'c1' not found in any table":
> {code:SQL}
> CREATE VIEW my_view AS SELECT T.a, T.b FROM source, LATERAL TABLE(MY_TABLE_FUNCTION(`c1`)) AS T(`a`, `b`)
> {code}
> Because of in {{SqlToOperationConverter#convertCreateView}} unparse SqlNode to sql string after validate, but the LATERAL keyword was missing at this point. Plus {{SqlNode validateQuery = flinkPlanner.validate(query)}}, query == validateQuery.
> I think we could use original sql to build {{CatalogViewImpl}}, they have the same functionality.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)