[
https://issues.apache.org/jira/browse/FLINK-41321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
sepuri sai krishna updated FLINK-41321:
---------------------------------------
Description:
Two maps holding the same entries in a different order compare equal. Wrapping
each one in an array
reverses the answer.
{code:sql}
SELECT MAP['a',1,'b',2] = MAP['b',2,'a',1]; -- TRUE
SELECT ARRAY[MAP['a',1,'b',2]] = ARRAY[MAP['b',2,'a',1]]; -- FALSE
{code}
Same data, two answers depending on whether the value is a map or an array of
maps, with no error
and no warning. Also reproduced with both values arriving from a table source
rather than as
literals.
Not FLINK-41013: that one's wrong results are all the sign of zero, and there
is no FLOAT or DOUBLE
in this query.
was:
Two maps holding the same entries in a different order compare equal. Wrapping
each one in an array
reverses the answer, and a join on such a column returns no rows.
{code:sql}
SELECT MAP['a',1,'b',2] = MAP['b',2,'a',1]; -- TRUE
SELECT ARRAY[MAP['a',1,'b',2]] = ARRAY[MAP['b',2,'a',1]]; -- FALSE
SELECT COUNT(*)
FROM (VALUES (ARRAY[MAP['a',1,'b',2]])) AS l(m)
JOIN (VALUES (ARRAY[MAP['b',2,'a',1]])) AS r(m) ON l.m = r.m; -- 0
{code}
The same join on the maps themselves returns 1. Same data, same join, two
answers depending on
whether the key is a map or an array of maps, with no error and no warning.
Also reproduced with
both values arriving from a table source rather than as literals.
Not FLINK-41013: that one's wrong results are all the sign of zero, and there
is no FLOAT or DOUBLE
in this query.
Summary: ARRAY[m1] = ARRAY[m2] is FALSE although m1 = m2 is TRUE for
the same two maps (was: A join on an ARRAY<MAP> key returns no rows, although
the same two maps compare equal with =)
> ARRAY[m1] = ARRAY[m2] is FALSE although m1 = m2 is TRUE for the same two maps
> -----------------------------------------------------------------------------
>
> Key: FLINK-41321
> URL: https://issues.apache.org/jira/browse/FLINK-41321
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Affects Versions: 2.4.0
> Reporter: sepuri sai krishna
> Priority: Major
>
> Two maps holding the same entries in a different order compare equal.
> Wrapping each one in an array
> reverses the answer.
> {code:sql}
> SELECT MAP['a',1,'b',2] = MAP['b',2,'a',1]; -- TRUE
> SELECT ARRAY[MAP['a',1,'b',2]] = ARRAY[MAP['b',2,'a',1]]; -- FALSE
> {code}
> Same data, two answers depending on whether the value is a map or an array of
> maps, with no error
> and no warning. Also reproduced with both values arriving from a table source
> rather than as
> literals.
> Not FLINK-41013: that one's wrong results are all the sign of zero, and there
> is no FLOAT or DOUBLE
> in this query.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)