You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/06/21 09:47:00 UTC

[jira] [Commented] (FLINK-28168) org.apache.flink.table.api.ValidationException: Data type 'ARRAY NOT NULL' does not support null values.

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

Martijn Visser commented on FLINK-28168:
----------------------------------------

[~ongbo] Please verify if this is still the case for the latest version of Flink, since the community doesn't support Flink 1.12 anymore. I've also lowered the priority given Flink's Jira process https://cwiki.apache.org/confluence/display/FLINK/Flink+Jira+Process

> 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)