[jira] [Updated] (FLINK-16409) Use LinkedHashMap for deterministic iterations

2020-03-03 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-16409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-16409:
---
Description: 
Test `testKeyedMapStateUpgrade` depends on `put` in `HeapMapState.java` and 
`deserialize` in `MapSerializer.java`. It has this following test assertion 
`assertEquals((Integer) 1, actual.getKey());` that asserts the `getKey()` value 
of `actual`. However the `HashMap` in `put` and `deserialize` does not 
guarantee any specific order of entries. Therefore, the assertion will fail if 
the order is different.

 

This PR proposes to use `LinkedHashMap` for a deterministic order. Please let 
me know if you want to discuss the changes more.

  was:Test `testKeyedMapStateUpgrade` depends on `put` in `HeapMapState.java` 
and `deserialize` in `MapSerializer.java`. It has this following test assertion 
`assertEquals((Integer) 1, actual.getKey());` that asserts the `getKey()` value 
of `actual`. However the `HashMap` in `put` and `deserialize` does not 
guarantee any specific order of entries. Therefore, the assertion will fail if 
the order is different.


> Use LinkedHashMap for deterministic iterations
> --
>
> Key: FLINK-16409
> URL: https://issues.apache.org/jira/browse/FLINK-16409
> Project: Flink
>  Issue Type: Bug
>  Components: Runtime / Task
>Reporter: testfixer0
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 1.10.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Test `testKeyedMapStateUpgrade` depends on `put` in `HeapMapState.java` and 
> `deserialize` in `MapSerializer.java`. It has this following test assertion 
> `assertEquals((Integer) 1, actual.getKey());` that asserts the `getKey()` 
> value of `actual`. However the `HashMap` in `put` and `deserialize` does not 
> guarantee any specific order of entries. Therefore, the assertion will fail 
> if the order is different.
>  
> This PR proposes to use `LinkedHashMap` for a deterministic order. Please let 
> me know if you want to discuss the changes more.



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


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

2020-03-03 Thread testfixer0 (Jira)
testfixer0 created FLINK-16409:
--

 Summary: Use LinkedHashMap for deterministic iterations
 Key: FLINK-16409
 URL: https://issues.apache.org/jira/browse/FLINK-16409
 Project: Flink
  Issue Type: Bug
  Components: Runtime / Task
Reporter: testfixer0
 Fix For: 1.10.0


Test `testKeyedMapStateUpgrade` depends on `put` in `HeapMapState.java` and 
`deserialize` in `MapSerializer.java`. It has this following test assertion 
`assertEquals((Integer) 1, actual.getKey());` that asserts the `getKey()` value 
of `actual`. However the `HashMap` in `put` and `deserialize` does not 
guarantee any specific order of entries. Therefore, the assertion will fail if 
the order is different.



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


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

2020-02-29 Thread testfixer0 (Jira)
testfixer0 created FLINK-16352:
--

 Summary: Use LinkedHashMap for deterministic iterations
 Key: FLINK-16352
 URL: https://issues.apache.org/jira/browse/FLINK-16352
 Project: Flink
  Issue Type: Bug
  Components: Table SQL / Client
Affects Versions: 1.10.0
Reporter: testfixer0


The test `testValueLiteralString` in `ExpressionTest` may fail due if `HashMap` 
iterates in a different order. The final variable `map` 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)


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

2020-02-29 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-16351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-16351:
---
Component/s: (was: Tests)
 Table SQL / Runtime

> 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
>
> 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)


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

2020-02-29 Thread testfixer0 (Jira)
testfixer0 created FLINK-16351:
--

 Summary: Use LinkedHashMap for deterministic iterations
 Key: FLINK-16351
 URL: https://issues.apache.org/jira/browse/FLINK-16351
 Project: Flink
  Issue Type: Bug
  Components: Tests
Reporter: testfixer0


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)


[jira] [Updated] (FLINK-15975) Test may fail due if HashMap iterates in a different order

2020-02-15 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Description: The test `testMap` in `HiveGenericUDFTest` may fail due if 
HashMap iterates in a different order. `testMap` depends on `getConversion` and 
`toFlinkObject` in class `MapObjectInspector`. 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.  (was: The test `testMap` in 
`HiveGenericUDFTest` fails. As you suggested, we'd be better to change 
assertions in test code to cater to the indeterminacy.  So, I propose a new 
proposal. )

> Test may fail due if HashMap iterates in a different order
> --
>
> Key: FLINK-15975
> URL: https://issues.apache.org/jira/browse/FLINK-15975
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Reporter: testfixer0
>Priority: Minor
>  Labels: pull-request-available
> Attachments: FLINK-15975-000.patch, FLINK-15975-001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The test `testMap` in `HiveGenericUDFTest` may fail due if HashMap iterates 
> in a different order. `testMap` depends on `getConversion` and 
> `toFlinkObject` in class `MapObjectInspector`. 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.



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


[jira] [Updated] (FLINK-15975) Test may fail due if HashMap iterates in a different order

2020-02-15 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Summary: Test may fail due if HashMap iterates in a different order  (was: 
Use LinkedHashMap for deterministic iterations)

> Test may fail due if HashMap iterates in a different order
> --
>
> Key: FLINK-15975
> URL: https://issues.apache.org/jira/browse/FLINK-15975
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Reporter: testfixer0
>Priority: Minor
>  Labels: pull-request-available
> Attachments: FLINK-15975-000.patch, FLINK-15975-001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The test `testMap` in `HiveGenericUDFTest` fails. As you suggested, we'd be 
> better to change assertions in test code to cater to the indeterminacy.  So, 
> I propose a new proposal. 



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


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

2020-02-15 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Issue Type: Bug  (was: Improvement)

> Use LinkedHashMap for deterministic iterations
> --
>
> Key: FLINK-15975
> URL: https://issues.apache.org/jira/browse/FLINK-15975
> Project: Flink
>  Issue Type: Bug
>  Components: Connectors / Hive
>Reporter: testfixer0
>Priority: Minor
>  Labels: pull-request-available
> Attachments: FLINK-15975-000.patch, FLINK-15975-001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The test `testMap` in `HiveGenericUDFTest` fails. As you suggested, we'd be 
> better to change assertions in test code to cater to the indeterminacy.  So, 
> I propose a new proposal. 



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


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

2020-02-12 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Description: The test `testMap` in `HiveGenericUDFTest` fails. As you 
suggested, we'd be better to change assertions in test code to cater to the 
indeterminacy.  So, I propose a new proposal.   (was: 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.)

> 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
>Priority: Minor
>  Labels: pull-request-available
> Attachments: FLINK-15975-000.patch, FLINK-15975-001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> The test `testMap` in `HiveGenericUDFTest` fails. As you suggested, we'd be 
> better to change assertions in test code to cater to the indeterminacy.  So, 
> I propose a new proposal. 



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


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

2020-02-12 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Attachment: FLINK-15975-001.patch

> 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
>Priority: Minor
>  Labels: pull-request-available
> Attachments: FLINK-15975-000.patch, FLINK-15975-001.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)


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

2020-02-10 Thread testfixer0 (Jira)


 [ 
https://issues.apache.org/jira/browse/FLINK-15975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

testfixer0 updated FLINK-15975:
---
Attachment: FLINK-15975-000.patch

> 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
>Priority: Minor
> Attachments: FLINK-15975-000.patch
>
>
> 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)


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

2020-02-10 Thread testfixer0 (Jira)
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)