You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/02/24 05:23:41 UTC

[GitHub] [hive] cpugputpu opened a new pull request #923: Sort fields for deterministic behaviors

cpugputpu opened a new pull request #923: Sort fields for deterministic behaviors
URL: https://github.com/apache/hive/pull/923
 
 
   The test in `org.apache.hadoop.hive.serde2.columnar.TestLazyBinaryColumnarSerDe#testHandlingAlteredSchemas` can fail due to an assertion failure `java.lang.AssertionError: expected:<12> but was:<11>` when running `Assert.assertEquals(((LongWritable) objs2.get(0)).get(), 11L);`
   
   The root cause of it lies in the ObjectInspectorUtils.java, where `getDeclaredFields()` is called. The specification about `getDeclaredFields()` says that "the elements in the returned array are not sorted and are not in any particular order". The documentation is here for your reference: https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getDeclaredFields--
   
   The fix is to sort the fields so that the behavior will be the same across different JVM versions or vendors. In this way, the non-deterministic behaviors are eliminated and the test becomes more stable.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org