sepuri sai krishna created FLINK-41321:
------------------------------------------

             Summary: A join on an ARRAY<MAP> key returns no rows, although the 
same two maps compare equal with =
                 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


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.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to