[
https://issues.apache.org/jira/browse/FLINK-41321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137314#comment-18137314
]
sepuri sai krishna commented on FLINK-41321:
--------------------------------------------
I have a fix and tests for this locally. Please assign it to me and I will open
a PR.
> 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
> Priority: Major
>
> 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)