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-13310: Vectorized Projection Comparison Number Column to Scalar broken for !noNulls and selectedInUse (Matt McCline, reviewed by Gopal Vijayaraghavan)
Date Sun, 10 Apr 2016 06:29:05 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.0 f5879840d -> 4571712d5


HIVE-13310: Vectorized Projection Comparison Number Column to Scalar broken for !noNulls and selectedInUse (Matt McCline, reviewed by Gopal Vijayaraghavan)


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

Branch: refs/heads/branch-2.0
Commit: 4571712d5d643dd445a617d2d60ca7a83154e60d
Parents: f587984
Author: Matt McCline <mmccline@hortonworks.com>
Authored: Sat Apr 9 23:28:48 2016 -0700
Committer: Matt McCline <mmccline@hortonworks.com>
Committed: Sat Apr 9 23:28:48 2016 -0700

----------------------------------------------------------------------
 .../expressions/LongColEqualLongScalar.java     |   2 +-
 .../LongColGreaterEqualLongScalar.java          |   2 +-
 .../expressions/LongColGreaterLongScalar.java   |   2 +-
 .../expressions/LongColLessEqualLongScalar.java |   2 +-
 .../expressions/LongColLessLongScalar.java      |   2 +-
 .../expressions/LongColNotEqualLongScalar.java  |   2 +-
 .../expressions/LongScalarEqualLongColumn.java  |   2 +-
 .../LongScalarGreaterEqualLongColumn.java       |   2 +-
 .../LongScalarGreaterLongColumn.java            |   2 +-
 .../LongScalarLessEqualLongColumn.java          |   2 +-
 .../expressions/LongScalarLessLongColumn.java   |   2 +-
 .../LongScalarNotEqualLongColumn.java           |   2 +-
 .../vector_number_compare_projection.q          | 192 ++++++
 .../vector_number_compare_projection.q.out      | 662 +++++++++++++++++++
 14 files changed, 866 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColEqualLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColEqualLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColEqualLongScalar.java
index caacf3d..be717a1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColEqualLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColEqualLongScalar.java
@@ -91,10 +91,10 @@ public class LongColEqualLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] == value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterEqualLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterEqualLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterEqualLongScalar.java
index 433162c..cd8d723 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterEqualLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterEqualLongScalar.java
@@ -91,10 +91,10 @@ public class LongColGreaterEqualLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] >= value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterLongScalar.java
index 088b265..16148f3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColGreaterLongScalar.java
@@ -91,10 +91,10 @@ public class LongColGreaterLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] > value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessEqualLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessEqualLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessEqualLongScalar.java
index 42bd807..927856f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessEqualLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessEqualLongScalar.java
@@ -91,10 +91,10 @@ public class LongColLessEqualLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] <= value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessLongScalar.java
index 67fb47e..ac10a83 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColLessLongScalar.java
@@ -91,10 +91,10 @@ public class LongColLessLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] < value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColNotEqualLongScalar.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColNotEqualLongScalar.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColNotEqualLongScalar.java
index 5352186..789ca3e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColNotEqualLongScalar.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongColNotEqualLongScalar.java
@@ -91,10 +91,10 @@ public class LongColNotEqualLongScalar extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = vector[i] != value ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarEqualLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarEqualLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarEqualLongColumn.java
index 98fd0e8..09d845c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarEqualLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarEqualLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarEqualLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value == vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterEqualLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterEqualLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterEqualLongColumn.java
index 12a1c7f..afc80eb 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterEqualLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterEqualLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarGreaterEqualLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value >= vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterLongColumn.java
index 1fe2ec3..e2e871d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarGreaterLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarGreaterLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value > vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessEqualLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessEqualLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessEqualLongColumn.java
index af3a4ab..ae675ed 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessEqualLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessEqualLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarLessEqualLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value <= vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessLongColumn.java
index 0963367..c664e35 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarLessLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarLessLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value < vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarNotEqualLongColumn.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarNotEqualLongColumn.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarNotEqualLongColumn.java
index 33ad3c2..776ab9f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarNotEqualLongColumn.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/LongScalarNotEqualLongColumn.java
@@ -91,10 +91,10 @@ public class LongScalarNotEqualLongColumn extends VectorExpression {
         }
         outputColVector.isRepeating = true;
       } else if (batch.selectedInUse) {
-        System.arraycopy(nullPos, 0, outNulls, 0, n);
         for(int j=0; j != n; j++) {
           int i = sel[j];
           outputVector[i] = value != vector[i] ? 1 : 0;
+          outNulls[i] = nullPos[i];
         }
       } else {
         System.arraycopy(nullPos, 0, outNulls, 0, n);

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/test/queries/clientpositive/vector_number_compare_projection.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/vector_number_compare_projection.q b/ql/src/test/queries/clientpositive/vector_number_compare_projection.q
new file mode 100644
index 0000000..feb5e98
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/vector_number_compare_projection.q
@@ -0,0 +1,192 @@
+set hive.cli.print.header=true;
+set hive.explain.user=false;
+SET hive.auto.convert.join=true;
+set hive.fetch.task.conversion=none;
+set hive.mapred.mode=nonstrict;
+
+-- SORT_QUERY_RESULTS
+
+create table vectortab2k(
+            t tinyint,
+            si smallint,
+            i int,
+            b bigint,
+            f float,
+            d double,
+            dc decimal(38,18),
+            bo boolean,
+            s string,
+            s2 string,
+            ts timestamp,
+            ts2 timestamp,
+            dt date)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
+STORED AS TEXTFILE;
+
+LOAD DATA LOCAL INPATH '../../data/files/vectortab2k' OVERWRITE INTO TABLE vectortab2k;
+
+CREATE TABLE scratch AS SELECT t, si, i, b, f, d, dc FROM vectortab2k;
+INSERT INTO TABLE scratch VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+CREATE TABLE vectortab2k_orc STORED AS ORC AS SELECT * FROM scratch;
+
+SET hive.vectorized.execution.enabled=true;
+
+--
+-- Projection LongCol<Compare>LongScalar
+--
+EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q;
+
+EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q;
+
+
+--
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        order by t, si, i) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q;
+
+SET hive.vectorized.execution.enabled=false;
+
+CREATE TABLE scratch_repeat AS SELECT t, si, i, b, bo, 20 as t_repeat,
+     9000 as si_repeat, 9233320 as i_repeat, -823823999339992 as b_repeat, false as bo_repeat_false, true as bo_repeat_true FROM vectortab2k;
+
+-- The repeated columns ought to create repeated VectorizedRowBatch for those columns.
+-- And then when we do a comparison, we should generate a repeated boolean result.
+CREATE TABLE vectortab2k_orc_repeat STORED AS ORC AS SELECT * FROM scratch_repeat;
+
+SET hive.vectorized.execution.enabled=true;
+
+--
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+--
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q;
+
+SET hive.vectorized.execution.enabled=false;
+
+CREATE TABLE scratch_null AS SELECT t, si, i, b, bo,
+     cast(null as tinyint) as t_null, cast(null as smallint) as si_null, cast(null as int) as i_null, cast(null as bigint) as b_null, cast(null as boolean) as bo_null FROM vectortab2k;
+
+-- The nulled columns ought to create repeated null VectorizedRowBatch for those columns.
+CREATE TABLE vectortab2k_orc_null STORED AS ORC AS SELECT * FROM scratch_null;
+
+SET hive.vectorized.execution.enabled=true;
+
+--
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q;
+
+--
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q;
+
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q;
+
+-- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q;
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/4571712d/ql/src/test/results/clientpositive/vector_number_compare_projection.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_number_compare_projection.q.out b/ql/src/test/results/clientpositive/vector_number_compare_projection.q.out
new file mode 100644
index 0000000..1be01c8
--- /dev/null
+++ b/ql/src/test/results/clientpositive/vector_number_compare_projection.q.out
@@ -0,0 +1,662 @@
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+create table vectortab2k(
+            t tinyint,
+            si smallint,
+            i int,
+            b bigint,
+            f float,
+            d double,
+            dc decimal(38,18),
+            bo boolean,
+            s string,
+            s2 string,
+            ts timestamp,
+            ts2 timestamp,
+            dt date)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
+STORED AS TEXTFILE
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@vectortab2k
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+create table vectortab2k(
+            t tinyint,
+            si smallint,
+            i int,
+            b bigint,
+            f float,
+            d double,
+            dc decimal(38,18),
+            bo boolean,
+            s string,
+            s2 string,
+            ts timestamp,
+            ts2 timestamp,
+            dt date)
+ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
+STORED AS TEXTFILE
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@vectortab2k
+PREHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/vectortab2k' OVERWRITE INTO TABLE vectortab2k
+PREHOOK: type: LOAD
+#### A masked pattern was here ####
+PREHOOK: Output: default@vectortab2k
+POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/vectortab2k' OVERWRITE INTO TABLE vectortab2k
+POSTHOOK: type: LOAD
+#### A masked pattern was here ####
+POSTHOOK: Output: default@vectortab2k
+PREHOOK: query: CREATE TABLE scratch AS SELECT t, si, i, b, f, d, dc FROM vectortab2k
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@vectortab2k
+PREHOOK: Output: database:default
+PREHOOK: Output: default@scratch
+POSTHOOK: query: CREATE TABLE scratch AS SELECT t, si, i, b, f, d, dc FROM vectortab2k
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@vectortab2k
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@scratch
+t	si	i	b	f	d	dc
+PREHOOK: query: INSERT INTO TABLE scratch VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@scratch
+POSTHOOK: query: INSERT INTO TABLE scratch VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@scratch
+POSTHOOK: Lineage: scratch.b EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col4, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.d EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col6, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.dc EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col7, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.f EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col5, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.i EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col3, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.si EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col2, type:string, comment:), ]
+POSTHOOK: Lineage: scratch.t EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+_col0	_col1	_col2	_col3	_col4	_col5	_col6
+PREHOOK: query: CREATE TABLE vectortab2k_orc STORED AS ORC AS SELECT * FROM scratch
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@scratch
+PREHOOK: Output: database:default
+PREHOOK: Output: default@vectortab2k_orc
+POSTHOOK: query: CREATE TABLE vectortab2k_orc STORED AS ORC AS SELECT * FROM scratch
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@scratch
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@vectortab2k_orc
+scratch.t	scratch.si	scratch.i	scratch.b	scratch.f	scratch.d	scratch.dc
+PREHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+PREHOOK: type: QUERY
+POSTHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+POSTHOOK: type: QUERY
+Explain
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: vectortab2k_orc
+            Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: t (type: tinyint), si (type: smallint), i (type: int), (t < 0) (type: boolean), (si <= 0) (type: boolean), (i = 0) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+              Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: tinyint), _col1 (type: smallint), _col2 (type: int)
+                sort order: +++
+                Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col3 (type: boolean), _col4 (type: boolean), _col5 (type: boolean)
+      Execution mode: vectorized
+      Reduce Operator Tree:
+        Select Operator
+          expressions: hash(KEY.reducesinkkey0,KEY.reducesinkkey1,KEY.reducesinkkey2,VALUE._col0,VALUE._col1,VALUE._col2) (type: int)
+          outputColumnNames: _col0
+          Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+          Group By Operator
+            aggregations: sum(_col0)
+            mode: complete
+            outputColumnNames: _col0
+            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+-3601806268
+PREHOOK: query: EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+POSTHOOK: type: QUERY
+Explain
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: vectortab2k_orc
+            Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: t (type: tinyint), si (type: smallint), i (type: int), b (type: bigint), (t > 0) (type: boolean), (si >= 0) (type: boolean), (i <> 0) (type: boolean), (b > 0) (type: boolean)
+              outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+              Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: tinyint), _col1 (type: smallint), _col2 (type: int), _col3 (type: bigint)
+                sort order: ++++
+                Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col4 (type: boolean), _col5 (type: boolean), _col6 (type: boolean), _col7 (type: boolean)
+      Execution mode: vectorized
+      Reduce Operator Tree:
+        Select Operator
+          expressions: hash(KEY.reducesinkkey0,KEY.reducesinkkey1,KEY.reducesinkkey2,KEY.reducesinkkey3,VALUE._col0,VALUE._col1,VALUE._col2,VALUE._col3) (type: int)
+          outputColumnNames: _col0
+          Statistics: Num rows: 2001 Data size: 273608 Basic stats: COMPLETE Column stats: NONE
+          Group By Operator
+            aggregations: sum(_col0)
+            mode: complete
+            outputColumnNames: _col0
+            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+24462176095
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (t < 0) as compare1, (si <= 0) as compare2, (i = 0) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+62396741790
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (t > 0) as compare1, (si >= 0) as compare2, (i != 0) as compare3, (b > 0) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+14122059922
+PREHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        order by t, si, i) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+-3601796069
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        order by t, si, i, b) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+20166891877
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, (0 < t) as compare1, (0 <= si) as compare2, (0 = i) as compare3 from vectortab2k_orc
+        where pmod(t, 4) > 1
+        order by t, si, i) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+62396748920
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t, si, i, b, (0 > t) as compare1, (0 >= si) as compare2, (0 != i) as compare3, (0 > b) as compare4 from vectortab2k_orc
+        where pmod(t, 4) < 2
+        order by t, si, i, b) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc
+#### A masked pattern was here ####
+c0
+14121946175
+PREHOOK: query: CREATE TABLE scratch_repeat AS SELECT t, si, i, b, bo, 20 as t_repeat,
+     9000 as si_repeat, 9233320 as i_repeat, -823823999339992 as b_repeat, false as bo_repeat_false, true as bo_repeat_true FROM vectortab2k
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@vectortab2k
+PREHOOK: Output: database:default
+PREHOOK: Output: default@scratch_repeat
+POSTHOOK: query: CREATE TABLE scratch_repeat AS SELECT t, si, i, b, bo, 20 as t_repeat,
+     9000 as si_repeat, 9233320 as i_repeat, -823823999339992 as b_repeat, false as bo_repeat_false, true as bo_repeat_true FROM vectortab2k
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@vectortab2k
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@scratch_repeat
+t	si	i	b	bo	t_repeat	si_repeat	i_repeat	b_repeat	bo_repeat_false	bo_repeat_true
+PREHOOK: query: -- The repeated columns ought to create repeated VectorizedRowBatch for those columns.
+-- And then when we do a comparison, we should generate a repeated boolean result.
+CREATE TABLE vectortab2k_orc_repeat STORED AS ORC AS SELECT * FROM scratch_repeat
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@scratch_repeat
+PREHOOK: Output: database:default
+PREHOOK: Output: default@vectortab2k_orc_repeat
+POSTHOOK: query: -- The repeated columns ought to create repeated VectorizedRowBatch for those columns.
+-- And then when we do a comparison, we should generate a repeated boolean result.
+CREATE TABLE vectortab2k_orc_repeat STORED AS ORC AS SELECT * FROM scratch_repeat
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@scratch_repeat
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@vectortab2k_orc_repeat
+scratch_repeat.t	scratch_repeat.si	scratch_repeat.i	scratch_repeat.b	scratch_repeat.bo	scratch_repeat.t_repeat	scratch_repeat.si_repeat	scratch_repeat.i_repeat	scratch_repeat.b_repeat	scratch_repeat.bo_repeat_false	scratch_repeat.bo_repeat_true
+PREHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+972535192000
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+972533210000
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat > 0) as compare1, (si_repeat >= 0) as compare2, (i_repeat = 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+231949643292
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (t_repeat < 0) as compare1, (si_repeat <=0) as compare2, (i_repeat != 0) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+235353036820
+PREHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+972533208000
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+972535194000
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 > t_repeat) as compare1, (0 >= si_repeat) as compare2, (0 = i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 0
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+231949170108
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_repeat, si_repeat, i_repeat, (0 < t_repeat) as compare1, (0 <= si_repeat) as compare2, (0 != i_repeat) as compare3 from vectortab2k_orc_repeat
+        where pmod(si, 4) = 3
+        order by t_repeat, si_repeat, i_repeat) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_repeat
+#### A masked pattern was here ####
+c0
+235353516948
+PREHOOK: query: CREATE TABLE scratch_null AS SELECT t, si, i, b, bo,
+     cast(null as tinyint) as t_null, cast(null as smallint) as si_null, cast(null as int) as i_null, cast(null as bigint) as b_null, cast(null as boolean) as bo_null FROM vectortab2k
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@vectortab2k
+PREHOOK: Output: database:default
+PREHOOK: Output: default@scratch_null
+POSTHOOK: query: CREATE TABLE scratch_null AS SELECT t, si, i, b, bo,
+     cast(null as tinyint) as t_null, cast(null as smallint) as si_null, cast(null as int) as i_null, cast(null as bigint) as b_null, cast(null as boolean) as bo_null FROM vectortab2k
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@vectortab2k
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@scratch_null
+t	si	i	b	bo	t_null	si_null	i_null	b_null	bo_null
+PREHOOK: query: -- The nulled columns ought to create repeated null VectorizedRowBatch for those columns.
+CREATE TABLE vectortab2k_orc_null STORED AS ORC AS SELECT * FROM scratch_null
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@scratch_null
+PREHOOK: Output: database:default
+PREHOOK: Output: default@vectortab2k_orc_null
+POSTHOOK: query: -- The nulled columns ought to create repeated null VectorizedRowBatch for those columns.
+CREATE TABLE vectortab2k_orc_null STORED AS ORC AS SELECT * FROM scratch_null
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@scratch_null
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@vectortab2k_orc_null
+scratch_null.t	scratch_null.si	scratch_null.i	scratch_null.b	scratch_null.bo	scratch_null.t_null	scratch_null.si_null	scratch_null.i_null	scratch_null.b_null	scratch_null.bo_null
+PREHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: --
+-- Projection LongCol<Compare>LongScalar
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null > 0) as compare1, (si_null >= 0) as compare2, (i_null = 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (t_null < 0) as compare1, (si_null <=0) as compare2, (i_null != 0) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: --
+-- Projection LongScalar<Compare>LongColumn
+--
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: -- With some filtering
+SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 > t_null) as compare1, (0 >= si_null) as compare2, (0 = i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 0
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0
+PREHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q
+PREHOOK: type: QUERY
+PREHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT sum(hash(*)) FROM
+    (SELECT t_null, si_null, i_null, (0 < t_null) as compare1, (0 <= si_null) as compare2, (0 != i_null) as compare3 from vectortab2k_orc_null
+        where pmod(si, 4) = 3
+        order by t_null, si_null, i_null) as q
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@vectortab2k_orc_null
+#### A masked pattern was here ####
+c0
+0


Mime
View raw message