You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Gopal V (JIRA)" <ji...@apache.org> on 2017/04/12 11:01:41 UTC

[jira] [Created] (HIVE-16424) Decimal: Non-null HiveDecimalWritables can contain NULL decimals

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)