You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by om...@apache.org on 2017/04/26 22:08:07 UTC

[4/5] hive git commit: HIVE-15929. Fix HiveDecimalWritable compatibility.

HIVE-15929. Fix HiveDecimalWritable compatibility.

Fixes #149

Signed-off-by: Owen O'Malley <om...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9bedccc4
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9bedccc4
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9bedccc4

Branch: refs/heads/branch-2.2
Commit: 9bedccc4b00308b071481d7b9ab623475a9fb5fb
Parents: a685775
Author: Owen O'Malley <om...@apache.org>
Authored: Tue Feb 14 17:25:46 2017 -0800
Committer: Owen O'Malley <om...@apache.org>
Committed: Wed Apr 26 15:03:05 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9bedccc4/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java
----------------------------------------------------------------------
diff --git a/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java b/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java
index 94d61b4..ffbe31a 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritable.java
@@ -947,10 +947,13 @@ public final class HiveDecimalWritable extends FastHiveDecimal
     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) {