commit 28e3bca3fbc83e04cd7c72d7e49fc22463d55edb Author: Owen O'Malley Date: Tue Feb 14 17:25:46 2017 -0800 HIVE-15929. Fix HiveDecimalWritable compatibility with Hive 2.1. diff --git storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java index 94d61b49d2..ffbe31a524 100644 --- storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java +++ storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java @@ -947,10 +947,13 @@ public int hashCode() { return fastHashCode(); } + private static final byte[] EMPTY_ARRAY = new byte[0]; + @HiveDecimalWritableVersionV1 public byte[] getInternalStorage() { if (!isSet()) { - throw new RuntimeException("no value set"); + // don't break old callers that are trying to reuse storages + return EMPTY_ARRAY; } if (internalScratchLongs == null) {