Sergey Nuyanzin created FLINK-40369:
---------------------------------------
Summary: ARRAY functions might lead to wrong results
Key: FLINK-40369
URL: https://issues.apache.org/jira/browse/FLINK-40369
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Reporter: Sergey Nuyanzin
Assignee: Sergey Nuyanzin
The problem is typeStrategy which determines type based on the first element
only
for instance
{code:sql}
SELECT array_append(array[CAST(1.2 AS DECIMAL(2,1))], CAST(1.123 AS
DECIMAL(4,3)));
-- returns [1.2, 1.1] where 1.123 silently truncated to 1.1
{code}
same for other types like {{TIMESTAMP}}, {{CHAR}}
also for other functions like {{ARRAY_APPEND}}, {{ARRAY_PREPEND}},
{{ARRAY_REMOVE}}, {{ARRAY_CONTAINS}}, {{ARRAY_POSITION}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)