[ 
https://issues.apache.org/jira/browse/FLINK-25699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17481866#comment-17481866
 ] 

Sergey Nuyanzin commented on FLINK-25699:
-----------------------------------------

Hi [~twalthr] 
there is a a question, may be you can help here. Do we need to respect order of 
elements here?
I'm asking because I faced a test [1], which assumes that order of pairs is 
always the same...
In theory both could be valid {{\{1=2,3=4\}}} and {{\{3=4,1=2\}}}

{code:scala}
    testAllApis(
      map(1, 2L , 3, 4L),
      "map(1, 2L, 3, 4L)",
      "MAP[1, CAST(2 AS BIGINT), 3, CAST(4 AS BIGINT)]",
      "{1=2, 3=4}")
{code}


[1] 
https://github.com/apache/flink/blob/f14ff3d5da471bf263ed7165c09bc8c57cdc4eaf/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/MapTypeTest.scala#L84

> Use HashMap for MAP value constructors
> --------------------------------------
>
>                 Key: FLINK-25699
>                 URL: https://issues.apache.org/jira/browse/FLINK-25699
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / Runtime
>            Reporter: Timo Walther
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>
> Currently, the usage of maps is inconsistent. It is not ensured that 
> duplicate keys get eliminated. For CAST and output conversion this is solved. 
> However, we should have a similar implementation in MAP value constructor 
> like in CAST.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to