You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "熊搏 (Jira)" <ji...@apache.org> on 2022/06/21 09:40:00 UTC
[jira] [Created] (FLINK-28168) org.apache.flink.table.api.ValidationException: Data type 'ARRAY NOT NULL' does not support null values.
熊搏 created FLINK-28168:
--------------------------
Summary: 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: 熊搏
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)