[SEDONA-434] Improve reliability by resolve the nondeterministic of the order of the Map #1130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a JIRA ticket?
What changes were proposed in this PR?
Problem :
when the program reading from the newRdd, it assumes the order of the data to read into the Map
sedona/spark/common/src/test/java/org/apache/sedona/core/formatMapper/GeoJsonIOTest.java
Line 106 in a649720
However, when it write the data, it did not assume the order according to the Oracle's official document
sedona/spark/common/src/main/java/org/apache/sedona/core/spatialRDD/SpatialRDD.java
Lines 571 to 572 in a649720
So it will cause the ERROR when the environment has been changed
Solution
So we can change the Map to use the LinkedHashMap to guarantee the order to solve the problem
How was this patch tested?
This error can be reproduced with the NondexTool with the following command (you can try that without modifying the pom, but feel free to use the plugin to protect your project and make it safer 😊 ), and this kind problem is widely documented in International Dataset of Flaky Tests (IDoFT)
Did this PR include necessary documentation updates?