HIVE-19156 : TestMiniLlapLocalCliDriver.vectorized_dynamic_semijoin_reduction.q 
is broken (Jason Dere via Deepak Jaiswal)

Signed-off-by: Ashutosh Chauhan <hashut...@apache.org>


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

Branch: refs/heads/branch-3
Commit: 5a95a826a1ce6db56a5a721ef99e3f76a9360abf
Parents: 12a1784
Author: Jason Dere <jd...@hortonworks.com>
Authored: Thu Apr 12 08:47:25 2018 -0700
Committer: Vineet Garg <vg...@apache.org>
Committed: Thu Apr 12 10:58:15 2018 -0700

----------------------------------------------------------------------
 .../ql/exec/tez/DynamicValueRegistryTez.java     | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/5a95a826/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DynamicValueRegistryTez.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DynamicValueRegistryTez.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DynamicValueRegistryTez.java
index ec1e84b..2d99f50 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DynamicValueRegistryTez.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DynamicValueRegistryTez.java
@@ -61,6 +61,11 @@ public class DynamicValueRegistryTez implements 
DynamicValueRegistry {
     }
   }
 
+  static class NullValue {
+  }
+
+  static final NullValue NULL_VALUE = new NullValue();
+
   protected Map<String, Object> values = new ConcurrentHashMap<>();
 
   public DynamicValueRegistryTez() {
@@ -71,11 +76,21 @@ public class DynamicValueRegistryTez implements 
DynamicValueRegistry {
     if (!values.containsKey(key)) {
       throw new NoDynamicValuesException("Value does not exist in registry: " 
+ key);
     }
-    return values.get(key);
+    Object val = values.get(key);
+
+    if (val == NULL_VALUE) {
+      return null;
+    }
+    return val;
   }
 
   protected void setValue(String key, Object value) {
-    values.put(key, value);
+    if (value == null) {
+      // ConcurrentHashMap does not allow null - use a substitute value.
+      values.put(key, NULL_VALUE);
+    } else {
+      values.put(key, value);
+    }
   }
 
   @Override

Reply via email to