hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gopal V (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-16424) Decimal: Non-null HiveDecimalWritables can contain NULL decimals
Date Wed, 12 Apr 2017 11:01:41 GMT
Gopal V created HIVE-16424:
------------------------------

             Summary: Decimal: Non-null HiveDecimalWritables can contain NULL decimals
                 Key: HIVE-16424
                 URL: https://issues.apache.org/jira/browse/HIVE-16424
             Project: Hive
          Issue Type: Bug
          Components: Types
    Affects Versions: 2.1.1, 1.2.2, 3.0.0
            Reporter: Gopal V


{code}
  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);
  }
{code}

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



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message