You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2016/12/15 03:35:06 UTC

hive git commit: HIVE-15395 : Don't try to intern strings from empty map (Ashutosh Chauhan via Rajesh Balamohan)

Repository: hive
Updated Branches:
  refs/heads/master f25ef88df -> b862d6a20


HIVE-15395 : Don't try to intern strings from empty map (Ashutosh Chauhan via Rajesh Balamohan)

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


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

Branch: refs/heads/master
Commit: b862d6a204800ecda7d396c568332d0d6cb798c9
Parents: f25ef88
Author: Ashutosh Chauhan <ha...@apache.org>
Authored: Thu Dec 8 15:53:14 2016 -0800
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Wed Dec 14 19:30:08 2016 -0800

----------------------------------------------------------------------
 .../src/java/org/apache/hive/common/util/HiveStringUtils.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b862d6a2/common/src/java/org/apache/hive/common/util/HiveStringUtils.java
----------------------------------------------------------------------
diff --git a/common/src/java/org/apache/hive/common/util/HiveStringUtils.java b/common/src/java/org/apache/hive/common/util/HiveStringUtils.java
index 9db312b..f6dc73a 100644
--- a/common/src/java/org/apache/hive/common/util/HiveStringUtils.java
+++ b/common/src/java/org/apache/hive/common/util/HiveStringUtils.java
@@ -136,6 +136,11 @@ public class HiveStringUtils {
     if(map == null) {
       return null;
     }
+
+    if (map.isEmpty()) {
+      // nothing to intern
+      return map;
+    }
     Map<String, String> newMap = new HashMap<String, String>(map.size());
     for(Map.Entry<String, String> entry : map.entrySet()) {
       newMap.put(intern(entry.getKey()), intern(entry.getValue()));