[ 
https://issues.apache.org/jira/browse/FLINK-40366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gustavo de Morais closed FLINK-40366.
-------------------------------------
    Fix Version/s: 2.4.0
     Release Note: This was fixed as side effect of 
https://issues.apache.org/jira/browse/CALCITE-7660 
         Assignee: Sergey Nuyanzin
       Resolution: Fixed

> INSERT INTO with a column list or static partition fails for set-semantic PTFs
> ------------------------------------------------------------------------------
>
>                 Key: FLINK-40366
>                 URL: https://issues.apache.org/jira/browse/FLINK-40366
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 2.3.0, 2.2.1, 2.1.3
>            Reporter: Gustavo de Morais
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>             Fix For: 2.4.0
>
>
> INSERT INTO t (col) SELECT … FROM ptf(input => TABLE s PARTITION BY k, …) 
> throws NullPointerException during planning (IllegalStateException: must call 
> validate first with assertions on). The same statement without the column 
> list plans fine. A static PARTITION (p = 'x') spec fails the same way, and 
> EXPLAIN of the statement fails too, so the failure is not diagnosable by the 
> user.
> Affects any set-semantics PTF (PARTITION BY table argument) on 2.1, 2.2, 2.3 
> and master. Row-semantics PTFs and column lists without a PTF are unaffected.
> Root cause: this is the same defect class as FLINK-40039 at a third, 
> independent site. PreValidateReWriter.rewriteInsert runs before validation 
> and replaces the insert's source with a newly built SqlSelect whenever a 
> column list or static partition is present. Calcite skips validation of 
> set-semantics table arguments (validateTableFunction short-circuits on 
> Semantics.SET), so the inner table's namespace is never populated for the 
> rewritten tree, and SqlToRelConverter.convertIdentifier then calls resolve() 
> on an unvalidated namespace.
>  



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

Reply via email to