You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2025/12/03 00:11:00 UTC

[jira] [Created] (FLINK-38768) Materialized table fails with validation exception in case of LATERAL TABLE

Sergey Nuyanzin created FLINK-38768:
---------------------------------------

             Summary: 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


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



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