diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java index 1a3299b..f486e9a 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java @@ -1114,8 +1114,10 @@ private VectorExpression createVectorMultiAndOrProjectionExpr(Class vectorCla } catch (Exception ex) { throw new HiveException(ex); } finally { - for (VectorExpression ve : children) { - ocm.freeOutputColumn(ve.getOutputColumn()); + if (childrenMode != VectorExpressionDescriptor.Mode.PROJECTION){ + for (VectorExpression ve : children) { + ocm.freeOutputColumn(ve.getOutputColumn()); + } } } } diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java index 48e3070..560de6f 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColAndCol.java @@ -66,18 +66,24 @@ public void evaluate(VectorizedRowBatch batch) { * We construct a simple index map to the child expression in mapToChildExpression. */ if (childExpressions != null && mapToChildExpression == null) { - // + // Some vector child expressions can be omitted (e.g. if they are existing boolean columns). mapToChildExpression = new int [colNums.length]; - int childIndex = 0; - for (int i = 0; i < childExpressions.length; i++) { - VectorExpression ve = childExpressions[i]; + Arrays.fill(mapToChildExpression, -1); + for (int c = 0; c < childExpressions.length; c++) { + VectorExpression ve = childExpressions[c]; int outputColumn = ve.getOutputColumn(); - while (outputColumn != colNums[childIndex]) { - mapToChildExpression[childIndex++] = -1; + int i = 0; + while (true) { + if (i >= colNums.length) { + throw new RuntimeException("Vectorized child expression output not found"); + } + if (colNums[i] == outputColumn) { + mapToChildExpression[i] = c; + break; + } + i++; } - mapToChildExpression[childIndex++] = i; } - Preconditions.checkState(childIndex == colNums.length); } final int n = batch.size; @@ -295,9 +301,9 @@ public void evaluate(VectorizedRowBatch batch) { Preconditions.checkState(andSel == 0); andRepeating = false; - + if (andRepeatingIsNull) { - + /* * Since andRepeatingIsNull is true, we always set intermediateNulls when building * andSel/andSelected when the next row is true. @@ -320,7 +326,7 @@ public void evaluate(VectorizedRowBatch batch) { } andRepeatingIsNull = false; } else { - + /* * Previous rounds were all true with no null child columns. Just build * andSel/andSelected when the next row is true. diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java index db33281..2c84edb 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/ColOrCol.java @@ -69,16 +69,22 @@ public void evaluate(VectorizedRowBatch batch) { if (childExpressions != null && mapToChildExpression == null) { // Some vector child expressions can be omitted (e.g. if they are existing boolean columns). mapToChildExpression = new int [colNums.length]; - int childIndex = 0; - for (int i = 0; i < childExpressions.length; i++) { - VectorExpression ve = childExpressions[i]; + Arrays.fill(mapToChildExpression, -1); + for (int c = 0; c < childExpressions.length; c++) { + VectorExpression ve = childExpressions[c]; int outputColumn = ve.getOutputColumn(); - while (outputColumn != colNums[childIndex]) { - mapToChildExpression[childIndex++] = -1; + int i = 0; + while (true) { + if (i >= colNums.length) { + throw new RuntimeException("Vectorized child expression output not found"); + } + if (colNums[i] == outputColumn) { + mapToChildExpression[i] = c; + break; + } + i++; } - mapToChildExpression[childIndex++] = i; } - Preconditions.checkState(childIndex == colNums.length); } final int n = batch.size; @@ -316,7 +322,7 @@ public void evaluate(VectorizedRowBatch batch) { Preconditions.checkState(orSel == 0); orRepeating = false; - + if (orRepeatingHasNulls) { /* @@ -346,7 +352,7 @@ public void evaluate(VectorizedRowBatch batch) { } orRepeatingHasNulls = false; } else { - + /* * Previous rounds were all false with no null child columns. Build * orSel/orSelected when the next row is false. Otherwise, when the row is true, mark @@ -379,9 +385,9 @@ public void evaluate(VectorizedRowBatch batch) { Preconditions.checkState(orSel == 0); orRepeating = false; - + if (orRepeatingHasNulls) { - + /* * Since orRepeatingIsNull is true, we always set intermediateNulls when building * orSel/orSelected when the next row is null or false. Otherwise, when the row @@ -409,7 +415,7 @@ public void evaluate(VectorizedRowBatch batch) { } orRepeatingHasNulls = false; } else { - + /* * Previous rounds were all true with no null child columns. Build * andSel/andSelected when the next row is true; also build when next is null diff --git ql/src/test/queries/clientpositive/vector_multi_and_or_projection.q ql/src/test/queries/clientpositive/vector_multi_and_or_projection.q new file mode 100644 index 0000000..5619fc4 --- /dev/null +++ ql/src/test/queries/clientpositive/vector_multi_and_or_projection.q @@ -0,0 +1,81 @@ +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, bo FROM vectortab2k; +INSERT INTO TABLE scratch VALUES (NULL, NULL, NULL, NULL, NULL); + +CREATE TABLE vectortab2k_orc STORED AS ORC AS SELECT * FROM scratch; + +SET hive.vectorized.execution.enabled=true; + +EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) as q; + +SELECT sum(hash(*)) FROM + (SELECT IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) as q; + + +SET hive.vectorized.execution.enabled=false; + +CREATE TABLE scratch_bool AS SELECT t % 4 = 0 as bool0, si % 2 = 1 as bool1, i % 5 = 3 as bool2, b % 3 = 2 as bool3, bo as bool4, true as bool5 FROM vectortab2k; +INSERT INTO TABLE scratch_bool VALUES (NULL, NULL, NULL, NULL, NULL, NULL); + +CREATE TABLE bool_orc STORED AS ORC AS SELECT * FROM scratch_bool; + +SET hive.vectorized.execution.enabled=true; + +EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) as q; + +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) as q; + + +EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q; + +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q; + + +EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q; + +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q; diff --git ql/src/test/results/clientpositive/vector_multi_and_or_projection.q.out ql/src/test/results/clientpositive/vector_multi_and_or_projection.q.out new file mode 100644 index 0000000..d6aef91 --- /dev/null +++ ql/src/test/results/clientpositive/vector_multi_and_or_projection.q.out @@ -0,0 +1,424 @@ +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, bo 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, bo FROM vectortab2k +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@vectortab2k +POSTHOOK: Output: database:default +POSTHOOK: Output: default@scratch +POSTHOOK: Lineage: scratch.b SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:b, type:bigint, comment:null), ] +POSTHOOK: Lineage: scratch.bo SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:bo, type:boolean, comment:null), ] +POSTHOOK: Lineage: scratch.i SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:i, type:int, comment:null), ] +POSTHOOK: Lineage: scratch.si SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:si, type:smallint, comment:null), ] +POSTHOOK: Lineage: scratch.t SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:t, type:tinyint, comment:null), ] +t si i b bo +PREHOOK: query: INSERT INTO TABLE scratch VALUES (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) +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.bo 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 +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 +POSTHOOK: Lineage: vectortab2k_orc.b SIMPLE [(scratch)scratch.FieldSchema(name:b, type:bigint, comment:null), ] +POSTHOOK: Lineage: vectortab2k_orc.bo SIMPLE [(scratch)scratch.FieldSchema(name:bo, type:boolean, comment:null), ] +POSTHOOK: Lineage: vectortab2k_orc.i SIMPLE [(scratch)scratch.FieldSchema(name:i, type:int, comment:null), ] +POSTHOOK: Lineage: vectortab2k_orc.si SIMPLE [(scratch)scratch.FieldSchema(name:si, type:smallint, comment:null), ] +POSTHOOK: Lineage: vectortab2k_orc.t SIMPLE [(scratch)scratch.FieldSchema(name:t, type:tinyint, comment:null), ] +scratch.t scratch.si scratch.i scratch.b scratch.bo +PREHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) as q +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) 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: 45620 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: if(((t < 0) or (si > 0)), t, if(((b > 0) or bo), (UDFToInteger(t) * 2), (UDFToInteger(t) * 3))) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 2001 Data size: 45620 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: int) + sort order: + + Statistics: Num rows: 2001 Data size: 45620 Basic stats: COMPLETE Column stats: NONE + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: hash(KEY.reducesinkkey0) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 2001 Data size: 45620 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.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + 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 IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) as q +PREHOOK: type: QUERY +PREHOOK: Input: default@vectortab2k_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT sum(hash(*)) FROM + (SELECT IF(((t < 0) OR (si > 0)),t,IF(((b > 0) OR (bo)),t*2,t*3)) AS `if_expr` FROM vectortab2k_orc + order by if_expr) as q +POSTHOOK: type: QUERY +POSTHOOK: Input: default@vectortab2k_orc +#### A masked pattern was here #### +c0 +40782 +PREHOOK: query: CREATE TABLE scratch_bool AS SELECT t % 4 = 0 as bool0, si % 2 = 1 as bool1, i % 5 = 3 as bool2, b % 3 = 2 as bool3, bo as bool4, true as bool5 FROM vectortab2k +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@vectortab2k +PREHOOK: Output: database:default +PREHOOK: Output: default@scratch_bool +POSTHOOK: query: CREATE TABLE scratch_bool AS SELECT t % 4 = 0 as bool0, si % 2 = 1 as bool1, i % 5 = 3 as bool2, b % 3 = 2 as bool3, bo as bool4, true as bool5 FROM vectortab2k +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@vectortab2k +POSTHOOK: Output: database:default +POSTHOOK: Output: default@scratch_bool +POSTHOOK: Lineage: scratch_bool.bool0 EXPRESSION [(vectortab2k)vectortab2k.FieldSchema(name:t, type:tinyint, comment:null), ] +POSTHOOK: Lineage: scratch_bool.bool1 EXPRESSION [(vectortab2k)vectortab2k.FieldSchema(name:si, type:smallint, comment:null), ] +POSTHOOK: Lineage: scratch_bool.bool2 EXPRESSION [(vectortab2k)vectortab2k.FieldSchema(name:i, type:int, comment:null), ] +POSTHOOK: Lineage: scratch_bool.bool3 EXPRESSION [(vectortab2k)vectortab2k.FieldSchema(name:b, type:bigint, comment:null), ] +POSTHOOK: Lineage: scratch_bool.bool4 SIMPLE [(vectortab2k)vectortab2k.FieldSchema(name:bo, type:boolean, comment:null), ] +POSTHOOK: Lineage: scratch_bool.bool5 SIMPLE [] +bool0 bool1 bool2 bool3 bool4 bool5 +PREHOOK: query: INSERT INTO TABLE scratch_bool VALUES (NULL, NULL, NULL, NULL, NULL, NULL) +PREHOOK: type: QUERY +PREHOOK: Input: default@values__tmp__table__2 +PREHOOK: Output: default@scratch_bool +POSTHOOK: query: INSERT INTO TABLE scratch_bool VALUES (NULL, NULL, NULL, NULL, NULL, NULL) +POSTHOOK: type: QUERY +POSTHOOK: Input: default@values__tmp__table__2 +POSTHOOK: Output: default@scratch_bool +POSTHOOK: Lineage: scratch_bool.bool0 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ] +POSTHOOK: Lineage: scratch_bool.bool1 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col2, type:string, comment:), ] +POSTHOOK: Lineage: scratch_bool.bool2 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col3, type:string, comment:), ] +POSTHOOK: Lineage: scratch_bool.bool3 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col4, type:string, comment:), ] +POSTHOOK: Lineage: scratch_bool.bool4 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col5, type:string, comment:), ] +POSTHOOK: Lineage: scratch_bool.bool5 EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col6, type:string, comment:), ] +_col0 _col1 _col2 _col3 _col4 _col5 +PREHOOK: query: CREATE TABLE bool_orc STORED AS ORC AS SELECT * FROM scratch_bool +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: default@scratch_bool +PREHOOK: Output: database:default +PREHOOK: Output: default@bool_orc +POSTHOOK: query: CREATE TABLE bool_orc STORED AS ORC AS SELECT * FROM scratch_bool +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: default@scratch_bool +POSTHOOK: Output: database:default +POSTHOOK: Output: default@bool_orc +POSTHOOK: Lineage: bool_orc.bool0 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool0, type:boolean, comment:null), ] +POSTHOOK: Lineage: bool_orc.bool1 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool1, type:boolean, comment:null), ] +POSTHOOK: Lineage: bool_orc.bool2 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool2, type:boolean, comment:null), ] +POSTHOOK: Lineage: bool_orc.bool3 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool3, type:boolean, comment:null), ] +POSTHOOK: Lineage: bool_orc.bool4 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool4, type:boolean, comment:null), ] +POSTHOOK: Lineage: bool_orc.bool5 SIMPLE [(scratch_bool)scratch_bool.FieldSchema(name:bool5, type:boolean, comment:null), ] +scratch_bool.bool0 scratch_bool.bool1 scratch_bool.bool2 scratch_bool.bool3 scratch_bool.bool4 scratch_bool.bool5 +PREHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) as q +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) 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: bool_orc + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: bool0 (type: boolean), (not bool0) (type: boolean), bool1 (type: boolean), (not bool1) (type: boolean), ((bool0 and (not bool1)) or (bool1 and (not bool0))) (type: boolean) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: boolean), _col2 (type: boolean) + sort order: ++ + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + value expressions: _col1 (type: boolean), _col3 (type: boolean), _col4 (type: boolean) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: hash(KEY.reducesinkkey0,VALUE._col0,KEY.reducesinkkey1,VALUE._col1,VALUE._col2) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 2001 Data size: 45952 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.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + 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 bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) as q +PREHOOK: type: QUERY +PREHOOK: Input: default@bool_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT sum(hash(*)) FROM + (SELECT bool0, not bool0 as not_bool0, bool1, not bool1 as not_bool1, ((bool0 and (not bool1)) or (bool1 and (not bool0))) as multi_and_or_col from bool_orc + order by bool0, bool1) as q +POSTHOOK: type: QUERY +POSTHOOK: Input: default@bool_orc +#### A masked pattern was here #### +c0 +483512482 +PREHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) 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: bool_orc + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: bool0 (type: boolean), (not bool1) (type: boolean), bool2 (type: boolean), (not bool3) (type: boolean), ((bool0 and (not bool1)) or (bool2 and (not bool3))) (type: boolean) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: boolean), _col1 (type: boolean), _col2 (type: boolean), _col3 (type: boolean) + sort order: ++++ + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: boolean) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: hash(KEY.reducesinkkey0,KEY.reducesinkkey1,KEY.reducesinkkey2,KEY.reducesinkkey3,VALUE._col0) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 2001 Data size: 45952 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.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + 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 bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +PREHOOK: type: QUERY +PREHOOK: Input: default@bool_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +POSTHOOK: type: QUERY +POSTHOOK: Input: default@bool_orc +#### A masked pattern was here #### +c0 +483274719 +PREHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN +SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) 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: bool_orc + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: bool0 (type: boolean), (not bool1) (type: boolean), bool2 (type: boolean), (not bool3) (type: boolean), ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) (type: boolean) + outputColumnNames: _col0, _col1, _col2, _col3, _col4 + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: _col0 (type: boolean), _col1 (type: boolean), _col2 (type: boolean), _col3 (type: boolean) + sort order: ++++ + Statistics: Num rows: 2001 Data size: 45952 Basic stats: COMPLETE Column stats: NONE + value expressions: _col4 (type: boolean) + Execution mode: vectorized + Reduce Operator Tree: + Select Operator + expressions: hash(KEY.reducesinkkey0,KEY.reducesinkkey1,KEY.reducesinkkey2,KEY.reducesinkkey3,VALUE._col0) (type: int) + outputColumnNames: _col0 + Statistics: Num rows: 2001 Data size: 45952 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.SequenceFileInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat + 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 bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +PREHOOK: type: QUERY +PREHOOK: Input: default@bool_orc +#### A masked pattern was here #### +POSTHOOK: query: SELECT sum(hash(*)) FROM + (SELECT bool0, not bool1 as not_bool1, bool2, not bool3 as not_bool3, ((bool0 and (not bool1)) or (bool2 and (not bool3)) or (bool2 and (not bool5))) as multi_and_or_col from bool_orc + order by bool0, not_bool1, bool2, not_bool3) as q +POSTHOOK: type: QUERY +POSTHOOK: Input: default@bool_orc +#### A masked pattern was here #### +c0 +483274719