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

Martijn Visser updated FLINK-28168:
-----------------------------------
    Priority: Major  (was: Blocker)

> org.apache.flink.table.api.ValidationException: Data type 'ARRAY<STRING> NOT 
> NULL' does not support null values.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-28168
>                 URL: https://issues.apache.org/jira/browse/FLINK-28168
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Client
>    Affects Versions: 1.12.7
>            Reporter: 熊搏
>            Priority: Major
>
> org.apache.flink.table.api.ValidationException: Data type 'ARRAY<STRING> NOT 
> NULL' does not support null values.
> If the filter condition is placed in where, there will be an error, that is, 
> the first element of CTRP is accessed, but if the filter condition is 
> removed, there will be no problem with the query of the first element of CTRP.
> This UDF return String[]
>  
>  
>  
>  
> {code:java}
> //代码占位符
> SELECT
>    *,
>    ctrp[1] AS xxxx,
> FROM
> (
>    SELECT
>       CASE
>          WHEN ...=... THEN UDF(...)
>          WHEN ...=... THEN UDF(...)
>        END AS ctrp
>       FROM  table
> ) t
> WHERE ctrp[2] <> 'xx'; {code}
> To solve the above problem, I changed my SQL to this:
>  
> {code:java}
> //代码占位符
> CREATE VIEW V1 AS
> SELECT
>     *,
>     ctrp[1] AS ctrp_resource_type,
> FROM
> (
>     SELECT
>         CASE
>             WHEN ...=... THEN UDF(...)
>             WHEN ...=... THEN UDF(...)
>     END AS ctrp
>     FROM table
> ) t;
> select
> *
> from V1
> where ctrp[1] <> 'xx'; {code}
> {panel}
> This will not happen, except when CTRP [1]<>'xx'" is placed in the filter 
> condition.
> {panel}
>  
>  
> {panel}
>  
> {panel}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to