Repository: hive
Updated Branches:
  refs/heads/master 3a1c4b57f -> ef34c818f


HIVE-12795: Vectorized execution causes ClassCastException (Yongzhi Chen, 
reviewed by Aihua Xu)


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

Branch: refs/heads/master
Commit: ef34c818fafa344360ae259d9b93f7d58a55fd4b
Parents: 3a1c4b5
Author: Yongzhi Chen <[email protected]>
Authored: Thu Jan 7 10:15:40 2016 -0500
Committer: Yongzhi Chen <[email protected]>
Committed: Mon Jan 11 09:58:39 2016 -0500

----------------------------------------------------------------------
 .../VectorExpressionWriterFactory.java          |   3 +-
 .../test/queries/clientpositive/vector_join.q   |  43 ++++++++
 .../results/clientpositive/vector_join.q.out    | 104 +++++++++++++++++++
 3 files changed, 149 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ef34c818/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
----------------------------------------------------------------------
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
index bbf8862..d57a767 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java
@@ -1212,7 +1212,8 @@ public final class VectorExpressionWriterFactory {
     ArrayList<String> columnNames = new ArrayList<String>();
     int i = 0;
     for(StructField field : fields) {
-      ObjectInspector fieldObjInsp = field.getFieldObjectInspector();
+      ObjectInspector fieldObjInsp = 
TypeInfoUtils.getStandardWritableObjectInspectorFromTypeInfo(
+                
TypeInfoUtils.getTypeInfoFromObjectInspector(field.getFieldObjectInspector()));
       writers[i] = VectorExpressionWriterFactory.
                 genVectorExpressionWritable(fieldObjInsp);
       columnNames.add(field.getFieldName());

http://git-wip-us.apache.org/repos/asf/hive/blob/ef34c818/ql/src/test/queries/clientpositive/vector_join.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/vector_join.q 
b/ql/src/test/queries/clientpositive/vector_join.q
new file mode 100644
index 0000000..9238a6e
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/vector_join.q
@@ -0,0 +1,43 @@
+DROP TABLE IF EXISTS test1_vc;
+DROP TABLE IF EXISTS test2_vc;
+CREATE TABLE test1_vc
+ (
+   id string)
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'='' );
+CREATE TABLE test2_vc(
+    id string
+  )
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'=''
+ );
+set hive.auto.convert.join=false;
+set hive.vectorized.execution.enabled = true;
+set hive.mapred.mode=nonstrict;
+SELECT cr.id1 ,
+cr.id2
+FROM
+(SELECT t1.id id1,
+ t2.id id2
+ from
+ (select * from test1_vc ) t1
+ left outer join test2_vc  t2
+ on t1.id=t2.id) cr;

http://git-wip-us.apache.org/repos/asf/hive/blob/ef34c818/ql/src/test/results/clientpositive/vector_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_join.q.out 
b/ql/src/test/results/clientpositive/vector_join.q.out
new file mode 100644
index 0000000..94c0290
--- /dev/null
+++ b/ql/src/test/results/clientpositive/vector_join.q.out
@@ -0,0 +1,104 @@
+PREHOOK: query: DROP TABLE IF EXISTS test1_vc
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE IF EXISTS test1_vc
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: DROP TABLE IF EXISTS test2_vc
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: DROP TABLE IF EXISTS test2_vc
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: CREATE TABLE test1_vc
+ (
+   id string)
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'='' )
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@test1_vc
+POSTHOOK: query: CREATE TABLE test1_vc
+ (
+   id string)
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'='' )
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@test1_vc
+PREHOOK: query: CREATE TABLE test2_vc(
+    id string
+  )
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'=''
+ )
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@test2_vc
+POSTHOOK: query: CREATE TABLE test2_vc(
+    id string
+  )
+   PARTITIONED BY (
+  cr_year bigint,
+  cr_month bigint)
+ROW FORMAT SERDE
+  'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'
+STORED AS INPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileInputFormat'
+OUTPUTFORMAT
+  'org.apache.hadoop.hive.ql.io.RCFileOutputFormat'
+TBLPROPERTIES (
+  'serialization.null.format'=''
+ )
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@test2_vc
+PREHOOK: query: SELECT cr.id1 ,
+cr.id2
+FROM
+(SELECT t1.id id1,
+ t2.id id2
+ from
+ (select * from test1_vc ) t1
+ left outer join test2_vc  t2
+ on t1.id=t2.id) cr
+PREHOOK: type: QUERY
+PREHOOK: Input: default@test1_vc
+PREHOOK: Input: default@test2_vc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT cr.id1 ,
+cr.id2
+FROM
+(SELECT t1.id id1,
+ t2.id id2
+ from
+ (select * from test1_vc ) t1
+ left outer join test2_vc  t2
+ on t1.id=t2.id) cr
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@test1_vc
+POSTHOOK: Input: default@test2_vc
+#### A masked pattern was here ####

Reply via email to