hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1498727 - /hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
Date Mon, 01 Jul 2013 22:29:17 GMT
Author: hashutosh
Date: Mon Jul  1 22:29:17 2013
New Revision: 1498727

URL: http://svn.apache.org/r1498727
Log:
HIVE-4774 : Hive Runtime Error while closing operators: java.lang.NullPointerException  (Remus
Rusanu via Ashutosh Chauhan)

Modified:
    hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java

Modified: hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java?rev=1498727&r1=1498726&r2=1498727&view=diff
==============================================================================
--- hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
(original)
+++ hive/branches/vectorization/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
Mon Jul  1 22:29:17 2013
@@ -39,6 +39,7 @@ import org.apache.hadoop.hive.serde2.obj
 import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
 import org.apache.hadoop.io.BooleanWritable;
 import org.apache.hadoop.io.FloatWritable;
 import org.apache.hadoop.io.IntWritable;
@@ -67,7 +68,16 @@ public final class VectorExpressionWrite
     }
 
     public VectorExpressionWriter init(ExprNodeDesc nodeDesc) throws HiveException {
-      this.objectInspector = nodeDesc.getWritableObjectInspector();
+      objectInspector = nodeDesc.getWritableObjectInspector();
+      if (null == objectInspector) {
+        objectInspector = TypeInfoUtils
+            .getStandardWritableObjectInspectorFromTypeInfo(nodeDesc.getTypeInfo());
+      }
+      if (null == objectInspector) {
+        throw new HiveException(String.format(
+            "Failed to initialize VectorExpressionWriter for expr: %s", 
+            nodeDesc.getExprString()));
+      }
       return this;
     }
 



Mime
View raw message