Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-27891

Fixed 6 tests due to ordering problem - getDeclaredFields()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Test, Tests
    • None

    Description

      The following six tests fail because the getDeclaredFields() used in the ObjectInspectorUtils.java doesn't maintain a constant order. It is mentioned in the [documentation]https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getDeclaredFields--

      1. org.apache.hadoop.hive.serde2.lazy.TestLazySimpleSerDe.testSerDeParameters_
      2.org.apache.hadoop.hive.serde2.objectinspector.TestObjectInspectorUtils.testObjectInspectorUtils
      3.org.apache.hadoop.hive.serde2.binarysortable.TestBinarySortableSerDe.testBinarySortableSerDe
      4.org.apache.hadoop.hive.serde2.columnar.TestLazyBinaryColumnarSerDe.testLazyBinaryColumnarSerDeWithEmptyBinary
      5.org.apache.hadoop.hive.serde2.columnar.TestLazyBinaryColumnarSerDe.testSerDeEmpties
      6.org.apache.hadoop.hive.serde2.columnar.TestLazyBinaryColumnarSerDe.testSerDeInnerNulls

      The fix is to sort the Field[] f array to maintain the constant order.

      hive/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector
      /ObjectInspectorUtils.java:560

       Error messages encountered:
      -java.lang.AssertionError: expected:<0:lstring> but was:<1:aint>
      -java.lang.ClassCastException: class java.lang.Float cannot be cast to class org.apache.hadoop.hive.common.type.Date (java.lang.Float is in module java.base of loader 'bootstrap'; org.apache.hadoop.hive.common.type.Date is in unnamed module of loader 'app')

      Can I raise PR for the same ?

      Attachments

        Activity

          People

            Unassigned Unassigned
            sujithra Sujithra Rajan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: