You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ab...@apache.org on 2019/09/11 10:16:16 UTC
[hive] branch master updated: HIVE-21510: Vectorization: add
support for and/or for (constant,
column) cases (Laszlo Bodor reviewed by Zoltan Haindrich)
This is an automated email from the ASF dual-hosted git repository.
abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new b920a20 HIVE-21510: Vectorization: add support for and/or for (constant,column) cases (Laszlo Bodor reviewed by Zoltan Haindrich)
b920a20 is described below
commit b920a209ccbf01f044ab139eaf21ca97709a8105
Author: Laszlo Bodor <bo...@gmail.com>
AuthorDate: Wed Sep 11 12:10:57 2019 +0200
HIVE-21510: Vectorization: add support for and/or for (constant,column) cases (Laszlo Bodor reviewed by Zoltan Haindrich)
Signed-off-by: Laszlo Bodor <bo...@gmail.com>
---
.../test/resources/testconfiguration.properties | 1 +
.../ExpressionTemplates/ScalarCompareColumn.txt | 4 +-
.../ExpressionTemplates/ScalarDivideColumn.txt | 2 +-
.../ql/exec/vector/VectorExpressionDescriptor.java | 3 +-
.../hive/ql/exec/vector/VectorizationContext.java | 14 +-
.../hive/ql/exec/vector/expressions/ColAndCol.java | 5 +
.../hive/ql/exec/vector/expressions/ColOrCol.java | 5 +
.../expressions/ConstantVectorExpression.java | 6 +-
.../exec/vector/expressions/ScalarNullAndCol.java | 71 ++
.../exec/vector/expressions/ScalarNullOrCol.java | 71 ++
.../hive/ql/udf/generic/GenericUDFOPAnd.java | 3 +-
.../hadoop/hive/ql/udf/generic/GenericUDFOPOr.java | 5 +-
.../clientpositive/vector_and_or_scalar_col.q | 85 +++
.../llap/vector_and_or_scalar_col.q.out | 738 +++++++++++++++++++++
.../clientpositive/llap/vector_date_1.q.out | 20 +-
.../clientpositive/llap/vector_interval_2.q.out | 24 +-
.../results/clientpositive/vector_date_1.q.out | 16 +-
.../hive/ql/exec/vector/LongColumnVector.java | 4 +-
18 files changed, 1030 insertions(+), 47 deletions(-)
diff --git a/itests/src/test/resources/testconfiguration.properties b/itests/src/test/resources/testconfiguration.properties
index 34d0e27..548dfac 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -806,6 +806,7 @@ minillaplocal.query.files=\
union_top_level.q,\
update_access_time_non_current_db.q, \
vector_acid4.q,\
+ vector_and_or_scalar_col.q,\
vector_annotate_stats_select.q,\
vector_auto_smb_mapjoin_14.q,\
vector_case_when_conversion.q,\
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/ScalarCompareColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/ScalarCompareColumn.txt
index 60dc725..4f53116 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/ScalarCompareColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/ScalarCompareColumn.txt
@@ -29,8 +29,8 @@ import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
import org.apache.hadoop.hive.ql.metadata.HiveException;
/**
- * Generated from template ColumnCompareScalar.txt, which covers binary comparison
- * expressions between a column and a scalar. The boolean output is stored in a
+ * Generated from template ScalarCompareColumn.txt, which covers binary comparison
+ * expressions between a scalar and a column. The boolean output is stored in a
* separate boolean column.
*/
public class <ClassName> extends VectorExpression {
diff --git a/ql/src/gen/vectorization/ExpressionTemplates/ScalarDivideColumn.txt b/ql/src/gen/vectorization/ExpressionTemplates/ScalarDivideColumn.txt
index 3cb7aaa..4e32955 100644
--- a/ql/src/gen/vectorization/ExpressionTemplates/ScalarDivideColumn.txt
+++ b/ql/src/gen/vectorization/ExpressionTemplates/ScalarDivideColumn.txt
@@ -36,7 +36,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.NullUtil;
import org.apache.hadoop.hive.ql.metadata.HiveException;
/**
- * Generated from template ScalarArithmeticColumn.txt.
+ * Generated from template ScalarDivideColumn.txt.
* Implements a vectorized arithmetic operator with a scalar on the left and a
* column vector on the right. The result is output to an output column vector.
*/
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExpressionDescriptor.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExpressionDescriptor.java
index fb40f5e..e8e0f64 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExpressionDescriptor.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorExpressionDescriptor.java
@@ -171,7 +171,8 @@ public class VectorExpressionDescriptor {
NONE(0),
COLUMN(1),
SCALAR(2),
- DYNAMICVALUE(3);
+ DYNAMICVALUE(3),
+ NULLSCALAR(4);
private final int value;
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java
index d5257c7..4ba2c1b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java
@@ -1966,10 +1966,10 @@ import com.google.common.annotations.VisibleForTesting;
builder.setInputExpressionType(i, InputExpressionType.COLUMN);
} else if (child instanceof ExprNodeConstantDesc) {
if (isNullConst(child)) {
- // Cannot handle NULL scalar parameter.
- return null;
+ builder.setInputExpressionType(i, InputExpressionType.NULLSCALAR);
+ }else {
+ builder.setInputExpressionType(i, InputExpressionType.SCALAR);
}
- builder.setInputExpressionType(i, InputExpressionType.SCALAR);
} else if (child instanceof ExprNodeDynamicValueDesc) {
builder.setInputExpressionType(i, InputExpressionType.DYNAMICVALUE);
} else {
@@ -4067,10 +4067,10 @@ import com.google.common.annotations.VisibleForTesting;
} else if (varcharTypePattern.matcher(typeString).matches()) {
return ((HiveVarchar) constDesc.getValue()).getValue().getBytes(StandardCharsets.UTF_8);
} else if (typeString.equalsIgnoreCase("boolean")) {
- if (constDesc.getValue().equals(Boolean.TRUE)) {
- return 1;
- } else {
- return 0;
+ if (constDesc.getValue() == null) {
+ return null;
+ }else{
+ return constDesc.getValue().equals(Boolean.TRUE) ? 1 : 0;
}
} else if (decimalTypePattern.matcher(typeString).matches()) {
return constDesc.getValue();
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java
index c6b52fa..8442f44 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java
@@ -57,6 +57,11 @@ public class ColAndCol extends VectorExpression {
LongColumnVector inputColVector1 = (LongColumnVector) batch.cols[colNum1];
LongColumnVector inputColVector2 = (LongColumnVector) batch.cols[colNum2];
+ doEvaluate(batch, inputColVector1, inputColVector2);
+ }
+
+ protected void doEvaluate(VectorizedRowBatch batch, LongColumnVector inputColVector1,
+ LongColumnVector inputColVector2) {
int[] sel = batch.selected;
int n = batch.size;
long[] vector1 = inputColVector1.vector;
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java
index 6d816d1..19fc289 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java
@@ -60,6 +60,11 @@ public class ColOrCol extends VectorExpression {
LongColumnVector inputColVector1 = (LongColumnVector) batch.cols[colNum1];
LongColumnVector inputColVector2 = (LongColumnVector) batch.cols[colNum2];
+ doEvaluate(batch, inputColVector1, inputColVector2);
+ }
+
+ protected void doEvaluate(VectorizedRowBatch batch, LongColumnVector inputColVector1,
+ LongColumnVector inputColVector2) {
int[] sel = batch.selected;
int n = batch.size;
long[] vector1 = inputColVector1.vector;
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java
index 94a07d3..647936e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ConstantVectorExpression.java
@@ -38,8 +38,6 @@ import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.Pr
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
-import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
/**
* Constant is represented as a vector with repeating values.
@@ -524,4 +522,8 @@ public class ConstantVectorExpression extends VectorExpression {
public VectorExpressionDescriptor.Descriptor getDescriptor() {
return (new VectorExpressionDescriptor.Builder()).build();
}
+
+ public boolean getIsNullValue() {
+ return isNullValue;
+ }
}
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullAndCol.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullAndCol.java
new file mode 100644
index 0000000..264ca29
--- /dev/null
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullAndCol.java
@@ -0,0 +1,71 @@
+/* * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * This class performs constant AND column expression where the constant is null
+ */
+package org.apache.hadoop.hive.ql.exec.vector.expressions;
+
+import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+
+public class ScalarNullAndCol extends ColAndCol {
+ private static final long serialVersionUID = 1L;
+ protected final int colNum;
+
+ public ScalarNullAndCol(ConstantVectorExpression expression, int colNum, int outputColumnNum) {
+ super(colNum, -1, outputColumnNum);
+ this.colNum = colNum;
+ }
+
+ public ScalarNullAndCol() {
+ super();
+ colNum = -1;
+ }
+
+ @Override
+ public void evaluate(VectorizedRowBatch batch) throws HiveException {
+ if (childExpressions != null) {
+ super.evaluateChildren(batch);
+ }
+
+ LongColumnVector inputColVector = (LongColumnVector) batch.cols[colNum];
+
+ super.doEvaluate(batch, new LongColumnVector(inputColVector.vector.length).fillWithNulls(),
+ inputColVector);
+ }
+
+ @Override
+ public String vectorExpressionParameters() {
+ return getColumnParamString(0, colNum) + ", " + getLongValueParamString(1, 0);
+ }
+
+ @Override
+ public VectorExpressionDescriptor.Descriptor getDescriptor() {
+ return (new VectorExpressionDescriptor.Builder())
+ .setMode(
+ VectorExpressionDescriptor.Mode.PROJECTION)
+ .setNumArguments(2)
+ .setArgumentTypes(
+ VectorExpressionDescriptor.ArgumentType.getType("long"),
+ VectorExpressionDescriptor.ArgumentType.getType("long"))
+ .setInputExpressionTypes(
+ VectorExpressionDescriptor.InputExpressionType.NULLSCALAR,
+ VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+ }
+}
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullOrCol.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullOrCol.java
new file mode 100644
index 0000000..7e5b8b7
--- /dev/null
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ScalarNullOrCol.java
@@ -0,0 +1,71 @@
+/* * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * This class performs constant OR column expression where the constant is null
+ */
+package org.apache.hadoop.hive.ql.exec.vector.expressions;
+
+import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
+import org.apache.hadoop.hive.ql.exec.vector.VectorExpressionDescriptor;
+import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+
+public class ScalarNullOrCol extends ColOrCol {
+ private static final long serialVersionUID = 1L;
+ protected final int colNum;
+
+ public ScalarNullOrCol(ConstantVectorExpression expression, int colNum, int outputColumnNum) {
+ super(colNum, -1, outputColumnNum);
+ this.colNum = colNum;
+ }
+
+ public ScalarNullOrCol() {
+ super();
+ colNum = -1;
+ }
+
+ @Override
+ public void evaluate(VectorizedRowBatch batch) throws HiveException {
+ if (childExpressions != null) {
+ super.evaluateChildren(batch);
+ }
+
+ LongColumnVector inputColVector = (LongColumnVector) batch.cols[colNum];
+
+ super.doEvaluate(batch, new LongColumnVector(inputColVector.vector.length).fillWithNulls(),
+ inputColVector);
+ }
+
+ @Override
+ public String vectorExpressionParameters() {
+ return getColumnParamString(0, colNum) + ", " + getLongValueParamString(1, 0);
+ }
+
+ @Override
+ public VectorExpressionDescriptor.Descriptor getDescriptor() {
+ return (new VectorExpressionDescriptor.Builder())
+ .setMode(
+ VectorExpressionDescriptor.Mode.PROJECTION)
+ .setNumArguments(2)
+ .setArgumentTypes(
+ VectorExpressionDescriptor.ArgumentType.getType("long"),
+ VectorExpressionDescriptor.ArgumentType.getType("long"))
+ .setInputExpressionTypes(
+ VectorExpressionDescriptor.InputExpressionType.NULLSCALAR,
+ VectorExpressionDescriptor.InputExpressionType.COLUMN).build();
+ }
+}
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPAnd.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPAnd.java
index d1777af..dd6df67 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPAnd.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPAnd.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.ColAndCol;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterColAndScalar;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterExprAndExpr;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterScalarAndColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.ScalarNullAndCol;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.udf.UDFType;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
@@ -37,7 +38,7 @@ import org.apache.hadoop.io.BooleanWritable;
* GenericUDF Class for computing and.
*/
@Description(name = "and", value = "a1 _FUNC_ a2 _FUNC_ ... _FUNC_ an - Logical and")
-@VectorizedExpressions({ColAndCol.class, FilterExprAndExpr.class, FilterColAndScalar.class,
+@VectorizedExpressions({ColAndCol.class, ScalarNullAndCol.class, FilterExprAndExpr.class, FilterColAndScalar.class,
FilterScalarAndColumn.class})
@NDV(maxNdv = 2)
@UDFType(deterministic = true, commutative = true)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
index 5b0bdc2..cb85566 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPOr.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.hive.ql.exec.vector.expressions.ColOrCol;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterColOrScalar;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterExprOrExpr;
import org.apache.hadoop.hive.ql.exec.vector.expressions.FilterScalarOrColumn;
+import org.apache.hadoop.hive.ql.exec.vector.expressions.ScalarNullOrCol;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.udf.UDFType;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
@@ -37,8 +38,8 @@ import org.apache.hadoop.io.BooleanWritable;
* GenericUDF Class for computing or.
*/
@Description(name = "or", value = "a1 _FUNC_ a2 _FUNC_ ... _FUNC_ an - Logical or")
-@VectorizedExpressions({ColOrCol.class, FilterExprOrExpr.class, FilterColOrScalar.class,
- FilterScalarOrColumn.class})
+@VectorizedExpressions({ ColOrCol.class, ScalarNullOrCol.class, FilterExprOrExpr.class,
+ FilterColOrScalar.class, FilterScalarOrColumn.class })
@NDV(maxNdv = 2)
@UDFType(deterministic = true, commutative = true)
public class GenericUDFOPOr extends GenericUDF {
diff --git a/ql/src/test/queries/clientpositive/vector_and_or_scalar_col.q b/ql/src/test/queries/clientpositive/vector_and_or_scalar_col.q
new file mode 100644
index 0000000..5a4a88d
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/vector_and_or_scalar_col.q
@@ -0,0 +1,85 @@
+--! qt:dataset:src
+set hive.explain.user=false;
+set hive.vectorized.execution.enabled=true;
+set hive.fetch.task.conversion=none;
+set hive.test.vectorizer.suppress.fatal.exceptions=false;
+
+drop table if exists vector_and_or;
+create table vector_and_or (dt1 date, dt2 date) stored as orc;
+
+insert into table vector_and_or
+ select null, null from src limit 1;
+insert into table vector_and_or
+ select date '1999-12-31', date '2000-01-01' from src limit 1;
+insert into table vector_and_or
+ select date '2001-01-01', date '2001-06-01' from src limit 1;
+
+select '*** OR ***';
+-- select null explicitly
+
+explain vectorization detail select null or dt1 is not null from vector_and_or;
+select '*** vectorized null or dt1 is not null ***';
+select null or dt1 is not null from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized null or dt1 is not null ***';
+select null or dt1 is not null from vector_and_or;
+set hive.vectorized.execution.enabled=true;
+
+
+-- select boolean constant, already vectorized
+
+explain vectorization detail select false or dt1 is not null from vector_and_or;
+select '*** vectorized false or dt1 is not null ***';
+select false or dt1 is not null from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized false or dt1 is not null ***';
+select false or dt1 is not null from vector_and_or;
+set hive.vectorized.execution.enabled=true;
+
+-- select dt1 = dt1 which is translated to "null or ..." after HIVE-21001
+
+explain vectorization detail select dt1 = dt1 from vector_and_or;
+select '*** vectorized dt1=dt1 ***';
+select dt1 = dt1 from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized dt1=dt1 ***';
+select dt1 = dt1 from vector_and_or;
+set hive.vectorized.execution.enabled=true;
+
+
+select '*** AND ***';
+-- select null explicitly
+
+explain vectorization detail select null and dt1 is null from vector_and_or;
+select '*** vectorized null and dt1 is null ***';
+select null and dt1 is null from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized null and dt1 is null ***';
+select null and dt1 is null from vector_and_or;
+set hive.vectorized.execution.enabled=true;
+
+
+-- select boolean constant, already vectorized
+
+explain vectorization detail select true and dt1 is null from vector_and_or;
+select '*** vectorized true and dt1 is null ***';
+select true and dt1 is null from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized true and dt1 is null ***';
+select true and dt1 is null from vector_and_or;
+set hive.vectorized.execution.enabled=true;
+
+-- select dt1 != dt1 which is translated to "null and ..." after HIVE-21001
+
+explain vectorization detail select dt1 != dt1 from vector_and_or;
+select '*** vectorized dt1!=dt1 ***';
+select dt1 != dt1 from vector_and_or;
+
+set hive.vectorized.execution.enabled=false;
+select '*** non-vectorized dt1!=dt1 ***';
+select dt1 != dt1 from vector_and_or;
\ No newline at end of file
diff --git a/ql/src/test/results/clientpositive/llap/vector_and_or_scalar_col.q.out b/ql/src/test/results/clientpositive/llap/vector_and_or_scalar_col.q.out
new file mode 100644
index 0000000..22dee08
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/vector_and_or_scalar_col.q.out
@@ -0,0 +1,738 @@
+PREHOOK: query: drop table if exists vector_and_or
+PREHOOK: type: DROPTABLE
+POSTHOOK: query: drop table if exists vector_and_or
+POSTHOOK: type: DROPTABLE
+PREHOOK: query: create table vector_and_or (dt1 date, dt2 date) stored as orc
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@vector_and_or
+POSTHOOK: query: create table vector_and_or (dt1 date, dt2 date) stored as orc
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@vector_and_or
+PREHOOK: query: insert into table vector_and_or
+ select null, null from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@vector_and_or
+POSTHOOK: query: insert into table vector_and_or
+ select null, null from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@vector_and_or
+POSTHOOK: Lineage: vector_and_or.dt1 EXPRESSION []
+POSTHOOK: Lineage: vector_and_or.dt2 EXPRESSION []
+PREHOOK: query: insert into table vector_and_or
+ select date '1999-12-31', date '2000-01-01' from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@vector_and_or
+POSTHOOK: query: insert into table vector_and_or
+ select date '1999-12-31', date '2000-01-01' from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@vector_and_or
+POSTHOOK: Lineage: vector_and_or.dt1 SIMPLE []
+POSTHOOK: Lineage: vector_and_or.dt2 SIMPLE []
+PREHOOK: query: insert into table vector_and_or
+ select date '2001-01-01', date '2001-06-01' from src limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Output: default@vector_and_or
+POSTHOOK: query: insert into table vector_and_or
+ select date '2001-01-01', date '2001-06-01' from src limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Output: default@vector_and_or
+POSTHOOK: Lineage: vector_and_or.dt1 SIMPLE []
+POSTHOOK: Lineage: vector_and_or.dt2 SIMPLE []
+PREHOOK: query: select '*** OR ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** OR ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** OR ***
+PREHOOK: query: explain vectorization detail select null or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select null or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: (null or dt1 is not null) (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [5]
+ selectExpressions: ScalarNullOrCol(col 4:boolean, val 0:boolean)(children: IsNotNull(col 0:date) -> 4:boolean) -> 5:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint, bigint, bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized null or dt1 is not null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized null or dt1 is not null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized null or dt1 is not null ***
+PREHOOK: query: select null or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select null or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+NULL
+PREHOOK: query: select '*** non-vectorized null or dt1 is not null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized null or dt1 is not null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized null or dt1 is not null ***
+PREHOOK: query: select null or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select null or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+NULL
+PREHOOK: query: explain vectorization detail select false or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select false or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: dt1 is not null (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [3]
+ selectExpressions: IsNotNull(col 0:date) -> 3:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized false or dt1 is not null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized false or dt1 is not null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized false or dt1 is not null ***
+PREHOOK: query: select false or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select false or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+false
+PREHOOK: query: select '*** non-vectorized false or dt1 is not null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized false or dt1 is not null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized false or dt1 is not null ***
+PREHOOK: query: select false or dt1 is not null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select false or dt1 is not null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+false
+PREHOOK: query: explain vectorization detail select dt1 = dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select dt1 = dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: (null or dt1 is not null) (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [5]
+ selectExpressions: ScalarNullOrCol(col 4:boolean, val 0:boolean)(children: IsNotNull(col 0:date) -> 4:boolean) -> 5:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint, bigint, bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized dt1=dt1 ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized dt1=dt1 ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized dt1=dt1 ***
+PREHOOK: query: select dt1 = dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select dt1 = dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+NULL
+PREHOOK: query: select '*** non-vectorized dt1=dt1 ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized dt1=dt1 ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized dt1=dt1 ***
+PREHOOK: query: select dt1 = dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select dt1 = dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+true
+true
+NULL
+PREHOOK: query: select '*** AND ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** AND ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** AND ***
+PREHOOK: query: explain vectorization detail select null and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select null and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: (null and dt1 is null) (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [5]
+ selectExpressions: ScalarNullAndCol(col 4:boolean, val 0:boolean)(children: IsNull(col 0:date) -> 4:boolean) -> 5:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint, bigint, bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized null and dt1 is null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized null and dt1 is null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized null and dt1 is null ***
+PREHOOK: query: select null and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select null and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+NULL
+PREHOOK: query: select '*** non-vectorized null and dt1 is null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized null and dt1 is null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized null and dt1 is null ***
+PREHOOK: query: select null and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select null and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+NULL
+PREHOOK: query: explain vectorization detail select true and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select true and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: dt1 is null (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [3]
+ selectExpressions: IsNull(col 0:date) -> 3:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized true and dt1 is null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized true and dt1 is null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized true and dt1 is null ***
+PREHOOK: query: select true and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select true and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+true
+PREHOOK: query: select '*** non-vectorized true and dt1 is null ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized true and dt1 is null ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized true and dt1 is null ***
+PREHOOK: query: select true and dt1 is null from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select true and dt1 is null from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+true
+PREHOOK: query: explain vectorization detail select dt1 != dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: explain vectorization detail select dt1 != dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+PLAN VECTORIZATION:
+ enabled: true
+ enabledConditionsMet: [hive.vectorized.execution.enabled IS true]
+
+STAGE DEPENDENCIES:
+ Stage-1 is a root stage
+ Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+ Stage: Stage-1
+ Tez
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: vector_and_or
+ Statistics: Num rows: 3 Data size: 168 Basic stats: COMPLETE Column stats: COMPLETE
+ TableScan Vectorization:
+ native: true
+ vectorizationSchemaColumns: [0:dt1:date, 1:dt2:date, 2:ROW__ID:struct<writeid:bigint,bucketid:int,rowid:bigint>]
+ Select Operator
+ expressions: (null and dt1 is null) (type: boolean)
+ outputColumnNames: _col0
+ Select Vectorization:
+ className: VectorSelectOperator
+ native: true
+ projectedOutputColumnNums: [5]
+ selectExpressions: ScalarNullAndCol(col 4:boolean, val 0:boolean)(children: IsNull(col 0:date) -> 4:boolean) -> 5:boolean
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ File Output Operator
+ compressed: false
+ File Sink Vectorization:
+ className: VectorFileSinkOperator
+ native: false
+ Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
+ table:
+ input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+ output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+ serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+ Execution mode: vectorized, llap
+ LLAP IO: all inputs
+ Map Vectorization:
+ enabled: true
+ enabledConditionsMet: hive.vectorized.use.vectorized.input.format IS true
+ inputFormatFeatureSupport: [DECIMAL_64]
+ featureSupportInUse: [DECIMAL_64]
+ inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
+ allNative: false
+ usesVectorUDFAdaptor: false
+ vectorized: true
+ rowBatchContext:
+ dataColumnCount: 2
+ includeColumns: [0]
+ dataColumns: dt1:date, dt2:date
+ partitionColumnCount: 0
+ scratchColumnTypeNames: [bigint, bigint, bigint]
+
+ Stage: Stage-0
+ Fetch Operator
+ limit: -1
+ Processor Tree:
+ ListSink
+
+PREHOOK: query: select '*** vectorized dt1!=dt1 ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** vectorized dt1!=dt1 ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** vectorized dt1!=dt1 ***
+PREHOOK: query: select dt1 != dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select dt1 != dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+NULL
+PREHOOK: query: select '*** non-vectorized dt1!=dt1 ***'
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: select '*** non-vectorized dt1!=dt1 ***'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+*** non-vectorized dt1!=dt1 ***
+PREHOOK: query: select dt1 != dt1 from vector_and_or
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+POSTHOOK: query: select dt1 != dt1 from vector_and_or
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vector_and_or
+#### A masked pattern was here ####
+false
+false
+NULL
diff --git a/ql/src/test/results/clientpositive/llap/vector_date_1.q.out b/ql/src/test/results/clientpositive/llap/vector_date_1.q.out
index 57d1ff3..b115330 100644
--- a/ql/src/test/results/clientpositive/llap/vector_date_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_date_1.q.out
@@ -124,8 +124,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [0, 1, 4, 5, 6, 7, 9, 10, 11]
- selectExpressions: VectorUDFAdaptor((null or dt1 is not null))(children: IsNotNull(col 0:date) -> 3:boolean) -> 4:boolean, LongColNotEqualLongColumn(col 0:date, col 1:date) -> 5:boolean, LongColLessEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColLessLongColumn(col 0:date, col 1:date) -> 7:boolean, VectorUDFAdaptor((null or dt2 is not null))(children: IsNotNull(col 1:date) -> 8:boolean) -> 9:boolean, LongColGreaterEqualLongColumn(col 1:date, col 0:date [...]
+ projectedOutputColumnNums: [0, 1, 5, 6, 7, 8, 11, 12, 13]
+ selectExpressions: ScalarNullOrCol(col 4:boolean, val 0:boolean)(children: IsNotNull(col 0:date) -> 4:boolean) -> 5:boolean, LongColNotEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColLessEqualLongColumn(col 0:date, col 1:date) -> 7:boolean, LongColLessLongColumn(col 0:date, col 1:date) -> 8:boolean, ScalarNullOrCol(col 10:boolean, val 0:boolean)(children: IsNotNull(col 1:date) -> 10:boolean) -> 11:boolean, LongColGreaterEqualLongColumn(col 1:date, col [...]
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: date)
@@ -135,7 +135,7 @@ STAGE PLANS:
keyColumns: 0:date
native: true
nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true
- valueColumns: 1:date, 4:boolean, 5:boolean, 6:boolean, 7:boolean, 9:boolean, 10:boolean, 11:boolean
+ valueColumns: 1:date, 5:boolean, 6:boolean, 7:boolean, 8:boolean, 11:boolean, 12:boolean, 13:boolean
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
value expressions: _col1 (type: date), _col2 (type: boolean), _col3 (type: boolean), _col5 (type: boolean), _col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean), _col9 (type: boolean)
Execution mode: vectorized, llap
@@ -147,14 +147,14 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
rowBatchContext:
dataColumnCount: 2
includeColumns: [0, 1]
dataColumns: dt1:date, dt2:date
partitionColumnCount: 0
- scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
+ scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
Reducer 2
Execution mode: vectorized, llap
Reduce Vectorization:
@@ -293,8 +293,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [0, 1, 4, 5, 6, 7, 9, 10, 11]
- selectExpressions: VectorUDFAdaptor((null and dt1 is null))(children: IsNull(col 0:date) -> 3:boolean) -> 4:boolean, LongColEqualLongColumn(col 0:date, col 1:date) -> 5:boolean, LongColGreaterEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColGreaterLongColumn(col 0:date, col 1:date) -> 7:boolean, VectorUDFAdaptor((null and dt2 is null))(children: IsNull(col 1:date) -> 8:boolean) -> 9:boolean, LongColLessEqualLongColumn(col 1:date, col 0:date) -> 10:bool [...]
+ projectedOutputColumnNums: [0, 1, 5, 6, 7, 8, 11, 12, 13]
+ selectExpressions: ScalarNullAndCol(col 4:boolean, val 0:boolean)(children: IsNull(col 0:date) -> 4:boolean) -> 5:boolean, LongColEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColGreaterEqualLongColumn(col 0:date, col 1:date) -> 7:boolean, LongColGreaterLongColumn(col 0:date, col 1:date) -> 8:boolean, ScalarNullAndCol(col 10:boolean, val 0:boolean)(children: IsNull(col 1:date) -> 10:boolean) -> 11:boolean, LongColLessEqualLongColumn(col 1:date, col 0:d [...]
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: date)
@@ -304,7 +304,7 @@ STAGE PLANS:
keyColumns: 0:date
native: true
nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true
- valueColumns: 1:date, 4:boolean, 5:boolean, 6:boolean, 7:boolean, 9:boolean, 10:boolean, 11:boolean
+ valueColumns: 1:date, 5:boolean, 6:boolean, 7:boolean, 8:boolean, 11:boolean, 12:boolean, 13:boolean
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
value expressions: _col1 (type: date), _col2 (type: boolean), _col3 (type: boolean), _col5 (type: boolean), _col6 (type: boolean), _col7 (type: boolean), _col8 (type: boolean), _col9 (type: boolean)
Execution mode: vectorized, llap
@@ -316,14 +316,14 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
rowBatchContext:
dataColumnCount: 2
includeColumns: [0, 1]
dataColumns: dt1:date, dt2:date
partitionColumnCount: 0
- scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
+ scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
Reducer 2
Execution mode: vectorized, llap
Reduce Vectorization:
diff --git a/ql/src/test/results/clientpositive/llap/vector_interval_2.q.out b/ql/src/test/results/clientpositive/llap/vector_interval_2.q.out
index 5836dae..8a834b7 100644
--- a/ql/src/test/results/clientpositive/llap/vector_interval_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_interval_2.q.out
@@ -139,8 +139,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [2, 9, 12, 15, 18, 21, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56]
- selectExpressions: VectorUDFAdaptor((null or CAST( str1 AS INTERVAL YEAR TO MONTH) is not null))(children: IsNotNull(col 7:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 7:interval_year_month) -> 8:boolean) -> 9:boolean, LongColLessEqualLongColumn(col 10:interval_year_month, col 11:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 10:interval_year_month, CastStringToIntervalYearMonth(col 3:string) -> 11:in [...]
+ projectedOutputColumnNums: [2, 10, 13, 16, 19, 22, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57]
+ selectExpressions: ScalarNullOrCol(col 9:boolean, val 0:boolean)(children: IsNotNull(col 8:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 8:interval_year_month) -> 9:boolean) -> 10:boolean, LongColLessEqualLongColumn(col 11:interval_year_month, col 12:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 11:interval_year_month, CastStringToIntervalYearMonth(col 3:string) -> 12:interval_year_month) -> 13:boolea [...]
Statistics: Num rows: 2 Data size: 366 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: string)
@@ -160,7 +160,7 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
Reducer 2
Execution mode: vectorized, llap
@@ -349,8 +349,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [2, 9, 12, 15, 18, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41]
- selectExpressions: VectorUDFAdaptor((null and CAST( str1 AS INTERVAL YEAR TO MONTH) is null))(children: IsNull(col 7:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 7:interval_year_month) -> 8:boolean) -> 9:boolean, LongColGreaterEqualLongColumn(col 10:interval_year_month, col 11:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 10:interval_year_month, CastStringToIntervalYearMonth(col 3:string) -> 11:inter [...]
+ projectedOutputColumnNums: [2, 10, 13, 16, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42]
+ selectExpressions: ScalarNullAndCol(col 9:boolean, val 0:boolean)(children: IsNull(col 8:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 8:interval_year_month) -> 9:boolean) -> 10:boolean, LongColGreaterEqualLongColumn(col 11:interval_year_month, col 12:interval_year_month)(children: CastStringToIntervalYearMonth(col 2:string) -> 11:interval_year_month, CastStringToIntervalYearMonth(col 3:string) -> 12:interval_year_month) -> 13:boole [...]
Statistics: Num rows: 2 Data size: 318 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: string)
@@ -370,7 +370,7 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
Reducer 2
Execution mode: vectorized, llap
@@ -559,8 +559,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [4, 9, 12, 15, 18, 21, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56]
- selectExpressions: VectorUDFAdaptor((null or CAST( str3 AS INTERVAL DAY TO SECOND) is not null))(children: IsNotNull(col 7:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 7:interval_day_time) -> 8:boolean) -> 9:boolean, IntervalDayTimeColLessEqualIntervalDayTimeColumn(col 10:interval_day_time, col 11:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 10:interval_day_time, CastStringToIntervalDayTime(col 5:string) -> [...]
+ projectedOutputColumnNums: [4, 10, 13, 16, 19, 22, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57]
+ selectExpressions: ScalarNullOrCol(col 9:boolean, val 0:boolean)(children: IsNotNull(col 8:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 8:interval_day_time) -> 9:boolean) -> 10:boolean, IntervalDayTimeColLessEqualIntervalDayTimeColumn(col 11:interval_day_time, col 12:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 11:interval_day_time, CastStringToIntervalDayTime(col 5:string) -> 12:interval_day_time) -> 13:bo [...]
Statistics: Num rows: 2 Data size: 374 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: string)
@@ -580,7 +580,7 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
Reducer 2
Execution mode: vectorized, llap
@@ -769,8 +769,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [4, 9, 12, 15, 18, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41]
- selectExpressions: VectorUDFAdaptor((null and CAST( str3 AS INTERVAL DAY TO SECOND) is null))(children: IsNull(col 7:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 7:interval_day_time) -> 8:boolean) -> 9:boolean, IntervalDayTimeColGreaterEqualIntervalDayTimeColumn(col 10:interval_day_time, col 11:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 10:interval_day_time, CastStringToIntervalDayTime(col 5:string) -> 11 [...]
+ projectedOutputColumnNums: [4, 10, 13, 16, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42]
+ selectExpressions: ScalarNullAndCol(col 9:boolean, val 0:boolean)(children: IsNull(col 8:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 8:interval_day_time) -> 9:boolean) -> 10:boolean, IntervalDayTimeColGreaterEqualIntervalDayTimeColumn(col 11:interval_day_time, col 12:interval_day_time)(children: CastStringToIntervalDayTime(col 4:string) -> 11:interval_day_time, CastStringToIntervalDayTime(col 5:string) -> 12:interval_day_time) -> 13:b [...]
Statistics: Num rows: 2 Data size: 326 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: string)
@@ -790,7 +790,7 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: true
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
Reducer 2
Execution mode: vectorized, llap
diff --git a/ql/src/test/results/clientpositive/vector_date_1.q.out b/ql/src/test/results/clientpositive/vector_date_1.q.out
index 65711a1..5da1c8d 100644
--- a/ql/src/test/results/clientpositive/vector_date_1.q.out
+++ b/ql/src/test/results/clientpositive/vector_date_1.q.out
@@ -118,8 +118,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [0, 1, 4, 5, 6, 7, 9, 10, 11]
- selectExpressions: VectorUDFAdaptor((null or dt1 is not null))(children: IsNotNull(col 0:date) -> 3:boolean) -> 4:boolean, LongColNotEqualLongColumn(col 0:date, col 1:date) -> 5:boolean, LongColLessEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColLessLongColumn(col 0:date, col 1:date) -> 7:boolean, VectorUDFAdaptor((null or dt2 is not null))(children: IsNotNull(col 1:date) -> 8:boolean) -> 9:boolean, LongColGreaterEqualLongColumn(col 1:date, col 0:date) -> 1 [...]
+ projectedOutputColumnNums: [0, 1, 5, 6, 7, 8, 11, 12, 13]
+ selectExpressions: ScalarNullOrCol(col 4:boolean, val 0:boolean)(children: IsNotNull(col 0:date) -> 4:boolean) -> 5:boolean, LongColNotEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColLessEqualLongColumn(col 0:date, col 1:date) -> 7:boolean, LongColLessLongColumn(col 0:date, col 1:date) -> 8:boolean, ScalarNullOrCol(col 10:boolean, val 0:boolean)(children: IsNotNull(col 1:date) -> 10:boolean) -> 11:boolean, LongColGreaterEqualLongColumn(col 1:date, col 0:dat [...]
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: date)
@@ -139,14 +139,14 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: false
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
rowBatchContext:
dataColumnCount: 2
includeColumns: [0, 1]
dataColumns: dt1:date, dt2:date
partitionColumnCount: 0
- scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
+ scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
Reduce Vectorization:
enabled: false
enableConditionsMet: hive.vectorized.execution.reduce.enabled IS true
@@ -261,8 +261,8 @@ STAGE PLANS:
Select Vectorization:
className: VectorSelectOperator
native: true
- projectedOutputColumnNums: [0, 1, 4, 5, 6, 7, 9, 10, 11]
- selectExpressions: VectorUDFAdaptor((null and dt1 is null))(children: IsNull(col 0:date) -> 3:boolean) -> 4:boolean, LongColEqualLongColumn(col 0:date, col 1:date) -> 5:boolean, LongColGreaterEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColGreaterLongColumn(col 0:date, col 1:date) -> 7:boolean, VectorUDFAdaptor((null and dt2 is null))(children: IsNull(col 1:date) -> 8:boolean) -> 9:boolean, LongColLessEqualLongColumn(col 1:date, col 0:date) -> 10:boolean, L [...]
+ projectedOutputColumnNums: [0, 1, 5, 6, 7, 8, 11, 12, 13]
+ selectExpressions: ScalarNullAndCol(col 4:boolean, val 0:boolean)(children: IsNull(col 0:date) -> 4:boolean) -> 5:boolean, LongColEqualLongColumn(col 0:date, col 1:date) -> 6:boolean, LongColGreaterEqualLongColumn(col 0:date, col 1:date) -> 7:boolean, LongColGreaterLongColumn(col 0:date, col 1:date) -> 8:boolean, ScalarNullAndCol(col 10:boolean, val 0:boolean)(children: IsNull(col 1:date) -> 10:boolean) -> 11:boolean, LongColLessEqualLongColumn(col 1:date, col 0:date) - [...]
Statistics: Num rows: 3 Data size: 432 Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
key expressions: _col0 (type: date)
@@ -282,14 +282,14 @@ STAGE PLANS:
featureSupportInUse: [DECIMAL_64]
inputFileFormats: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
allNative: false
- usesVectorUDFAdaptor: true
+ usesVectorUDFAdaptor: false
vectorized: true
rowBatchContext:
dataColumnCount: 2
includeColumns: [0, 1]
dataColumns: dt1:date, dt2:date
partitionColumnCount: 0
- scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
+ scratchColumnTypeNames: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]
Reduce Vectorization:
enabled: false
enableConditionsMet: hive.vectorized.execution.reduce.enabled IS true
diff --git a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/LongColumnVector.java b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/LongColumnVector.java
index 443a076..bf42367 100644
--- a/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/LongColumnVector.java
+++ b/storage-api/src/java/org/apache/hadoop/hive/ql/exec/vector/LongColumnVector.java
@@ -214,11 +214,13 @@ public class LongColumnVector extends ColumnVector {
}
// Fill the column vector with nulls
- public void fillWithNulls() {
+ public LongColumnVector fillWithNulls() {
noNulls = false;
isRepeating = true;
vector[0] = NULL_VALUE;
isNull[0] = true;
+
+ return this;
}
// Simplify vector by brute-force flattening noNulls and isRepeating