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

Sergey Nuyanzin commented on FLINK-38768:
-----------------------------------------

Merged as 
[4b7210d23425c3bbbb0702f03276dee6983456e3|https://github.com/apache/flink/commit/4b7210d23425c3bbbb0702f03276dee6983456e3]

> Materialized table fails with validation exception in case of LATERAL TABLE
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-38768
>                 URL: https://issues.apache.org/jira/browse/FLINK-38768
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>              Labels: pull-request-available
>
> It happens only in case there is no alias for {{LATERAL TABLE}}
> for instance
> {code:sql}
> CREATE MATERIALIZED TABLE mtbl1
> AS SELECT * FROM t1, LATERAL TABLE(myFunc(b));
> {code}
> Then it expands query to something like
> {code:sql}
> SELECT `t1`.`a`, `t1`.`b`, `t1`.`c`, `t1`.`d`, `EXPR$0`.`name`, `EXPR$0`.`age`
> FROM `builtin`.`default`.`t1` AS `t1`,
> LATERAL TABLE(`builtin`.`default`.`myFunc`(`b`))
> {code}
> The problem is that it doesn't generate alias for {{LATERAL TABLE}}
> It is a Calcite issue CALCITE-7312
> expected expansion is
> {code:sql}
> SELECT `t1`.`a`, `t1`.`b`, `t1`.`c`, `t1`.`d`, `EXPR$0`.`name`, `EXPR$0`.`age`
> FROM `builtin`.`default`.`t1` AS `t1`,
> LATERAL TABLE(`builtin`.`default`.`myFunc`(`b`)) AS `EXPR$0`
> {code}



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

Reply via email to