You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2020/03/02 06:05:00 UTC

[jira] [Comment Edited] (FLINK-16351) Use LinkedHashMap for deterministic iterations

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

Jark Wu edited comment on FLINK-16351 at 3/2/20 6:04 AM:
---------------------------------------------------------

Hi [~testfixer], we shouldn't change {{MapBundleOperator}} to use LinkedHashMap, because it will affect performance, and it's not necessary to output an insert-order result for {{MapBundleOperator}}.

You can just update the {{TestMapBundleFunction}} to collect output into {{HashMap}} and verify the {{HashMap}}.


was (Author: jark):
Hi [~testfixer], we shouldn't change {{MapBundleOperatorTest}} to use LinkedHashMap, because it will affect performance, and it's not necessary to output an insert-order result for {{MapBundleOperatorTest}}.

You can just update the {{TestMapBundleFunction}} to collect output into {{HashMap}} and verify the {{HashMap}}.

> Use LinkedHashMap for deterministic iterations
> ----------------------------------------------
>
>                 Key: FLINK-16351
>                 URL: https://issues.apache.org/jira/browse/FLINK-16351
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Runtime
>            Reporter: testfixer0
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The test `testSimple` in `MapBundleOperatorTest` may fail due if `HashMap` iterates in a different order. Specifically, `assertThat(Arrays.asList("k1=v1,v2", "k2=v3"), is(func.getOutputs()))` may fail. `testSimple` depends on `open` in class `AbstractMapBundleOperator`. The field `bundle` is a `HashMap`. However, `HashMap` does not guarantee any specific order of entries. Thus, the test can fail due to a different iteration order.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)