rcongiu / Hive-JSON-Serde

Read - Write JSON SerDe for Apache Hive.
Other
733 stars 391 forks source link

Update 2 tests in 'json-serde' to handle String comparison ignoring the order #240

Open Sujishark opened 9 months ago

Sujishark commented 9 months ago

Describe the bug:

Creating this issue to address 2 tests:

org.openx.data.jsonserde.JsonSerDeTest.testNestedExplicitNullValue
org.openx.data.jsonserde.JsonSerDeTest.testExplicitNullValue

Expected behavior:

The assertion at the above mentioned tests are expected to succeed irrespective of the arrangement of the Strings.

Actual behavior:

Encountered the following errors:

Failed tests: testNestedExplicitNullValue(org.openx.data.jsonserde.JsonSerDeTest): expected:<{"[structCol":{"name":"myName"},"missingStructCol":null],"structNullCol":{"n...> but was:<{"[missingStructCol":null,"structCol":{"name":"myName"}],"structNullCol":{"n...>

Failed tests: testExplicitNullValue(org.openx.data.jsonserde.JsonSerDeTest): expected:<{"[stringCol":"str","nullCol":null],"missingCol":null}> but was:<{"[nullCol":null,"stringCol":"str"],"missingCol":null}>

This was found by using the NonDex tool.

I've a fix ready for this. Can I proceed and create PR ?

How to Reproduce

The following code is for the test - org.openx.data.jsonserde.JsonSerDeTest.testNestedExplicitNullValue:

cd Hive-JSON-Serde
mvn install -pl json-serde -am -DskipTests
mvn -pl json-serde edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.openx.data.jsonserde.JsonSerDeTest#testNestedExplicitNullValue

Desktop (please complete the following information):