hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1652458 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java
Date Fri, 16 Jan 2015 16:58:35 GMT
Author: hashutosh
Date: Fri Jan 16 16:58:35 2015
New Revision: 1652458

URL: http://svn.apache.org/r1652458
Log:
HIVE-9377 : UDF in_file() in WHERE predicate causes NPE. (Mithun Radhakrishnan via Ashutosh
Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java?rev=1652458&r1=1652457&r2=1652458&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFInFile.java Fri
Jan 16 16:58:35 2015
@@ -140,6 +140,17 @@ public class GenericUDFInFile extends Ge
   }
 
   @Override
+  public void copyToNewInstance(Object newInstance) throws UDFArgumentException {
+    super.copyToNewInstance(newInstance); // Asserts the class invariant. (Same types.)
+    GenericUDFInFile that = (GenericUDFInFile)newInstance;
+    if (that != this) {
+      that.set = (this.set == null ? null : (HashSet<String>)this.set.clone());
+      that.strObjectInspector = this.strObjectInspector;
+      that.fileObjectInspector = this.fileObjectInspector;
+    }
+  }
+
+  @Override
   public String getDisplayString(String[] children) {
     assert (children.length == 2);
     return "in_file(" + children[0] + ", " + children[1] + ")";



Mime
View raw message