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

Decimal: Non-null HiveDecimalWritables can contain NULL decimals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.2, 2.1.1, 3.0.0
    • None
    • Types
    • None

    Description

        public static void writeToByteStream(RandomAccessOutput byteStream,
                                             HiveDecimalWritable decWritable) {
          LazyBinaryUtils.writeVInt(byteStream, decWritable.scale());
      
          // NOTE: This writes into a scratch buffer within HiveDecimalWritable.
          //
          int byteLength = decWritable.bigIntegerBytesInternalScratch();
      
          LazyBinaryUtils.writeVInt(byteStream, byteLength);
          byteStream.write(decWritable.bigIntegerBytesInternalScratchBuffer(), 0, byteLength);
        }
      

      Can end up writing 0 bytes as byteLength since a non-null HiveDecimalWritable does not mean a non-null HiveDecimal is contained inside it.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gopalv Gopal Vijayaraghavan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: