Repository: hive
Updated Branches:
  refs/heads/master ba5397a78 -> 0eea6871d


HIVE-16060: GenericUDTFJSONTuple's json cache could overgrow beyond its limit 
(Chao Sun, reviewed by Xuefu Zhang)


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

Branch: refs/heads/master
Commit: 0eea6871d08f9400f496367051b1d4e6b233b8b0
Parents: ba5397a
Author: Chao Sun <[email protected]>
Authored: Tue Feb 28 15:18:56 2017 -0800
Committer: Chao Sun <[email protected]>
Committed: Wed Mar 1 09:34:58 2017 -0800

----------------------------------------------------------------------
 .../apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0eea6871/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java
index 5fa62a2..34911b0 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFJSONTuple.java
@@ -93,7 +93,7 @@ public class GenericUDTFJSONTuple extends GenericUDTF {
 
   }
 
-  static Map<String, Object> jsonObjectCache = new HashCache<String, Object>();
+  private transient Map<String, Object> jsonObjectCache;
 
   @Override
   public void close() throws HiveException {
@@ -105,6 +105,7 @@ public class GenericUDTFJSONTuple extends GenericUDTF {
 
     inputOIs = args;
     numCols = args.length - 1;
+    jsonObjectCache = new HashCache<>();
 
     if (numCols < 1) {
       throw new UDFArgumentException("json_tuple() takes at least two 
arguments: " +

Reply via email to