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

Compute Stats Incorrect for Binary Columns

    XMLWordPrintableJSON

Details

    Description

      I came across an issue when working on HIVE-22674.

      The SerDe used for processing binary data tries to auto-detect if the data is in Base-64. It uses org.apache.commons.codec.binary.Base64#isArrayByteBase64 which has two issues:

      1. It's slow since it will check if the array is compatible,... and then process the data (examines the array twice)
      2. More importantly, this method Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. Currently the method treats whitespace as valid.

      https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html#isArrayByteBase64-byte:A-

      The qtest for this feature uses full sentences (which includes spaces) here and therefore it thinks this data is Base-64 and returns an incorrect estimation for size.

      This should really not auto-detect Base64 data and instead it should be enabled with a table property.

      Attachments

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m