hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmccl...@apache.org
Subject hive git commit: HIVE-13092: Vectorized java.lang.ClassCastException: org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo cannot be cast to org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo (Matt McCline, reviewed by Sergey Shelukhin)
Date Mon, 22 Feb 2016 11:45:18 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 4cb3b11e2 -> d0bd694ec


HIVE-13092: Vectorized java.lang.ClassCastException: org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo
cannot be cast to org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo (Matt McCline,
reviewed by Sergey Shelukhin)


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

Branch: refs/heads/branch-1
Commit: d0bd694ec856d901666849e5c84dfd0b122c1c21
Parents: 4cb3b11
Author: Matt McCline <mmccline@hortonworks.com>
Authored: Mon Feb 22 03:45:13 2016 -0800
Committer: Matt McCline <mmccline@hortonworks.com>
Committed: Mon Feb 22 03:45:13 2016 -0800

----------------------------------------------------------------------
 .../hive/ql/exec/vector/VectorExtractRow.java   | 33 ++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d0bd694e/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExtractRow.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExtractRow.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExtractRow.java
index 9774f0c..c662634 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExtractRow.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExtractRow.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.sql.Date;
 import java.sql.Timestamp;
 import java.util.List;
+
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
@@ -44,6 +45,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableHiveVarch
 import org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
 import org.apache.hadoop.hive.serde2.typeinfo.VarcharTypeInfo;
 import org.apache.hadoop.io.BytesWritable;
@@ -604,6 +606,26 @@ public abstract class VectorExtractRow {
     }
   }
 
+  private class NotReferencedComplexExtractor extends Extractor {
+
+    NotReferencedComplexExtractor(int columnIndex) {
+      super(columnIndex);
+    }
+
+    @Override
+    void setColumnVector(VectorizedRowBatch batch) {
+    }
+
+    @Override
+    void forgetColumnVector() {
+    }
+
+    @Override
+    Object extract(int batchIndex) {
+      throw new RuntimeException("Not expecting to reference a complex data type in the vectorized
path");
+    }
+  }
+
   private Extractor createExtractor(PrimitiveTypeInfo primitiveTypeInfo, int columnIndex)
throws HiveException {
     PrimitiveCategory primitiveCategory = primitiveTypeInfo.getPrimitiveCategory();
     Extractor extracter;
@@ -678,9 +700,16 @@ public abstract class VectorExtractRow {
     for (StructField field : fields) {
       int columnIndex = projectedColumns.get(i);
       ObjectInspector fieldInspector = field.getFieldObjectInspector();
-      PrimitiveTypeInfo primitiveTypeInfo = (PrimitiveTypeInfo) TypeInfoUtils.getTypeInfoFromTypeString(
+      TypeInfo typeInfo = TypeInfoUtils.getTypeInfoFromTypeString(
           fieldInspector.getTypeName());
-      extracters[i] = createExtractor(primitiveTypeInfo, columnIndex);
+      if (typeInfo.getCategory() == ObjectInspector.Category.PRIMITIVE) {
+        PrimitiveTypeInfo primitiveTypeInfo = (PrimitiveTypeInfo) typeInfo;
+        extracters[i] = createExtractor(primitiveTypeInfo, columnIndex);
+      } else {
+        // Ignore COMPLEX types .. the Vectorization class will not vectorize this query
unless
+        // those types are not actually accessed.
+        extracters[i] = new NotReferencedComplexExtractor(columnIndex);;
+      }
       i++;
     }
   }


Mime
View raw message