You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2017/02/01 01:46:42 UTC

[7/7] hive git commit: HIVE-15703 : HiveSubQRemoveRelBuilder should use Hive's own factories (Vineet Garg via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan

HIVE-15703 : HiveSubQRemoveRelBuilder should use Hive's own factories (Vineet Garg via Ashutosh Chauhan)
Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


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

Branch: refs/heads/master
Commit: 4becd689d59ee3f75a36119fbb950c44e16c65df
Parents: 6c54551
Author: Vineet Garg <vg...@hortonworks.com>
Authored: Tue Jan 31 17:45:49 2017 -0800
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Tue Jan 31 17:45:49 2017 -0800

----------------------------------------------------------------------
 .../calcite/HiveSubQRemoveRelBuilder.java       |  12 +-
 .../rules/HiveReduceExpressionsRule.java        |   8 +
 .../calcite/rules/HiveSubQueryRemoveRule.java   |   6 +-
 .../clientpositive/constant_prop_3.q.out        |  34 +-
 .../llap/dynamic_partition_pruning.q.out        | 157 +++--
 .../clientpositive/llap/explainuser_1.q.out     | 270 ++++----
 .../results/clientpositive/llap/lineage3.q.out  |   4 +-
 .../clientpositive/llap/subquery_in.q.out       | 504 ++++++++------
 .../clientpositive/llap/subquery_multi.q.out    | 488 ++++++++------
 .../clientpositive/llap/subquery_notin.q.out    | 664 ++++++++++---------
 .../clientpositive/llap/subquery_null_agg.q.out |  24 +-
 .../clientpositive/llap/subquery_scalar.q.out   | 117 ++--
 .../llap/vector_groupby_mapjoin.q.out           |  38 +-
 .../llap/vector_mapjoin_reduce.q.out            |   4 +-
 .../vectorized_dynamic_partition_pruning.q.out  | 157 +++--
 .../results/clientpositive/perf/query14.q.out   |  10 +-
 .../results/clientpositive/perf/query23.q.out   |   4 +-
 .../results/clientpositive/perf/query33.q.out   |  12 +-
 .../results/clientpositive/perf/query56.q.out   |  12 +-
 .../results/clientpositive/perf/query60.q.out   |  12 +-
 .../results/clientpositive/perf/query70.q.out   |   4 +-
 .../results/clientpositive/perf/query83.q.out   | 504 +++++++-------
 .../test/results/clientpositive/semijoin4.q.out |  89 ++-
 .../test/results/clientpositive/semijoin5.q.out |  44 +-
 .../clientpositive/spark/subquery_in.q.out      | 464 +++++++------
 .../spark/vector_mapjoin_reduce.q.out           |   4 +-
 .../subq_where_serialization.q.out              |  22 +-
 .../clientpositive/subquery_in_having.q.out     | 228 ++++---
 .../clientpositive/subquery_notin_having.q.out  | 100 +--
 .../clientpositive/vector_groupby_mapjoin.q.out |  36 +-
 .../clientpositive/vector_mapjoin_reduce.q.out  |   4 +-
 31 files changed, 2177 insertions(+), 1859 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java
index e4f3057..3a1897f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java
@@ -145,25 +145,25 @@ public class HiveSubQRemoveRelBuilder {
     }
     this.aggregateFactory =
             Util.first(context.unwrap(RelFactories.AggregateFactory.class),
-                    RelFactories.DEFAULT_AGGREGATE_FACTORY);
+                    HiveRelFactories.HIVE_AGGREGATE_FACTORY);
     this.filterFactory =
             Util.first(context.unwrap(RelFactories.FilterFactory.class),
                     HiveRelFactories.HIVE_FILTER_FACTORY);
     this.projectFactory =
             Util.first(context.unwrap(RelFactories.ProjectFactory.class),
-                    RelFactories.DEFAULT_PROJECT_FACTORY);
+                    HiveRelFactories.HIVE_PROJECT_FACTORY);
     this.sortFactory =
             Util.first(context.unwrap(RelFactories.SortFactory.class),
-                    RelFactories.DEFAULT_SORT_FACTORY);
+                    HiveRelFactories.HIVE_SORT_FACTORY);
     this.setOpFactory =
             Util.first(context.unwrap(RelFactories.SetOpFactory.class),
-                    RelFactories.DEFAULT_SET_OP_FACTORY);
+                    HiveRelFactories.HIVE_SET_OP_FACTORY);
     this.joinFactory =
             Util.first(context.unwrap(RelFactories.JoinFactory.class),
-                    RelFactories.DEFAULT_JOIN_FACTORY);
+                    HiveRelFactories.HIVE_JOIN_FACTORY);
     this.semiJoinFactory =
             Util.first(context.unwrap(RelFactories.SemiJoinFactory.class),
-                    RelFactories.DEFAULT_SEMI_JOIN_FACTORY);
+                    HiveRelFactories.HIVE_SEMI_JOIN_FACTORY);
     this.correlateFactory =
             Util.first(context.unwrap(RelFactories.CorrelateFactory.class),
                     RelFactories.DEFAULT_CORRELATE_FACTORY);

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java
index a1b5aeb..6efc731 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveReduceExpressionsRule.java
@@ -29,6 +29,7 @@ import org.apache.calcite.rex.RexInputRef;
 import org.apache.calcite.rex.RexNode;
 import org.apache.calcite.rex.RexUtil;
 import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.calcite.tools.RelBuilder;
 import org.apache.calcite.tools.RelBuilderFactory;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelFactories;
@@ -136,6 +137,13 @@ public abstract class HiveReduceExpressionsRule extends ReduceExpressionsRule {
             newConditionExp)) {
           newConditionExp = ((RexCall) newConditionExp).getOperands().get(0);
         }
+        // reduce might end up creating an expression with null type
+        // e.g condition(null = null) is reduced to condition (null) with null type
+        // since this is a condition which will always be boolean type we cast it to
+        // boolean type
+        if(newConditionExp.getType().getSqlTypeName() == SqlTypeName.NULL) {
+          newConditionExp = call.builder().cast(newConditionExp, SqlTypeName.BOOLEAN);
+        }
         call.transformTo(call.builder().
             push(filter.getInput()).filter(newConditionExp).build());
       } else {

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
index ffe569a..c1768f4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
@@ -312,14 +312,14 @@ public abstract class HiveSubQueryRemoveRule extends RelOptRule{
                 switch (logic) {
                     case TRUE:
                         if (fields.isEmpty()) {
-                            builder.project(builder.alias(builder.literal(true), "i"));
+                            builder.project(builder.alias(builder.literal(true), "i" + e.rel.getId()));
                             builder.aggregate(builder.groupKey(0));
                         } else {
                             builder.aggregate(builder.groupKey(fields));
                         }
                         break;
                     default:
-                        fields.add(builder.alias(builder.literal(true), "i"));
+                        fields.add(builder.alias(builder.literal(true), "i" + e.rel.getId()));
                         builder.project(fields);
                         builder.distinct();
                 }
@@ -359,7 +359,7 @@ public abstract class HiveSubQueryRemoveRule extends RelOptRule{
                         operands.add((builder.isNull(builder.field("ct", "c"))), builder.literal(false));
                         break;
                 }
-                operands.add(builder.isNotNull(builder.field("dt", "i")),
+                operands.add(builder.isNotNull(builder.field("dt", "i" + e.rel.getId())),
                         builder.literal(true));
                 if (!keyIsNulls.isEmpty()) {
                     //Calcite creates null literal with Null type here but because HIVE doesn't support null type

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/test/results/clientpositive/constant_prop_3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/constant_prop_3.q.out b/ql/src/test/results/clientpositive/constant_prop_3.q.out
index 066ed07..ecf6e57 100644
--- a/ql/src/test/results/clientpositive/constant_prop_3.q.out
+++ b/ql/src/test/results/clientpositive/constant_prop_3.q.out
@@ -88,7 +88,7 @@ POSTHOOK: query: analyze table supplier_hive compute statistics for columns
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@supplier_hive
 #### A masked pattern was here ####
-Warning: Shuffle Join JOIN[26][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[25][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select
 	p_brand,
 	p_type,
@@ -378,30 +378,34 @@ STAGE PLANS:
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: s_suppkey (type: int)
-                outputColumnNames: _col0
+                outputColumnNames: s_suppkey
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Group By Operator
-                  keys: _col0 (type: int), true (type: boolean)
+                  keys: s_suppkey (type: int)
                   mode: hash
-                  outputColumnNames: _col0, _col1
+                  outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: boolean)
-                    sort order: ++
-                    Map-reduce partition columns: _col0 (type: int), _col1 (type: boolean)
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: int)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
       Reduce Operator Tree:
         Group By Operator
-          keys: KEY._col0 (type: int), KEY._col1 (type: boolean)
+          keys: KEY._col0 (type: int)
           mode: mergepartial
-          outputColumnNames: _col0, _col1
+          outputColumnNames: _col0
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-          File Output Operator
-            compressed: false
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          Select Operator
+            expressions: _col0 (type: int), true (type: boolean)
+            outputColumnNames: _col0, _col1
+            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+            File Output Operator
+              compressed: false
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/test/results/clientpositive/llap/dynamic_partition_pruning.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/dynamic_partition_pruning.q.out b/ql/src/test/results/clientpositive/llap/dynamic_partition_pruning.q.out
index e2310d7..1b6bb1f 100644
--- a/ql/src/test/results/clientpositive/llap/dynamic_partition_pruning.q.out
+++ b/ql/src/test/results/clientpositive/llap/dynamic_partition_pruning.q.out
@@ -3324,6 +3324,7 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
+                  filterExpr: ds is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 389248 Basic stats: COMPLETE Column stats: COMPLETE
                   Select Operator
                     expressions: ds (type: string)
@@ -3418,16 +3419,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Reducer 7 
             Execution mode: llap
             Reduce Operator Tree:
@@ -3464,16 +3468,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Union 6 
             Vertex: Union 6
 
@@ -3524,6 +3531,7 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
+                  filterExpr: ds is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 389248 Basic stats: COMPLETE Column stats: COMPLETE
                   Select Operator
                     expressions: ds (type: string)
@@ -3620,16 +3628,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Reducer 7 
             Execution mode: llap
             Reduce Operator Tree:
@@ -3666,16 +3677,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Union 6 
             Vertex: Union 6
 
@@ -3728,6 +3742,7 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
+                  filterExpr: ds is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 389248 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     keys: ds (type: string)
@@ -3765,6 +3780,7 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
+                  filterExpr: ds is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 389248 Basic stats: COMPLETE Column stats: COMPLETE
                   Group By Operator
                     keys: ds (type: string)
@@ -3849,16 +3865,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Reducer 2 
             Execution mode: llap
             Reduce Operator Tree:
@@ -3911,16 +3930,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Union 3 
             Vertex: Union 3
         Union 9 
@@ -5665,6 +5687,7 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
+                  filterExpr: ds is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 389248 Basic stats: COMPLETE Column stats: COMPLETE
                   Select Operator
                     expressions: ds (type: string)
@@ -5725,16 +5748,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Reducer 5 
             Execution mode: llap
             Reduce Operator Tree:
@@ -5786,16 +5812,19 @@ STAGE PLANS:
                 mode: mergepartial
                 outputColumnNames: _col0
                 Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                Group By Operator
-                  keys: _col0 (type: string)
-                  mode: hash
-                  outputColumnNames: _col0
+                Filter Operator
+                  predicate: _col0 is not null (type: boolean)
                   Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
+                  Group By Operator
+                    keys: _col0 (type: string)
+                    mode: hash
+                    outputColumnNames: _col0
                     Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
+                      Statistics: Num rows: 1 Data size: 184 Basic stats: COMPLETE Column stats: COMPLETE
         Union 4 
             Vertex: Union 4
 

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
index b9489eb..c3f8071 100644
--- a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
@@ -2139,29 +2139,31 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 2 llap
-      File Output Operator [FS_13]
-        Merge Join Operator [MERGEJOIN_18] (rows=168 width=178)
-          Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col0","_col1"]
+      File Output Operator [FS_14]
+        Merge Join Operator [MERGEJOIN_19] (rows=166 width=178)
+          Conds:RS_10._col0=RS_11._col0(Inner),Output:["_col0","_col1"]
         <-Map 1 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_9]
+          SHUFFLE [RS_10]
             PartitionCols:_col0
-            Select Operator [SEL_1] (rows=500 width=178)
+            Select Operator [SEL_2] (rows=166 width=178)
               Output:["_col0","_col1"]
-              TableScan [TS_0] (rows=500 width=178)
-                default@src_cbo,src_cbo,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+              Filter Operator [FIL_17] (rows=166 width=178)
+                predicate:(key > '9')
+                TableScan [TS_0] (rows=500 width=178)
+                  default@src_cbo,src_cbo,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
         <-Reducer 4 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_10]
+          SHUFFLE [RS_11]
             PartitionCols:_col0
-            Group By Operator [GBY_7] (rows=69 width=87)
+            Group By Operator [GBY_8] (rows=69 width=87)
               Output:["_col0"],keys:KEY._col0
             <-Map 3 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_6]
+              SHUFFLE [RS_7]
                 PartitionCols:_col0
-                Group By Operator [GBY_5] (rows=69 width=87)
+                Group By Operator [GBY_6] (rows=69 width=87)
                   Output:["_col0"],keys:key
-                  Filter Operator [FIL_17] (rows=166 width=87)
+                  Filter Operator [FIL_18] (rows=166 width=87)
                     predicate:(key > '9')
-                    TableScan [TS_2] (rows=500 width=87)
+                    TableScan [TS_3] (rows=500 width=87)
                       default@src_cbo,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
 
 PREHOOK: query: explain select p.p_partkey, li.l_suppkey 
@@ -2308,65 +2310,71 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 4 llap
-      File Output Operator [FS_33]
-        Merge Join Operator [MERGEJOIN_46] (rows=34 width=186)
-          Conds:RS_29._col2=RS_30._col0(Inner),Output:["_col0","_col1","_col2"]
+      File Output Operator [FS_36]
+        Merge Join Operator [MERGEJOIN_49] (rows=34 width=186)
+          Conds:RS_32._col2=RS_33._col0(Inner),Output:["_col0","_col1","_col2"]
         <-Reducer 3 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_29]
+          SHUFFLE [RS_32]
             PartitionCols:_col2
-            Group By Operator [GBY_15] (rows=84 width=186)
-              Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
-            <-Reducer 2 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_14]
-                PartitionCols:_col0, _col1
-                Group By Operator [GBY_13] (rows=84 width=186)
-                  Output:["_col0","_col1","_col2"],aggregations:["count()"],keys:_col0, _col1
-                  Merge Join Operator [MERGEJOIN_45] (rows=168 width=178)
-                    Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col0","_col1"]
-                  <-Map 1 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_9]
-                      PartitionCols:_col0
-                      Select Operator [SEL_1] (rows=500 width=178)
-                        Output:["_col0","_col1"]
-                        TableScan [TS_0] (rows=500 width=178)
-                          default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                  <-Reducer 6 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_10]
-                      PartitionCols:_col0
-                      Group By Operator [GBY_7] (rows=69 width=87)
-                        Output:["_col0"],keys:KEY._col0
-                      <-Map 5 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_6]
-                          PartitionCols:_col0
-                          Group By Operator [GBY_5] (rows=69 width=87)
-                            Output:["_col0"],keys:key
-                            Filter Operator [FIL_41] (rows=166 width=87)
-                              predicate:(key > '8')
-                              TableScan [TS_2] (rows=500 width=87)
-                                default@src_cbo,src_cbo,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+            Filter Operator [FIL_42] (rows=83 width=186)
+              predicate:_col2 is not null
+              Group By Operator [GBY_16] (rows=83 width=186)
+                Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)"],keys:KEY._col0, KEY._col1
+              <-Reducer 2 [SIMPLE_EDGE] llap
+                SHUFFLE [RS_15]
+                  PartitionCols:_col0, _col1
+                  Group By Operator [GBY_14] (rows=83 width=186)
+                    Output:["_col0","_col1","_col2"],aggregations:["count()"],keys:_col0, _col1
+                    Merge Join Operator [MERGEJOIN_48] (rows=166 width=178)
+                      Conds:RS_10._col0=RS_11._col0(Inner),Output:["_col0","_col1"]
+                    <-Map 1 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_10]
+                        PartitionCols:_col0
+                        Select Operator [SEL_2] (rows=166 width=178)
+                          Output:["_col0","_col1"]
+                          Filter Operator [FIL_43] (rows=166 width=178)
+                            predicate:(key > '8')
+                            TableScan [TS_0] (rows=500 width=178)
+                              default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                    <-Reducer 6 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_11]
+                        PartitionCols:_col0
+                        Group By Operator [GBY_8] (rows=69 width=87)
+                          Output:["_col0"],keys:KEY._col0
+                        <-Map 5 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_7]
+                            PartitionCols:_col0
+                            Group By Operator [GBY_6] (rows=69 width=87)
+                              Output:["_col0"],keys:key
+                              Filter Operator [FIL_44] (rows=166 width=87)
+                                predicate:(key > '8')
+                                TableScan [TS_3] (rows=500 width=87)
+                                  default@src_cbo,src_cbo,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
         <-Reducer 9 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_30]
+          SHUFFLE [RS_33]
             PartitionCols:_col0
-            Group By Operator [GBY_27] (rows=34 width=8)
+            Group By Operator [GBY_30] (rows=34 width=8)
               Output:["_col0"],keys:KEY._col0
             <-Reducer 8 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_26]
+              SHUFFLE [RS_29]
                 PartitionCols:_col0
-                Group By Operator [GBY_25] (rows=34 width=8)
+                Group By Operator [GBY_28] (rows=34 width=8)
                   Output:["_col0"],keys:_col1
-                  Select Operator [SEL_44] (rows=69 width=8)
-                    Output:["_col1"]
-                    Group By Operator [GBY_22] (rows=69 width=95)
-                      Output:["_col0","_col1"],aggregations:["count(VALUE._col0)"],keys:KEY._col0
-                    <-Map 7 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_21]
-                        PartitionCols:_col0
-                        Group By Operator [GBY_20] (rows=69 width=95)
-                          Output:["_col0","_col1"],aggregations:["count()"],keys:key
-                          Filter Operator [FIL_43] (rows=166 width=87)
-                            predicate:(key > '9')
-                            TableScan [TS_17] (rows=500 width=87)
-                              default@src_cbo,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+                  Filter Operator [FIL_45] (rows=69 width=8)
+                    predicate:_col1 is not null
+                    Select Operator [SEL_47] (rows=69 width=8)
+                      Output:["_col1"]
+                      Group By Operator [GBY_24] (rows=69 width=95)
+                        Output:["_col0","_col1"],aggregations:["count(VALUE._col0)"],keys:KEY._col0
+                      <-Map 7 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_23]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_22] (rows=69 width=95)
+                            Output:["_col0","_col1"],aggregations:["count()"],keys:key
+                            Filter Operator [FIL_46] (rows=166 width=87)
+                              predicate:(key > '9')
+                              TableScan [TS_19] (rows=500 width=87)
+                                default@src_cbo,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
 
 PREHOOK: query: explain select p_mfgr, p_name, avg(p_size) 
 from part 
@@ -2393,44 +2401,48 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 3 llap
-      File Output Operator [FS_21]
-        Merge Join Operator [MERGEJOIN_26] (rows=6 width=227)
-          Conds:RS_17._col1=RS_18._col0(Inner),Output:["_col0","_col1","_col2"]
+      File Output Operator [FS_23]
+        Merge Join Operator [MERGEJOIN_28] (rows=6 width=227)
+          Conds:RS_19._col1=RS_20._col0(Inner),Output:["_col0","_col1","_col2"]
         <-Reducer 2 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_17]
+          SHUFFLE [RS_19]
             PartitionCols:_col1
-            Select Operator [SEL_5] (rows=13 width=227)
+            Select Operator [SEL_6] (rows=13 width=227)
               Output:["_col0","_col1","_col2"]
-              Group By Operator [GBY_4] (rows=13 width=227)
+              Group By Operator [GBY_5] (rows=13 width=227)
                 Output:["_col0","_col1","_col2"],aggregations:["avg(VALUE._col0)"],keys:KEY._col0, KEY._col1
               <-Map 1 [SIMPLE_EDGE] llap
-                SHUFFLE [RS_3]
+                SHUFFLE [RS_4]
                   PartitionCols:_col0, _col1
-                  Group By Operator [GBY_2] (rows=13 width=295)
+                  Group By Operator [GBY_3] (rows=13 width=295)
                     Output:["_col0","_col1","_col2"],aggregations:["avg(p_size)"],keys:p_name, p_mfgr
-                    TableScan [TS_0] (rows=26 width=223)
-                      default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
+                    Filter Operator [FIL_26] (rows=26 width=223)
+                      predicate:p_name is not null
+                      TableScan [TS_0] (rows=26 width=223)
+                        default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
         <-Reducer 6 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_18]
+          SHUFFLE [RS_20]
             PartitionCols:_col0
-            Group By Operator [GBY_15] (rows=13 width=184)
+            Group By Operator [GBY_17] (rows=13 width=184)
               Output:["_col0"],keys:KEY._col0
             <-Reducer 5 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_14]
+              SHUFFLE [RS_16]
                 PartitionCols:_col0
-                Group By Operator [GBY_13] (rows=13 width=184)
+                Group By Operator [GBY_15] (rows=13 width=184)
                   Output:["_col0"],keys:_col0
-                  Select Operator [SEL_10] (rows=26 width=491)
+                  Select Operator [SEL_11] (rows=26 width=491)
                     Output:["_col0"]
-                    PTF Operator [PTF_9] (rows=26 width=491)
-                      Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5 ASC NULLS FIRST","partition by:":"_col2"}]
-                      Select Operator [SEL_8] (rows=26 width=491)
-                        Output:["_col1","_col2","_col5"]
-                      <-Map 4 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_7]
-                          PartitionCols:p_mfgr
-                          TableScan [TS_6] (rows=26 width=223)
-                            default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_name","p_size"]
+                    Filter Operator [FIL_27] (rows=26 width=491)
+                      predicate:first_value_window_0 is not null
+                      PTF Operator [PTF_10] (rows=26 width=491)
+                        Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col5 ASC NULLS FIRST","partition by:":"_col2"}]
+                        Select Operator [SEL_9] (rows=26 width=491)
+                          Output:["_col1","_col2","_col5"]
+                        <-Map 4 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_8]
+                            PartitionCols:p_mfgr
+                            TableScan [TS_7] (rows=26 width=223)
+                              default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_name","p_size"]
 
 PREHOOK: query: explain select * 
 from src_cbo 
@@ -2460,53 +2472,53 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 4 llap
-      File Output Operator [FS_27]
-        Select Operator [SEL_26] (rows=500 width=178)
+      File Output Operator [FS_26]
+        Select Operator [SEL_25] (rows=500 width=178)
           Output:["_col0","_col1"]
         <-Reducer 3 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_25]
-            Select Operator [SEL_24] (rows=500 width=178)
+          SHUFFLE [RS_24]
+            Select Operator [SEL_23] (rows=500 width=178)
               Output:["_col0","_col1"]
-              Filter Operator [FIL_23] (rows=500 width=198)
+              Filter Operator [FIL_22] (rows=500 width=198)
                 predicate:((_col2 = 0) or (_col5 is null and _col0 is not null and (_col3 >= _col2)))
-                Merge Join Operator [MERGEJOIN_32] (rows=500 width=198)
-                  Conds:RS_20._col0=RS_21._col0(Left Outer),Output:["_col0","_col1","_col2","_col3","_col5"]
+                Merge Join Operator [MERGEJOIN_31] (rows=500 width=198)
+                  Conds:RS_19._col0=RS_20._col0(Left Outer),Output:["_col0","_col1","_col2","_col3","_col5"]
                 <-Reducer 2 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_20]
+                  SHUFFLE [RS_19]
                     PartitionCols:_col0
-                    Merge Join Operator [MERGEJOIN_31] (rows=500 width=194)
+                    Merge Join Operator [MERGEJOIN_30] (rows=500 width=194)
                       Conds:(Inner),Output:["_col0","_col1","_col2","_col3"]
                     <-Map 1 [CUSTOM_SIMPLE_EDGE] llap
-                      PARTITION_ONLY_SHUFFLE [RS_17]
+                      PARTITION_ONLY_SHUFFLE [RS_16]
                         Select Operator [SEL_1] (rows=500 width=178)
                           Output:["_col0","_col1"]
                           TableScan [TS_0] (rows=500 width=178)
                             default@src_cbo,src_cbo,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
                     <-Reducer 6 [CUSTOM_SIMPLE_EDGE] llap
-                      PARTITION_ONLY_SHUFFLE [RS_18]
+                      PARTITION_ONLY_SHUFFLE [RS_17]
                         Group By Operator [GBY_7] (rows=1 width=16)
                           Output:["_col0","_col1"],aggregations:["count(VALUE._col0)","count(VALUE._col1)"]
                         <-Map 5 [CUSTOM_SIMPLE_EDGE] llap
                           PARTITION_ONLY_SHUFFLE [RS_6]
                             Group By Operator [GBY_5] (rows=1 width=16)
                               Output:["_col0","_col1"],aggregations:["count()","count(key)"]
-                              Filter Operator [FIL_29] (rows=166 width=87)
+                              Filter Operator [FIL_28] (rows=166 width=87)
                                 predicate:(key > '2')
                                 TableScan [TS_2] (rows=500 width=87)
                                   default@src_cbo,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
                 <-Reducer 8 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_21]
+                  SHUFFLE [RS_20]
                     PartitionCols:_col0
-                    Group By Operator [GBY_15] (rows=69 width=91)
-                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                    <-Map 7 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_14]
-                        PartitionCols:_col0, _col1
-                        Group By Operator [GBY_13] (rows=69 width=91)
-                          Output:["_col0","_col1"],keys:_col0, true
-                          Select Operator [SEL_11] (rows=166 width=87)
-                            Output:["_col0"]
-                            Filter Operator [FIL_30] (rows=166 width=87)
+                    Select Operator [SEL_15] (rows=69 width=91)
+                      Output:["_col0","_col1"]
+                      Group By Operator [GBY_14] (rows=69 width=87)
+                        Output:["_col0"],keys:KEY._col0
+                      <-Map 7 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_13]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_12] (rows=69 width=87)
+                            Output:["_col0"],keys:key
+                            Filter Operator [FIL_29] (rows=166 width=87)
                               predicate:(key > '2')
                               TableScan [TS_9] (rows=500 width=87)
                                 default@src_cbo,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
@@ -2723,23 +2735,25 @@ Stage-0
                 <-Reducer 9 [SIMPLE_EDGE] llap
                   SHUFFLE [RS_30]
                     PartitionCols:_col0
-                    Group By Operator [GBY_24] (rows=1 width=12)
-                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                    <-Reducer 8 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_23]
-                        PartitionCols:_col0, _col1
-                        Group By Operator [GBY_22] (rows=1 width=12)
-                          Output:["_col0","_col1"],keys:_col0, true
-                          Group By Operator [GBY_19] (rows=1 width=8)
-                            Output:["_col0"],aggregations:["avg(VALUE._col0)"]
-                          <-Map 7 [CUSTOM_SIMPLE_EDGE] llap
-                            PARTITION_ONLY_SHUFFLE [RS_18]
-                              Group By Operator [GBY_17] (rows=1 width=76)
-                                Output:["_col0"],aggregations:["avg(p_size)"]
-                                Filter Operator [FIL_40] (rows=8 width=4)
-                                  predicate:(p_size < 10)
-                                  TableScan [TS_14] (rows=26 width=4)
-                                    default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_size"]
+                    Select Operator [SEL_25] (rows=1 width=12)
+                      Output:["_col0","_col1"]
+                      Group By Operator [GBY_24] (rows=1 width=8)
+                        Output:["_col0"],keys:KEY._col0
+                      <-Reducer 8 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_23]
+                          PartitionCols:_col0
+                          Group By Operator [GBY_22] (rows=1 width=8)
+                            Output:["_col0"],keys:_col0
+                            Group By Operator [GBY_19] (rows=1 width=8)
+                              Output:["_col0"],aggregations:["avg(VALUE._col0)"]
+                            <-Map 7 [CUSTOM_SIMPLE_EDGE] llap
+                              PARTITION_ONLY_SHUFFLE [RS_18]
+                                Group By Operator [GBY_17] (rows=1 width=76)
+                                  Output:["_col0"],aggregations:["avg(p_size)"]
+                                  Filter Operator [FIL_40] (rows=8 width=4)
+                                    predicate:(p_size < 10)
+                                    TableScan [TS_14] (rows=26 width=4)
+                                      default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_size"]
 
 PREHOOK: query: explain select b.p_mfgr, min(p_retailprice) 
 from part b 

http://git-wip-us.apache.org/repos/asf/hive/blob/4becd689/ql/src/test/results/clientpositive/llap/lineage3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/lineage3.q.out b/ql/src/test/results/clientpositive/llap/lineage3.q.out
index 04ae206..f092967 100644
--- a/ql/src/test/results/clientpositive/llap/lineage3.q.out
+++ b/ql/src/test/results/clientpositive/llap/lineage3.q.out
@@ -166,7 +166,7 @@ where key in (select key+18 from src1) order by key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
-{"version":"1.0","engine":"tez","database":"default","hash":"8b9d63653e36ecf4dd425d3cc3de9199","queryText":"select key, value from src1\nwhere key in (select key+18 from src1) order by key","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"(UDFToDouble(src1.key) = (UDFToDouble(src1.key) + 18.0))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
+{"version":"1.0","engine":"tez","database":"default","hash":"8b9d63653e36ecf4dd425d3cc3de9199","queryText":"select key, value from src1\nwhere key in (select key+18 from src1) order by key","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"src1.key is not null","edgeType":"PREDICATE"},{"sources":[2],"targets":[0,1],"expression":"(UDFToDouble(src1.key) = (UDFToDouble(src1.key) + 18.0))","edgeType":"PREDICATE"},{"sources":[2],"targets":[0,1],"expression":"(UDFToDouble(src1.key) + 18.0) is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
 146	val_146
 273	val_273
 PREHOOK: query: select * from src1 a
@@ -186,7 +186,7 @@ where key not in (select key+18 from src1) order by key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
-{"version":"1.0","engine":"tez","database":"default","hash":"9b488fe1d7cf018aad3825173808cd36","queryText":"select key, value from src1\nwhere key not in (select key+18 from src1) order by key","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"(UDFToDouble(src1.key) = (UDFToDouble(src1.key) + 18.0))","edgeType":"PREDICATE"},{"sources":[4,2],"targets":[0,1],"expression":"((count(*) = 0) or (i is null and src1.key is not null and (count((UDFToDouble(src1.key) + 18.0)) >= count(*))))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":4,"vertexType":"TABLE","vertexId":"default.src1"}]}
+{"version":"1.0","engine":"tez","database":"default","hash":"9b488fe1d7cf018aad3825173808cd36","queryText":"select key, value from src1\nwhere key not in (select key+18 from src1) order by key","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"(UDFToDouble(src1.key) = (UDFToDouble(src1.key) + 18.0))","edgeType":"PREDICATE"},{"sources":[4,2],"targets":[0,1],"expression":"((count(*) = 0) or (true is null and src1.key is not null and (count((UDFToDouble(src1.key) + 18.0)) >= count(*))))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"key"},{"id":1,"vertexType":"COLUMN","vertexId":"value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"},{"id":4,"vertexType":"TABLE","vertexId":"default.src1"}]}
 PREHOOK: query: select * from src1 a
 where not exists
   (select cint from alltypesorc b