You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "testfixer0 (Jira)" <ji...@apache.org> on 2020/02/10 17:22:00 UTC

[jira] [Created] (FLINK-15975) Use LinkedHashMap for deterministic iterations

testfixer0 created FLINK-15975:
----------------------------------

             Summary: Use LinkedHashMap for deterministic iterations
                 Key: FLINK-15975
                 URL: https://issues.apache.org/jira/browse/FLINK-15975
             Project: Flink
          Issue Type: Improvement
          Components: Connectors / Hive
            Reporter: testfixer0


The test `testMap` in `HiveGenericUDFTest` invokes two methods `HiveGenericUDFTest.init` and `HiveScalarFunction.eval`.  These two methods depend on `getConversion` and `toFlinkObject` in class `HiveInspectors`. When the `inspector` is the instance of `MapObjectInspector`, it can return a `HashMap`. However, `HashMap` does not guarantee any specific order of entries. Thus, the test can fail due to a different iteration order.

In this PR, we propose to use a `LinkedHashMap` instead to guarantee the iteration order.



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