hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [4/5] hive git commit: HIVE-15929. Fix HiveDecimalWritable compatibility.
Date Wed, 26 Apr 2017 22:08:07 GMT
HIVE-15929. Fix HiveDecimalWritable compatibility.

Fixes #149

Signed-off-by: Owen O'Malley <omalley@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 <omalley@apache.org>
Authored: Tue Feb 14 17:25:46 2017 -0800
Committer: Owen O'Malley <omalley@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) {


Mime
View raw message