You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2015/12/21 02:18:08 UTC

[01/15] hive git commit: HIVE-11531: Add mysql-style LIMIT support to Hive, or improve ROW_NUMBER performance-wise (Hui Zheng, reviewed by Sergey Shelukhin, Jesus Camacho Rodriguez)

Repository: hive
Updated Branches:
  refs/heads/branch-2.0 a59d4ff2b -> 827ff37f2


http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/results/clientpositive/offset_limit_ppd_optimizer.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/offset_limit_ppd_optimizer.q.out b/ql/src/test/results/clientpositive/offset_limit_ppd_optimizer.q.out
new file mode 100644
index 0000000..facb26c
--- /dev/null
+++ b/ql/src/test/results/clientpositive/offset_limit_ppd_optimizer.q.out
@@ -0,0 +1,1377 @@
+PREHOOK: query: explain
+select key,value from src order by key limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select key,value from src order by key limit 10,20
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 0.3
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select key,value from src order by key limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select key,value from src order by key limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+105	val_105
+11	val_11
+111	val_111
+113	val_113
+113	val_113
+114	val_114
+116	val_116
+118	val_118
+118	val_118
+119	val_119
+119	val_119
+119	val_119
+12	val_12
+12	val_12
+120	val_120
+120	val_120
+125	val_125
+125	val_125
+126	val_126
+128	val_128
+PREHOOK: query: explain
+select key,value from src order by key desc limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select key,value from src order by key desc limit 10,20
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: -
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 0.3
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select key,value from src order by key desc limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select key,value from src order by key desc limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+90	val_90
+9	val_9
+87	val_87
+86	val_86
+85	val_85
+84	val_84
+84	val_84
+83	val_83
+83	val_83
+82	val_82
+80	val_80
+8	val_8
+78	val_78
+77	val_77
+76	val_76
+76	val_76
+74	val_74
+72	val_72
+72	val_72
+70	val_70
+PREHOOK: query: explain
+select value, sum(key + 1) as sum from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select value, sum(key + 1) as sum from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: value (type: string), key (type: string)
+              outputColumnNames: value, key
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: sum((key + 1))
+                keys: value (type: string)
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.3
+                  value expressions: _col1 (type: double)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: sum(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select value, sum(key + 1) as sum from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select value, sum(key + 1) as sum from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+val_116	117.0
+val_118	238.0
+val_119	360.0
+val_12	26.0
+val_120	242.0
+val_125	252.0
+val_126	127.0
+val_128	387.0
+val_129	260.0
+val_131	132.0
+val_133	134.0
+val_134	270.0
+val_136	137.0
+val_137	276.0
+val_138	556.0
+val_143	144.0
+val_145	146.0
+val_146	294.0
+val_149	300.0
+val_15	32.0
+PREHOOK: query: -- deduped RS
+explain
+select value,avg(key + 1) from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: -- deduped RS
+explain
+select value,avg(key + 1) from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: value (type: string), key (type: string)
+              outputColumnNames: value, key
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: avg((key + 1))
+                keys: value (type: string)
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.3
+                  value expressions: _col1 (type: struct<count:bigint,sum:double,input:double>)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: avg(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select value,avg(key + 1) from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select value,avg(key + 1) from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+val_116	117.0
+val_118	119.0
+val_119	120.0
+val_12	13.0
+val_120	121.0
+val_125	126.0
+val_126	127.0
+val_128	129.0
+val_129	130.0
+val_131	132.0
+val_133	134.0
+val_134	135.0
+val_136	137.0
+val_137	138.0
+val_138	139.0
+val_143	144.0
+val_145	146.0
+val_146	147.0
+val_149	150.0
+val_15	16.0
+PREHOOK: query: -- distincts
+explain
+select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: -- distincts
+explain
+select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: cdouble (type: double)
+              outputColumnNames: cdouble
+              Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                keys: cdouble (type: double)
+                mode: hash
+                outputColumnNames: _col0
+                Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: double)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: double)
+                  Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.3
+      Reduce Operator Tree:
+        Group By Operator
+          keys: KEY._col0 (type: double)
+          mode: mergepartial
+          outputColumnNames: _col0
+          Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 4300 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 4300 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-16309.0
+-16307.0
+-16306.0
+-16305.0
+-16300.0
+-16296.0
+-16280.0
+-16277.0
+-16274.0
+-16269.0
+-16243.0
+-16236.0
+-16227.0
+-16225.0
+-16221.0
+-16218.0
+-16217.0
+-16211.0
+-16208.0
+-16207.0
+PREHOOK: query: explain
+select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: ctinyint (type: tinyint), cdouble (type: double)
+              outputColumnNames: ctinyint, cdouble
+              Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: count(DISTINCT cdouble)
+                keys: ctinyint (type: tinyint), cdouble (type: double)
+                mode: hash
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: tinyint), _col1 (type: double)
+                  sort order: ++
+                  Map-reduce partition columns: _col0 (type: tinyint)
+                  Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.3
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(DISTINCT KEY._col1:0._col0)
+          keys: KEY._col0 (type: tinyint)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 4300 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 4300 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-55	29
+-54	26
+-53	22
+-52	33
+-51	21
+-50	30
+-49	26
+-48	29
+-47	22
+-46	24
+-45	24
+-44	24
+-43	30
+-42	17
+-41	24
+-40	26
+-39	22
+-38	31
+-37	20
+-36	26
+PREHOOK: query: explain
+select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: ctinyint (type: tinyint), cdouble (type: double)
+              outputColumnNames: ctinyint, cdouble
+              Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                keys: ctinyint (type: tinyint), cdouble (type: double)
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: tinyint), _col1 (type: double)
+                  sort order: ++
+                  Map-reduce partition columns: _col0 (type: tinyint)
+                  Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+      Reduce Operator Tree:
+        Group By Operator
+          keys: KEY._col0 (type: tinyint), KEY._col1 (type: double)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+          Group By Operator
+            aggregations: count(_col1)
+            keys: _col0 (type: tinyint)
+            mode: complete
+            outputColumnNames: _col0, _col1
+            Statistics: Num rows: 3072 Data size: 660491 Basic stats: COMPLETE Column stats: NONE
+            Limit
+              Number of rows: 20
+              Offset of rows: 10
+              Statistics: Num rows: 20 Data size: 4300 Basic stats: COMPLETE Column stats: NONE
+              File Output Operator
+                compressed: false
+                Statistics: Num rows: 20 Data size: 4300 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-55	29
+-54	26
+-53	22
+-52	33
+-51	21
+-50	30
+-49	26
+-48	29
+-47	22
+-46	24
+-45	24
+-44	24
+-43	30
+-42	17
+-41	24
+-40	26
+-39	22
+-38	31
+-37	20
+-36	26
+PREHOOK: query: -- multi distinct
+explain
+select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: -- multi distinct
+explain
+select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: ctinyint (type: tinyint), cstring1 (type: string), cstring2 (type: string)
+              outputColumnNames: ctinyint, cstring1, cstring2
+              Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: count(DISTINCT cstring1), count(DISTINCT cstring2)
+                keys: ctinyint (type: tinyint), cstring1 (type: string), cstring2 (type: string)
+                mode: hash
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: tinyint), _col1 (type: string), _col2 (type: string)
+                  sort order: +++
+                  Map-reduce partition columns: _col0 (type: tinyint)
+                  Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.3
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(DISTINCT KEY._col1:0._col0), count(DISTINCT KEY._col1:1._col0)
+          keys: KEY._col0 (type: tinyint)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1, _col2
+          Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 4300 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 4300 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-55	3	21
+-54	3	21
+-53	3	17
+-52	3	21
+-51	1012	1045
+-50	3	25
+-49	3	24
+-48	3	27
+-47	3	23
+-46	3	19
+-45	3	24
+-44	3	31
+-43	3	26
+-42	3	22
+-41	3	29
+-40	3	25
+-39	3	30
+-38	3	19
+-37	3	27
+-36	3	18
+PREHOOK: query: -- limit zero
+explain
+select key,value from src order by key limit 0,0
+PREHOOK: type: QUERY
+POSTHOOK: query: -- limit zero
+explain
+select key,value from src order by key limit 0,0
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+    Fetch Operator
+      limit: 0
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select key,value from src order by key limit 0,0
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select key,value from src order by key limit 0,0
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+PREHOOK: query: -- 2MR (applied to last RS)
+explain
+select value, sum(key) as sum from src group by value order by sum limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: -- 2MR (applied to last RS)
+explain
+select value, sum(key) as sum from src group by value order by sum limit 10,20
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: value (type: string), key (type: string)
+              outputColumnNames: value, key
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: sum(key)
+                keys: value (type: string)
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: double)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: sum(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: double)
+              sort order: +
+              Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 0.3
+              value expressions: _col0 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), KEY.reducesinkkey0 (type: double)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select value, sum(key) as sum from src group by value order by sum limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select value, sum(key) as sum from src group by value order by sum limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+val_20	20.0
+val_12	24.0
+val_27	27.0
+val_28	28.0
+val_15	30.0
+val_30	30.0
+val_33	33.0
+val_34	34.0
+val_18	36.0
+val_41	41.0
+val_43	43.0
+val_44	44.0
+val_47	47.0
+val_24	48.0
+val_26	52.0
+val_53	53.0
+val_54	54.0
+val_57	57.0
+val_64	64.0
+val_65	65.0
+PREHOOK: query: -- map aggregation disabled
+explain
+select value, sum(key) as sum from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+POSTHOOK: query: -- map aggregation disabled
+explain
+select value, sum(key) as sum from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: key, value
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: value (type: string)
+                sort order: +
+                Map-reduce partition columns: value (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 0.3
+                value expressions: key (type: string)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: sum(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: complete
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 20 Data size: 200 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: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select value, sum(key) as sum from src group by value order by value limit 10,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select value, sum(key) as sum from src group by value order by value limit 10,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+val_116	116.0
+val_118	236.0
+val_119	357.0
+val_12	24.0
+val_120	240.0
+val_125	250.0
+val_126	126.0
+val_128	384.0
+val_129	258.0
+val_131	131.0
+val_133	133.0
+val_134	268.0
+val_136	136.0
+val_137	274.0
+val_138	552.0
+val_143	143.0
+val_145	145.0
+val_146	292.0
+val_149	298.0
+val_15	30.0
+PREHOOK: query: -- flush for order-by
+explain
+select key,value,value,value,value,value,value,value,value from src order by key limit 30,70
+PREHOOK: type: QUERY
+POSTHOOK: query: -- flush for order-by
+explain
+select key,value,value,value,value,value,value,value,value from src order by key limit 30,70
+POSTHOOK: type: QUERY
+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: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 2.0E-5
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string), VALUE._col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7, _col8
+          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 70
+            Offset of rows: 30
+            Statistics: Num rows: 70 Data size: 700 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 70 Data size: 700 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: 70
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select key,value,value,value,value,value,value,value,value from src order by key limit 30,70
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select key,value,value,value,value,value,value,value,value from src order by key limit 30,70
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+128	val_128	val_128	val_128	val_128	val_128	val_128	val_128	val_128
+128	val_128	val_128	val_128	val_128	val_128	val_128	val_128	val_128
+129	val_129	val_129	val_129	val_129	val_129	val_129	val_129	val_129
+129	val_129	val_129	val_129	val_129	val_129	val_129	val_129	val_129
+131	val_131	val_131	val_131	val_131	val_131	val_131	val_131	val_131
+133	val_133	val_133	val_133	val_133	val_133	val_133	val_133	val_133
+134	val_134	val_134	val_134	val_134	val_134	val_134	val_134	val_134
+134	val_134	val_134	val_134	val_134	val_134	val_134	val_134	val_134
+136	val_136	val_136	val_136	val_136	val_136	val_136	val_136	val_136
+137	val_137	val_137	val_137	val_137	val_137	val_137	val_137	val_137
+137	val_137	val_137	val_137	val_137	val_137	val_137	val_137	val_137
+138	val_138	val_138	val_138	val_138	val_138	val_138	val_138	val_138
+138	val_138	val_138	val_138	val_138	val_138	val_138	val_138	val_138
+138	val_138	val_138	val_138	val_138	val_138	val_138	val_138	val_138
+138	val_138	val_138	val_138	val_138	val_138	val_138	val_138	val_138
+143	val_143	val_143	val_143	val_143	val_143	val_143	val_143	val_143
+145	val_145	val_145	val_145	val_145	val_145	val_145	val_145	val_145
+146	val_146	val_146	val_146	val_146	val_146	val_146	val_146	val_146
+146	val_146	val_146	val_146	val_146	val_146	val_146	val_146	val_146
+149	val_149	val_149	val_149	val_149	val_149	val_149	val_149	val_149
+149	val_149	val_149	val_149	val_149	val_149	val_149	val_149	val_149
+15	val_15	val_15	val_15	val_15	val_15	val_15	val_15	val_15
+15	val_15	val_15	val_15	val_15	val_15	val_15	val_15	val_15
+150	val_150	val_150	val_150	val_150	val_150	val_150	val_150	val_150
+152	val_152	val_152	val_152	val_152	val_152	val_152	val_152	val_152
+152	val_152	val_152	val_152	val_152	val_152	val_152	val_152	val_152
+153	val_153	val_153	val_153	val_153	val_153	val_153	val_153	val_153
+155	val_155	val_155	val_155	val_155	val_155	val_155	val_155	val_155
+156	val_156	val_156	val_156	val_156	val_156	val_156	val_156	val_156
+157	val_157	val_157	val_157	val_157	val_157	val_157	val_157	val_157
+158	val_158	val_158	val_158	val_158	val_158	val_158	val_158	val_158
+160	val_160	val_160	val_160	val_160	val_160	val_160	val_160	val_160
+162	val_162	val_162	val_162	val_162	val_162	val_162	val_162	val_162
+163	val_163	val_163	val_163	val_163	val_163	val_163	val_163	val_163
+164	val_164	val_164	val_164	val_164	val_164	val_164	val_164	val_164
+164	val_164	val_164	val_164	val_164	val_164	val_164	val_164	val_164
+165	val_165	val_165	val_165	val_165	val_165	val_165	val_165	val_165
+165	val_165	val_165	val_165	val_165	val_165	val_165	val_165	val_165
+166	val_166	val_166	val_166	val_166	val_166	val_166	val_166	val_166
+167	val_167	val_167	val_167	val_167	val_167	val_167	val_167	val_167
+167	val_167	val_167	val_167	val_167	val_167	val_167	val_167	val_167
+167	val_167	val_167	val_167	val_167	val_167	val_167	val_167	val_167
+168	val_168	val_168	val_168	val_168	val_168	val_168	val_168	val_168
+169	val_169	val_169	val_169	val_169	val_169	val_169	val_169	val_169
+169	val_169	val_169	val_169	val_169	val_169	val_169	val_169	val_169
+169	val_169	val_169	val_169	val_169	val_169	val_169	val_169	val_169
+169	val_169	val_169	val_169	val_169	val_169	val_169	val_169	val_169
+17	val_17	val_17	val_17	val_17	val_17	val_17	val_17	val_17
+170	val_170	val_170	val_170	val_170	val_170	val_170	val_170	val_170
+172	val_172	val_172	val_172	val_172	val_172	val_172	val_172	val_172
+172	val_172	val_172	val_172	val_172	val_172	val_172	val_172	val_172
+174	val_174	val_174	val_174	val_174	val_174	val_174	val_174	val_174
+174	val_174	val_174	val_174	val_174	val_174	val_174	val_174	val_174
+175	val_175	val_175	val_175	val_175	val_175	val_175	val_175	val_175
+175	val_175	val_175	val_175	val_175	val_175	val_175	val_175	val_175
+176	val_176	val_176	val_176	val_176	val_176	val_176	val_176	val_176
+176	val_176	val_176	val_176	val_176	val_176	val_176	val_176	val_176
+177	val_177	val_177	val_177	val_177	val_177	val_177	val_177	val_177
+178	val_178	val_178	val_178	val_178	val_178	val_178	val_178	val_178
+179	val_179	val_179	val_179	val_179	val_179	val_179	val_179	val_179
+179	val_179	val_179	val_179	val_179	val_179	val_179	val_179	val_179
+18	val_18	val_18	val_18	val_18	val_18	val_18	val_18	val_18
+18	val_18	val_18	val_18	val_18	val_18	val_18	val_18	val_18
+180	val_180	val_180	val_180	val_180	val_180	val_180	val_180	val_180
+181	val_181	val_181	val_181	val_181	val_181	val_181	val_181	val_181
+183	val_183	val_183	val_183	val_183	val_183	val_183	val_183	val_183
+186	val_186	val_186	val_186	val_186	val_186	val_186	val_186	val_186
+187	val_187	val_187	val_187	val_187	val_187	val_187	val_187	val_187
+187	val_187	val_187	val_187	val_187	val_187	val_187	val_187	val_187
+187	val_187	val_187	val_187	val_187	val_187	val_187	val_187	val_187
+PREHOOK: query: -- flush for group-by
+explain
+select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70
+PREHOOK: type: QUERY
+POSTHOOK: query: -- flush for group-by
+explain
+select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: key, value
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: concat(key, value, value, value, value, value, value, value, value, value) (type: string)
+                sort order: +
+                Map-reduce partition columns: concat(key, value, value, value, value, value, value, value, value, value) (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: key (type: string)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: sum(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: complete
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Select Operator
+            expressions: _col1 (type: double)
+            outputColumnNames: _col0
+            Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: double)
+              sort order: +
+              Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 2.0E-5
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: double)
+          outputColumnNames: _col0
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 70
+            Offset of rows: 30
+            Statistics: Num rows: 70 Data size: 700 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 70 Data size: 700 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: 70
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+66.0
+69.0
+74.0
+74.0
+77.0
+78.0
+80.0
+82.0
+84.0
+85.0
+86.0
+87.0
+92.0
+96.0
+102.0
+105.0
+105.0
+111.0
+114.0
+116.0
+116.0
+126.0
+131.0
+133.0
+134.0
+136.0
+143.0
+144.0
+145.0
+150.0
+152.0
+153.0
+155.0
+156.0
+157.0
+158.0
+160.0
+162.0
+163.0
+166.0
+166.0
+168.0
+168.0
+170.0
+177.0
+178.0
+180.0
+181.0
+183.0
+186.0
+189.0
+190.0
+190.0
+192.0
+194.0
+194.0
+196.0
+196.0
+200.0
+201.0
+202.0
+206.0
+208.0
+210.0
+214.0
+218.0
+222.0
+226.0
+226.0
+228.0
+PREHOOK: query: -- subqueries
+explain
+select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5
+PREHOOK: type: QUERY
+POSTHOOK: query: -- subqueries
+explain
+select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1, Stage-4
+  Stage-3 is a root stage
+  Stage-4 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string)
+              outputColumnNames: key
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: key (type: string)
+                sort order: +
+                Map-reduce partition columns: key (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 2.0E-5
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(1)
+          keys: KEY._col0 (type: string)
+          mode: complete
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 10
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: _col0 is not null (type: boolean)
+              Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col0 (type: string)
+              Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col1 (type: bigint)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col0 (type: string)
+              Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col1 (type: bigint)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Inner Join 0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 11 Data size: 110 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 5
+            Offset of rows: 3
+            Statistics: Num rows: 5 Data size: 50 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 5 Data size: 50 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-3
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string)
+              outputColumnNames: key
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: key (type: string)
+                sort order: +
+                Map-reduce partition columns: key (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 2.0E-5
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: count(1)
+          keys: KEY._col0 (type: string)
+          mode: complete
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 20
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE 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-4
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              sort order: 
+              Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 2.0E-5
+              value expressions: _col0 (type: string), _col1 (type: bigint)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: bigint)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 20
+            Offset of rows: 20
+            Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: _col0 is not null (type: boolean)
+              Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE 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
+      limit: 5
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key order by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key order by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+137	2	137	2
+138	4	138	4
+143	1	143	1
+145	1	145	1
+146	2	146	2

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/results/clientpositive/vectorization_offset_limit.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vectorization_offset_limit.q.out b/ql/src/test/results/clientpositive/vectorization_offset_limit.q.out
new file mode 100644
index 0000000..d5aeabd
--- /dev/null
+++ b/ql/src/test/results/clientpositive/vectorization_offset_limit.q.out
@@ -0,0 +1,118 @@
+WARNING: Comparing a bigint and a double may result in a loss of precision.
+PREHOOK: query: explain SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2
+PREHOOK: type: QUERY
+POSTHOOK: query: explain SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: ((UDFToDouble(cbigint) < cdouble) and (cint > 0)) (type: boolean)
+              Statistics: Num rows: 1365 Data size: 293479 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: cbigint (type: bigint), cdouble (type: double)
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 1365 Data size: 293479 Basic stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 2
+                  Offset of rows: 3
+                  Statistics: Num rows: 2 Data size: 430 Basic stats: COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 2 Data size: 430 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
+      Execution mode: vectorized
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 2
+      Processor Tree:
+        ListSink
+
+WARNING: Comparing a bigint and a double may result in a loss of precision.
+PREHOOK: query: SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-1887561756	10361.0
+-1887561756	-8881.0
+PREHOOK: query: explain
+select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3
+POSTHOOK: type: QUERY
+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: alltypesorc
+            Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: ctinyint is not null (type: boolean)
+              Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+              Select Operator
+                expressions: ctinyint (type: tinyint), cdouble (type: double), csmallint (type: smallint)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: tinyint), _col1 (type: double)
+                  sort order: ++
+                  Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.1
+                  value expressions: _col2 (type: smallint)
+      Execution mode: vectorized
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: tinyint), KEY.reducesinkkey1 (type: double), VALUE._col0 (type: smallint)
+          outputColumnNames: _col0, _col1, _col2
+          Statistics: Num rows: 6144 Data size: 1320982 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 3
+            Offset of rows: 10
+            Statistics: Num rows: 3 Data size: 645 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 3 Data size: 645 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: 3
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+POSTHOOK: query: select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@alltypesorc
+#### A masked pattern was here ####
+-64	-7196.0	-7196
+-64	-6907.0	-6907
+-64	-4803.0	-4803


[11/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_outer_join4.q.out b/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
index be47139..289798c 100644
--- a/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
+++ b/ql/src/test/results/clientpositive/ppd_outer_join4.q.out
@@ -38,58 +38,49 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) and key is not null) (type: boolean)
+              predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) and key is not null) (type: boolean)
+              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -411,7 +402,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) and key is not null) (type: boolean)
+              predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -426,7 +417,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) and key is not null) (type: boolean)
+              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -442,7 +433,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_random.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_random.q.out b/ql/src/test/results/clientpositive/ppd_random.q.out
index 5f12432..5a890c5 100644
--- a/ql/src/test/results/clientpositive/ppd_random.q.out
+++ b/ql/src/test/results/clientpositive/ppd_random.q.out
@@ -34,14 +34,11 @@ STAGE PLANS:
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
@@ -52,15 +49,12 @@ STAGE PLANS:
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
index 573f595..9a21b5c 100644
--- a/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
+++ b/ql/src/test/results/clientpositive/ppd_repeated_alias.q.out
@@ -263,7 +263,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[18][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[16][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: -- Q4: here, the filter c.bar should be created under the first join but above the second
 explain select c.foo, d.bar from (select c.foo, b.bar, c.blah from pokes c left outer join pokes b on c.foo=b.foo) c left outer join pokes d where d.foo=1 and c.bar=2
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_udf_case.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_udf_case.q.out b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
index f466a29..2b407a6 100644
--- a/ql/src/test/results/clientpositive/ppd_udf_case.q.out
+++ b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
@@ -43,15 +43,12 @@ STAGE PLANS:
                 expressions: key (type: string), value (type: string), hr (type: string)
                 outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col3 (type: string)
+                  value expressions: _col1 (type: string), _col3 (type: string)
           TableScan
             alias: a
             Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
@@ -62,15 +59,12 @@ STAGE PLANS:
                 expressions: key (type: string), value (type: string), hr (type: string)
                 outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col3 (type: string)
+                  value expressions: _col1 (type: string), _col3 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ptfgroupbyjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ptfgroupbyjoin.q.out b/ql/src/test/results/clientpositive/ptfgroupbyjoin.q.out
index 46c154b..b726320 100644
--- a/ql/src/test/results/clientpositive/ptfgroupbyjoin.q.out
+++ b/ql/src/test/results/clientpositive/ptfgroupbyjoin.q.out
@@ -76,8 +76,9 @@ STAGE PLANS:
           TableScan
             alias: tlb1
             Statistics: Num rows: 2 Data size: 18 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: fkey is not null (type: boolean)
+            Select Operator
+              expressions: id (type: int), fkey (type: int)
+              outputColumnNames: id, fkey
               Statistics: Num rows: 2 Data size: 18 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 keys: id (type: int), fkey (type: int)
@@ -95,12 +96,15 @@ STAGE PLANS:
           mode: mergepartial
           outputColumnNames: _col0, _col1
           Statistics: Num rows: 1 Data size: 9 Basic stats: COMPLETE 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
+          Filter Operator
+            predicate: _col1 is not null (type: boolean)
+            Statistics: Num rows: 1 Data size: 9 Basic stats: COMPLETE 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-2
     Map Reduce
@@ -393,15 +397,12 @@ STAGE PLANS:
           Filter Operator
             predicate: _col1 is not null (type: boolean)
             Statistics: Num rows: 1 Data size: 9 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: _col1 is not null (type: boolean)
-              Statistics: Num rows: 1 Data size: 9 Basic stats: COMPLETE 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
+            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-2
     Map Reduce
@@ -423,15 +424,12 @@ STAGE PLANS:
                 expressions: fid (type: int), name (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: int)
-                    Statistics: Num rows: 1 Data size: 6 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/router_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/router_join_ppr.q.out b/ql/src/test/results/clientpositive/router_join_ppr.q.out
index 46cdb30..b486f21 100644
--- a/ql/src/test/results/clientpositive/router_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/router_join_ppr.q.out
@@ -1347,7 +1347,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
               Statistics: Num rows: 12 Data size: 127 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -1367,7 +1367,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/skewjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoin.q.out b/ql/src/test/results/clientpositive/skewjoin.q.out
index 947e67a..4e98dfd 100644
--- a/ql/src/test/results/clientpositive/skewjoin.q.out
+++ b/ql/src/test/results/clientpositive/skewjoin.q.out
@@ -768,7 +768,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((value is not null and key is not null) and UDFToDouble(substring(value, 5)) is not null) (type: boolean)
+              predicate: (value is not null and key is not null) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -783,16 +783,16 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((value is not null and key is not null) and (UDFToDouble(substring(value, 5)) + 1.0) is not null) (type: boolean)
+              predicate: (value is not null and key is not null) (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                  key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                   sort order: ++
-                  Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                  Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   value expressions: _col1 (type: string)
       Reduce Operator Tree:
@@ -802,7 +802,7 @@ STAGE PLANS:
           handleSkewJoin: true
           keys:
             0 _col0 (type: string), UDFToDouble(substring(_col1, 5)) (type: double)
-            1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+            1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
           outputColumnNames: _col2, _col3
           Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
           Select Operator
@@ -954,7 +954,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -969,7 +969,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/skewjoinopt18.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/skewjoinopt18.q.out b/ql/src/test/results/clientpositive/skewjoinopt18.q.out
index 925ebc5..9b98615 100644
--- a/ql/src/test/results/clientpositive/skewjoinopt18.q.out
+++ b/ql/src/test/results/clientpositive/skewjoinopt18.q.out
@@ -86,7 +86,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int), val (type: string)
@@ -102,7 +102,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join12.q.out b/ql/src/test/results/clientpositive/spark/auto_join12.q.out
index 3c7877f..158e535 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join12.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join12.q.out
@@ -36,7 +36,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -55,7 +55,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join13.q.out b/ql/src/test/results/clientpositive/spark/auto_join13.q.out
index b46de18..97c73f8 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join13.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join13.q.out
@@ -54,7 +54,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((UDFToDouble(key) < 200.0) and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: (UDFToDouble(key) < 200.0) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -95,32 +95,29 @@ STAGE PLANS:
                         input vertices:
                           1 Map 3
                         Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                        Filter Operator
-                          predicate: (UDFToDouble(_col2) + UDFToDouble(_col0)) is not null (type: boolean)
-                          Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                          Map Join Operator
-                            condition map:
-                                 Inner Join 0 to 1
-                            keys:
-                              0 (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
-                              1 UDFToDouble(_col0) (type: double)
-                            outputColumnNames: _col1, _col2
-                            input vertices:
-                              1 Map 4
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
+                            1 UDFToDouble(_col0) (type: double)
+                          outputColumnNames: _col1, _col2
+                          input vertices:
+                            1 Map 4
+                          Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
+                          Select Operator
+                            expressions: hash(_col2,_col1) (type: int)
+                            outputColumnNames: _col0
                             Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
-                            Select Operator
-                              expressions: hash(_col2,_col1) (type: int)
+                            Group By Operator
+                              aggregations: sum(_col0)
+                              mode: hash
                               outputColumnNames: _col0
-                              Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
-                              Group By Operator
-                                aggregations: sum(_col0)
-                                mode: hash
-                                outputColumnNames: _col0
+                              Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                              Reduce Output Operator
+                                sort order: 
                                 Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                                Reduce Output Operator
-                                  sort order: 
-                                  Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                                  value expressions: _col0 (type: bigint)
+                                value expressions: _col0 (type: bigint)
             Local Work:
               Map Reduce Local Work
         Reducer 2 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join16.q.out b/ql/src/test/results/clientpositive/spark/auto_join16.q.out
index 6da1c50..ba6336a 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join16.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join16.q.out
@@ -30,7 +30,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) and value is not null) (type: boolean)
+                    predicate: (((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
                     Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -55,7 +55,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) and key is not null) and value is not null) (type: boolean)
+                    predicate: (((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) (type: boolean)
                     Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join2.q.out b/ql/src/test/results/clientpositive/spark/auto_join2.q.out
index 10b12a9..a885837 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join2.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join2.q.out
@@ -49,7 +49,7 @@ STAGE PLANS:
                   alias: src1
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -88,31 +88,28 @@ STAGE PLANS:
                         input vertices:
                           1 Map 2
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                        Filter Operator
-                          predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                          Map Join Operator
-                            condition map:
-                                 Inner Join 0 to 1
-                            keys:
-                              0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                              1 UDFToDouble(_col0) (type: double)
-                            outputColumnNames: _col0, _col3
-                            input vertices:
-                              1 Map 3
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                            1 UDFToDouble(_col0) (type: double)
+                          outputColumnNames: _col0, _col3
+                          input vertices:
+                            1 Map 3
+                          Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+                          Select Operator
+                            expressions: UDFToInteger(_col0) (type: int), _col3 (type: string)
+                            outputColumnNames: _col0, _col1
                             Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                            Select Operator
-                              expressions: UDFToInteger(_col0) (type: int), _col3 (type: string)
-                              outputColumnNames: _col0, _col1
+                            File Output Operator
+                              compressed: false
                               Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                              File Output Operator
-                                compressed: false
-                                Statistics: Num rows: 605 Data size: 6427 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
-                                    name: default.dest_j2
+                              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
+                                  name: default.dest_j2
             Local Work:
               Map Reduce Local Work
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out b/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
index 601b27d..84810d5 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_filters.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in3.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value))  FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -300,7 +300,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in2.txt' into table sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@smb_input2
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -310,7 +310,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -320,7 +320,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join_nulls.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_nulls.q.out b/ql/src/test/results/clientpositive/spark/auto_join_nulls.q.out
index 0024b24..15f4791 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_nulls.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_nulls.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in1.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[15][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_stats.q.out b/ql/src/test/results/clientpositive/spark/auto_join_stats.q.out
index e826380..2691eac 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_stats.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_stats.q.out
@@ -48,7 +48,7 @@ STAGE PLANS:
                   alias: smalltable
                   Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -113,26 +113,23 @@ STAGE PLANS:
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                  Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Map Join Operator
-                    condition map:
-                         Inner Join 0 to 1
-                    keys:
-                      0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                      1 UDFToDouble(_col0) (type: double)
-                    outputColumnNames: _col0, _col1, _col2
-                    input vertices:
-                      1 Map 4
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                    1 UDFToDouble(_col0) (type: double)
+                  outputColumnNames: _col0, _col1, _col2
+                  input vertices:
+                    1 Map 4
+                  Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
                     Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                    File Output Operator
-                      compressed: false
-                      Statistics: Num rows: 605 Data size: 6427 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
+                    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
@@ -196,7 +193,7 @@ STAGE PLANS:
                   alias: smalltable
                   Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -214,7 +211,7 @@ STAGE PLANS:
                   alias: smalltable2
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -279,9 +276,16 @@ STAGE PLANS:
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                  Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                    1 UDFToDouble(_col0) (type: double)
+                  outputColumnNames: _col0, _col1, _col2
+                  input vertices:
+                    1 Map 4
+                  Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
                   Map Join Operator
                     condition map:
                          Inner Join 0 to 1
@@ -290,28 +294,15 @@ STAGE PLANS:
                       1 UDFToDouble(_col0) (type: double)
                     outputColumnNames: _col0, _col1, _col2
                     input vertices:
-                      1 Map 4
-                    Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                    Filter Operator
-                      predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                      Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                          1 UDFToDouble(_col0) (type: double)
-                        outputColumnNames: _col0, _col1, _col2
-                        input vertices:
-                          1 Map 5
-                        Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
-                        File Output Operator
-                          compressed: false
-                          Statistics: Num rows: 665 Data size: 7069 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
+                      1 Map 5
+                    Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 665 Data size: 7069 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

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join_stats2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_stats2.q.out b/ql/src/test/results/clientpositive/spark/auto_join_stats2.q.out
index 4062faf..de135aa 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_stats2.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_stats2.q.out
@@ -58,7 +58,7 @@ STAGE PLANS:
                   alias: smalltable
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -97,26 +97,23 @@ STAGE PLANS:
                         input vertices:
                           1 Map 2
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                        Filter Operator
-                          predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                          Map Join Operator
-                            condition map:
-                                 Inner Join 0 to 1
-                            keys:
-                              0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                              1 UDFToDouble(_col0) (type: double)
-                            outputColumnNames: _col0, _col1, _col2
-                            input vertices:
-                              1 Map 3
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                            1 UDFToDouble(_col0) (type: double)
+                          outputColumnNames: _col0, _col1, _col2
+                          input vertices:
+                            1 Map 3
+                          Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+                          File Output Operator
+                            compressed: false
                             Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                            File Output Operator
-                              compressed: false
-                              Statistics: Num rows: 605 Data size: 6427 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
+                            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
             Local Work:
               Map Reduce Local Work
 
@@ -200,7 +197,7 @@ STAGE PLANS:
                   alias: smalltable
                   Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -218,7 +215,7 @@ STAGE PLANS:
                   alias: smalltable2
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -257,9 +254,16 @@ STAGE PLANS:
                         input vertices:
                           1 Map 2
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                        Filter Operator
-                          predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                            1 UDFToDouble(_col0) (type: double)
+                          outputColumnNames: _col0, _col1, _col2
+                          input vertices:
+                            1 Map 3
+                          Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
                           Map Join Operator
                             condition map:
                                  Inner Join 0 to 1
@@ -268,28 +272,15 @@ STAGE PLANS:
                               1 UDFToDouble(_col0) (type: double)
                             outputColumnNames: _col0, _col1, _col2
                             input vertices:
-                              1 Map 3
-                            Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                            Filter Operator
-                              predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                              Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                              Map Join Operator
-                                condition map:
-                                     Inner Join 0 to 1
-                                keys:
-                                  0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                                  1 UDFToDouble(_col0) (type: double)
-                                outputColumnNames: _col0, _col1, _col2
-                                input vertices:
-                                  1 Map 4
-                                Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
-                                File Output Operator
-                                  compressed: false
-                                  Statistics: Num rows: 665 Data size: 7069 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
+                              1 Map 4
+                            Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 665 Data size: 7069 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
             Local Work:
               Map Reduce Local Work
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out b/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
index 659c305..f055a59 100644
--- a/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_join_without_localtask.q.out
@@ -337,7 +337,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) > 100.0) and value is not null) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) > 100.0) and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_smb_mapjoin_14.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_smb_mapjoin_14.q.out b/ql/src/test/results/clientpositive/spark/auto_smb_mapjoin_14.q.out
index 0c96d4c..14c7328 100644
--- a/ql/src/test/results/clientpositive/spark/auto_smb_mapjoin_14.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_smb_mapjoin_14.q.out
@@ -582,7 +582,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -713,7 +713,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -938,14 +938,11 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
@@ -958,14 +955,11 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -1271,7 +1265,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_12.q.out b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_12.q.out
index 89251b7..4b6affc 100644
--- a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_12.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_12.q.out
@@ -138,7 +138,7 @@ POSTHOOK: query: load data local inpath '../../data/files/smallsrcsortbucket3out
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_medium@ds=2008-04-08
-Warning: Map Join MAPJOIN[32][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[28][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
@@ -627,7 +627,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[32][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[28][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@bucket_big

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_6.q.out b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_6.q.out
index 0609bc8..41b2b0a 100644
--- a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_6.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_6.q.out
@@ -450,7 +450,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -475,7 +475,7 @@ STAGE PLANS:
                   alias: c
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -867,7 +867,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -892,7 +892,7 @@ STAGE PLANS:
                   alias: c
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_9.q.out b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_9.q.out
index be42791..464def4 100644
--- a/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_9.q.out
+++ b/ql/src/test/results/clientpositive/spark/auto_sortmerge_join_9.q.out
@@ -721,7 +721,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -852,7 +852,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -1075,13 +1075,10 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
-                        Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Spark HashTable Sink Operator
-                          keys:
-                            0 _col0 (type: int)
-                            1 _col0 (type: int)
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
             Local Work:
               Map Reduce Local Work
 
@@ -1103,27 +1100,24 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
-                        Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Map Join Operator
-                          condition map:
-                               Inner Join 0 to 1
-                          keys:
-                            0 _col0 (type: int)
-                            1 _col0 (type: int)
-                          input vertices:
-                            1 Map 3
-                          Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
-                          Group By Operator
-                            aggregations: count()
-                            mode: hash
-                            outputColumnNames: _col0
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        input vertices:
+                          1 Map 3
+                        Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
+                        Group By Operator
+                          aggregations: count()
+                          mode: hash
+                          outputColumnNames: _col0
+                          Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                          Reduce Output Operator
+                            sort order: 
                             Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            Reduce Output Operator
-                              sort order: 
-                              Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                              value expressions: _col0 (type: bigint)
+                            value expressions: _col0 (type: bigint)
             Local Work:
               Map Reduce Local Work
         Reducer 2 
@@ -1506,7 +1500,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2426,7 +2420,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2451,7 +2445,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2585,7 +2579,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2610,7 +2604,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -3269,7 +3263,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -3294,7 +3288,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/bucket_map_join_tez2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucket_map_join_tez2.q.out b/ql/src/test/results/clientpositive/spark/bucket_map_join_tez2.q.out
index a54b03c..31908d7 100644
--- a/ql/src/test/results/clientpositive/spark/bucket_map_join_tez2.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucket_map_join_tez2.q.out
@@ -268,7 +268,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
@@ -291,7 +291,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -349,7 +349,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 2) and (key > 1)) and key is not null) (type: boolean)
+                    predicate: ((key > 2) and (key > 1)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -372,7 +372,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 1) and (key > 2)) and key is not null) (type: boolean)
+                    predicate: ((key > 1) and (key > 2)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -670,7 +670,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (value is not null and UDFToDouble(value) is not null) (type: boolean)
+                    predicate: value is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: value (type: string)
@@ -706,7 +706,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
index ded106c..0b64a87 100644
--- a/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
+++ b/ql/src/test/results/clientpositive/spark/bucketsortoptimize_insert_7.q.out
@@ -459,7 +459,7 @@ STAGE PLANS:
                   alias: test_table1
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and ((key = 0) or (key = 5))) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and ((key = 0) or (key = 5))) (type: boolean)
                     Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
@@ -484,7 +484,7 @@ STAGE PLANS:
                   alias: test_table2
                   Statistics: Num rows: 84 Data size: 736 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and ((key = 0) or (key = 5))) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and ((key = 0) or (key = 5))) (type: boolean)
                     Statistics: Num rows: 28 Data size: 245 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/cross_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/cross_join.q.out b/ql/src/test/results/clientpositive/spark/cross_join.q.out
index d136913..7c8118c 100644
--- a/ql/src/test/results/clientpositive/spark/cross_join.q.out
+++ b/ql/src/test/results/clientpositive/spark/cross_join.q.out
@@ -203,7 +203,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select src.key from src join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src join src src2
@@ -271,7 +271,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select src.key from src cross join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src cross join src src2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/cross_product_check_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/cross_product_check_1.q.out b/ql/src/test/results/clientpositive/spark/cross_product_check_1.q.out
index 5b03dcf..0656cd5 100644
--- a/ql/src/test/results/clientpositive/spark/cross_product_check_1.q.out
+++ b/ql/src/test/results/clientpositive/spark/cross_product_check_1.q.out
@@ -94,7 +94,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -198,7 +198,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[21][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 2' is a cross product
+Warning: Shuffle Join JOIN[19][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 2' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key
@@ -434,7 +434,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[25][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[23][tables = [$hdt$_0, $hdt$_1]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A  group by key) ss join
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/cross_product_check_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/cross_product_check_2.q.out b/ql/src/test/results/clientpositive/spark/cross_product_check_2.q.out
index 93c502d..2d6eb38 100644
--- a/ql/src/test/results/clientpositive/spark/cross_product_check_2.q.out
+++ b/ql/src/test/results/clientpositive/spark/cross_product_check_2.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@B
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join B
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join B
@@ -98,7 +98,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -205,7 +205,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[27][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[24][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key 
@@ -339,8 +339,8 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[24][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
-Warning: Map Join MAPJOIN[25][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[23][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
@@ -460,7 +460,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[31][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[28][bigTable=?] in task 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A group by key) ss join 
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1


[13/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out b/ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out
index 3db64e6..66acb74 100644
--- a/ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out
+++ b/ql/src/test/results/clientpositive/groupby_grouping_sets4.q.out
@@ -74,16 +74,19 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col3
           Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE Column stats: NONE
           pruneGroupingSetId: true
-          Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint)
-            outputColumnNames: _col0, _col1, _col2
+          Filter Operator
+            predicate: _col0 is not null (type: boolean)
             Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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: string), _col1 (type: string), _col3 (type: bigint)
+              outputColumnNames: _col0, _col1, _col2
+              Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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-2
     Map Reduce
@@ -148,16 +151,19 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col3
           Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE Column stats: NONE
           pruneGroupingSetId: true
-          Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint)
-            outputColumnNames: _col0, _col1, _col2
+          Filter Operator
+            predicate: _col0 is not null (type: boolean)
             Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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: string), _col1 (type: string), _col3 (type: bigint)
+              outputColumnNames: _col0, _col1, _col2
+              Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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
@@ -274,16 +280,19 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col3
           Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE Column stats: NONE
           pruneGroupingSetId: true
-          Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint)
-            outputColumnNames: _col0, _col1, _col2
+          Filter Operator
+            predicate: _col0 is not null (type: boolean)
             Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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: string), _col1 (type: string), _col3 (type: bigint)
+              outputColumnNames: _col0, _col1, _col2
+              Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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-3
     Map Reduce
@@ -372,16 +381,19 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col3
           Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE Column stats: NONE
           pruneGroupingSetId: true
-          Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: bigint)
-            outputColumnNames: _col0, _col1, _col2
+          Filter Operator
+            predicate: _col0 is not null (type: boolean)
             Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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: string), _col1 (type: string), _col3 (type: bigint)
+              outputColumnNames: _col0, _col1, _col2
+              Statistics: Num rows: 2 Data size: 72 Basic stats: COMPLETE 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/827ff37f/ql/src/test/results/clientpositive/groupby_position.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/groupby_position.q.out b/ql/src/test/results/clientpositive/groupby_position.q.out
index ade6cb5..c2566f2 100644
--- a/ql/src/test/results/clientpositive/groupby_position.q.out
+++ b/ql/src/test/results/clientpositive/groupby_position.q.out
@@ -561,7 +561,7 @@ STAGE PLANS:
             alias: src1
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 keys: key (type: string), value (type: string)
@@ -647,7 +647,7 @@ STAGE PLANS:
             alias: src1
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 keys: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/having2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/having2.q.out b/ql/src/test/results/clientpositive/having2.q.out
index 65d97d0..eaacc71 100644
--- a/ql/src/test/results/clientpositive/having2.q.out
+++ b/ql/src/test/results/clientpositive/having2.q.out
@@ -345,7 +345,7 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3
           Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
-            predicate: (((_col1 <= 4074689.000000041) and (_col2 <= 822.0)) and (_col3 > 4)) (type: boolean)
+            predicate: ((_col1 <= 4074689.000000041) and (_col2 <= 822.0) and (_col3 > 4)) (type: boolean)
             Statistics: Num rows: 10 Data size: 106 Basic stats: COMPLETE Column stats: NONE
             Select Operator
               expressions: _col0 (type: string)
@@ -467,20 +467,24 @@ STAGE PLANS:
           mode: mergepartial
           outputColumnNames: _col0, _col1, _col2, _col3
           Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (((_col1 <= 4074689.000000041) and (_col2 <= 822.0)) and (_col3 > 4)) (type: boolean)
-            Statistics: Num rows: 10 Data size: 106 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: _col0 (type: string)
-              outputColumnNames: _col0
+          Select Operator
+            expressions: _col0 (type: string), _col1 (type: double), _col2 (type: double), _col3 (type: bigint)
+            outputColumnNames: _col1, _col2, _col3, _col4
+            Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: ((_col2 <= 4074689.000000041) and (_col3 <= 822.0) and (_col4 > 4)) (type: boolean)
               Statistics: Num rows: 10 Data size: 106 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator
-                compressed: false
+              Select Operator
+                expressions: _col1 (type: string)
+                outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 106 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
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 10 Data size: 106 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
@@ -590,20 +594,24 @@ STAGE PLANS:
           mode: mergepartial
           outputColumnNames: _col0, _col1, _col2, _col3
           Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (((_col1 <= 4074689.000000041) and (_col2 <= 822.0)) and (_col3 > 4)) (type: boolean)
-            Statistics: Num rows: 10 Data size: 106 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: _col0 (type: string), _col0 (type: string)
-              outputColumnNames: _col0, _col1
+          Select Operator
+            expressions: _col0 (type: string), _col1 (type: double), _col2 (type: double), _col3 (type: bigint)
+            outputColumnNames: _col1, _col2, _col3, _col4
+            Statistics: Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              predicate: ((_col2 <= 4074689.000000041) and (_col3 <= 822.0) and (_col4 > 4)) (type: boolean)
               Statistics: Num rows: 10 Data size: 106 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator
-                compressed: false
+              Select Operator
+                expressions: _col1 (type: string), _col1 (type: string)
+                outputColumnNames: _col0, _col1
                 Statistics: Num rows: 10 Data size: 106 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
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 10 Data size: 106 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

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out b/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out
index be576b2..0fb0d6a 100644
--- a/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out
+++ b/ql/src/test/results/clientpositive/index_auto_mult_tables.q.out
@@ -22,7 +22,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -38,7 +38,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 24 Data size: 254 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -260,10 +260,10 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            filterExpr: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+            filterExpr: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -277,10 +277,10 @@ STAGE PLANS:
                   value expressions: _col1 (type: string)
           TableScan
             alias: b
-            filterExpr: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+            filterExpr: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 24 Data size: 254 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out b/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out
index 3ca37b3..cd97bf8 100644
--- a/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out
+++ b/ql/src/test/results/clientpositive/index_auto_mult_tables_compact.q.out
@@ -22,7 +22,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -38,7 +38,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 24 Data size: 254 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -260,10 +260,10 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: a
-            filterExpr: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+            filterExpr: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 80.0) and (UDFToDouble(key) < 100.0)) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 70.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -277,10 +277,10 @@ STAGE PLANS:
                   value expressions: _col1 (type: string)
           TableScan
             alias: b
-            filterExpr: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+            filterExpr: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 70.0) and (UDFToDouble(key) < 90.0)) and (UDFToDouble(key) > 80.0)) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 24 Data size: 254 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/infer_bucket_sort_map_operators.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/infer_bucket_sort_map_operators.q.out b/ql/src/test/results/clientpositive/infer_bucket_sort_map_operators.q.out
index 61a5fa4..325ed2c 100644
--- a/ql/src/test/results/clientpositive/infer_bucket_sort_map_operators.q.out
+++ b/ql/src/test/results/clientpositive/infer_bucket_sort_map_operators.q.out
@@ -245,7 +245,7 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                 Filter Operator
-                  predicate: (_col1 is not null and UDFToDouble(_col1) is not null) (type: boolean)
+                  predicate: _col1 is not null (type: boolean)
                   Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                   Reduce Output Operator
                     key expressions: UDFToDouble(_col1) (type: double)
@@ -257,7 +257,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (value is not null and UDFToDouble(value) is not null) (type: boolean)
+              predicate: value is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join12.q.out b/ql/src/test/results/clientpositive/join12.q.out
index 672777f..8217c86 100644
--- a/ql/src/test/results/clientpositive/join12.q.out
+++ b/ql/src/test/results/clientpositive/join12.q.out
@@ -36,7 +36,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -51,7 +51,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join13.q.out b/ql/src/test/results/clientpositive/join13.q.out
index ff873e4..3ccff63 100644
--- a/ql/src/test/results/clientpositive/join13.q.out
+++ b/ql/src/test/results/clientpositive/join13.q.out
@@ -73,15 +73,12 @@ STAGE PLANS:
             1 _col0 (type: string)
           outputColumnNames: _col0, _col1, _col2
           Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (UDFToDouble(_col2) + UDFToDouble(_col0)) is not null (type: boolean)
-            Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE 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
+          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-2
     Map Reduce
@@ -97,7 +94,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((UDFToDouble(key) < 200.0) and UDFToDouble(key) is not null) (type: boolean)
+              predicate: (UDFToDouble(key) < 200.0) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join16.q.out b/ql/src/test/results/clientpositive/join16.q.out
index de88802..244eb46 100644
--- a/ql/src/test/results/clientpositive/join16.q.out
+++ b/ql/src/test/results/clientpositive/join16.q.out
@@ -14,7 +14,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) and key is not null) and value is not null) (type: boolean)
+              predicate: (((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) (type: boolean)
               Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -29,7 +29,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) and value is not null) (type: boolean)
+              predicate: (((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
               Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join2.q.out b/ql/src/test/results/clientpositive/join2.q.out
index ef35f8f..1ad7285 100644
--- a/ql/src/test/results/clientpositive/join2.q.out
+++ b/ql/src/test/results/clientpositive/join2.q.out
@@ -67,15 +67,12 @@ STAGE PLANS:
             1 _col0 (type: string)
           outputColumnNames: _col0, _col1
           Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-            Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+          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-2
     Map Reduce
@@ -91,7 +88,7 @@ STAGE PLANS:
             alias: src1
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out b/ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out
index 517345e..2ce9a87 100644
--- a/ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out
+++ b/ql/src/test/results/clientpositive/join_cond_pushdown_1.q.out
@@ -281,7 +281,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part p2 join part p3 on p2.p_partkey = 1 and p3.p_name = p2.p_name
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join_cond_pushdown_3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_cond_pushdown_3.q.out b/ql/src/test/results/clientpositive/join_cond_pushdown_3.q.out
index a96e134..a361439 100644
--- a/ql/src/test/results/clientpositive/join_cond_pushdown_3.q.out
+++ b/ql/src/test/results/clientpositive/join_cond_pushdown_3.q.out
@@ -287,7 +287,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part p2 join part p3 
 where p2.p_partkey = 1 and p3.p_name = p2.p_name

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/join_reorder.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/join_reorder.q.out b/ql/src/test/results/clientpositive/join_reorder.q.out
index f71f4e1..c79e36f 100644
--- a/ql/src/test/results/clientpositive/join_reorder.q.out
+++ b/ql/src/test/results/clientpositive/join_reorder.q.out
@@ -68,7 +68,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), val (type: string)
@@ -84,16 +84,16 @@ STAGE PLANS:
             alias: c
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and (UDFToDouble(key) + 1.0) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
-                  key expressions: (UDFToDouble(_col0) + 1.0) (type: double)
+                  key expressions: (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
                   sort order: +
-                  Map-reduce partition columns: (UDFToDouble(_col0) + 1.0) (type: double)
+                  Map-reduce partition columns: (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   value expressions: _col0 (type: string)
       Reduce Operator Tree:
@@ -102,7 +102,7 @@ STAGE PLANS:
                Inner Join 0 to 1
           keys:
             0 UDFToDouble(_col0) (type: double)
-            1 (UDFToDouble(_col0) + 1.0) (type: double)
+            1 (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
           outputColumnNames: _col0, _col1, _col2
           Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
           File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out b/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
index 824f0fd..5e7af65 100644
--- a/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
+++ b/ql/src/test/results/clientpositive/llap/bucket_map_join_tez2.q.out
@@ -260,7 +260,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
@@ -279,7 +279,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -338,7 +338,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 1) and (key > 2)) and key is not null) (type: boolean)
+                    predicate: ((key > 1) and (key > 2)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -369,7 +369,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 2) and (key > 1)) and key is not null) (type: boolean)
+                    predicate: ((key > 2) and (key > 1)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -640,7 +640,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (value is not null and UDFToDouble(value) is not null) (type: boolean)
+                    predicate: value is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: value (type: string)
@@ -659,7 +659,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/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 c6dc55c..a7e974a 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
@@ -1322,29 +1322,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1451,20 +1448,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
@@ -1507,7 +1501,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1580,29 +1574,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1694,20 +1685,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and (UDFToDouble(hr) * 2.0) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
@@ -1735,7 +1723,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1821,29 +1809,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
+                      sort order: +
+                      Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        sort order: +
-                        Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1877,7 +1862,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
+                  0 UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                   1 UDFToString(_col0) (type: string)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -2098,7 +2083,7 @@ POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
 #### A masked pattern was here ####
 1000
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- non-equi join
 EXPLAIN select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
@@ -2196,7 +2181,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -4269,43 +4254,40 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 UDFToDouble(_col0) (type: double)
+                        1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -4393,34 +4375,31 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 (UDFToDouble(_col0) * 2.0) (type: double)
-                          1 _col0 (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                        1 _col0 (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
@@ -5461,43 +5440,39 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart_orc
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: ds (type: string), hr (type: int)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: ds (type: string), hr (type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col0 (type: string), UDFToDouble(_col1) (type: double)
-                          1 _col0 (type: string), UDFToDouble(_col2) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 _col0 (type: string), UDFToDouble(_col1) (type: double)
+                        1 _col0 (type: string), UDFToDouble(_col2) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_date_hour
-                  filterExpr: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                   Statistics: Num rows: 4 Data size: 108 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                     Statistics: Num rows: 2 Data size: 54 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ds (type: string), hr (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/mapjoin_decimal.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/mapjoin_decimal.q.out b/ql/src/test/results/clientpositive/llap/mapjoin_decimal.q.out
index bf82492..9fac69f 100644
--- a/ql/src/test/results/clientpositive/llap/mapjoin_decimal.q.out
+++ b/ql/src/test/results/clientpositive/llap/mapjoin_decimal.q.out
@@ -140,7 +140,6 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: decimal(6,2))
                         Statistics: Num rows: 1049 Data size: 117488 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: decimal(4,0))
             Execution mode: llap
         Reducer 2 
             Execution mode: uber

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/tez_dynpart_hashjoin_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/tez_dynpart_hashjoin_2.q.out b/ql/src/test/results/clientpositive/llap/tez_dynpart_hashjoin_2.q.out
index 09b9ca4..56f0165 100644
--- a/ql/src/test/results/clientpositive/llap/tez_dynpart_hashjoin_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/tez_dynpart_hashjoin_2.q.out
@@ -44,7 +44,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -63,7 +63,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -81,7 +81,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -235,7 +235,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -254,7 +254,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -272,7 +272,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -424,7 +424,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -443,7 +443,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -461,7 +461,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/tez_vector_dynpart_hashjoin_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/tez_vector_dynpart_hashjoin_2.q.out b/ql/src/test/results/clientpositive/llap/tez_vector_dynpart_hashjoin_2.q.out
index 051fbe3..9eef871 100644
--- a/ql/src/test/results/clientpositive/llap/tez_vector_dynpart_hashjoin_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/tez_vector_dynpart_hashjoin_2.q.out
@@ -44,7 +44,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -63,7 +63,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -81,7 +81,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -235,7 +235,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -254,7 +254,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -272,7 +272,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -424,7 +424,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -443,7 +443,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -461,7 +461,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/vector_join_part_col_char.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/vector_join_part_col_char.q.out b/ql/src/test/results/clientpositive/llap/vector_join_part_col_char.q.out
index d72ebe1..104c907 100644
--- a/ql/src/test/results/clientpositive/llap/vector_join_part_col_char.q.out
+++ b/ql/src/test/results/clientpositive/llap/vector_join_part_col_char.q.out
@@ -157,7 +157,7 @@ STAGE PLANS:
                       sort order: +
                       Map-reduce partition columns: _col2 (type: char(50))
                       Statistics: Num rows: 2 Data size: 203 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: _col0 (type: string), _col1 (type: int), _col2 (type: char(5))
+                      value expressions: _col0 (type: string), _col1 (type: int)
             Execution mode: vectorized, llap
         Reducer 2 
             Execution mode: llap


[15/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)


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

Branch: refs/heads/branch-2.0
Commit: 827ff37f29daf04726022332c37b04f0494fea10
Parents: ce5860f
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Mon Dec 21 02:17:27 2015 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon Dec 21 02:17:27 2015 +0100

----------------------------------------------------------------------
 .../test/results/positive/hbase_queries.q.out   |   12 +-
 .../hadoop/hive/ql/optimizer/Optimizer.java     |   16 +-
 .../calcite/reloperators/HiveProject.java       |    4 +-
 .../rules/HiveFilterProjectTSTransposeRule.java |    2 +-
 .../rules/HiveFilterProjectTransposeRule.java   |   18 +-
 .../rules/HiveFilterSortTransposeRule.java      |   71 ++
 .../calcite/rules/HiveJoinAddNotNullRule.java   |   39 +-
 .../hadoop/hive/ql/parse/CalcitePlanner.java    |   23 +-
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |    8 +-
 .../apache/hadoop/hive/ql/plan/FilterDesc.java  |    9 +
 .../hadoop/hive/ql/ppd/OpProcFactory.java       |   50 +-
 .../hive/ql/ppd/SimplePredicatePushDown.java    |  110 ++
 .../hive/ql/ppd/SyntheticJoinPredicate.java     |    4 +-
 .../results/clientpositive/auto_join12.q.out    |    4 +-
 .../results/clientpositive/auto_join13.q.out    |   41 +-
 .../results/clientpositive/auto_join16.q.out    |    4 +-
 .../results/clientpositive/auto_join2.q.out     |   41 +-
 .../results/clientpositive/auto_join33.q.out    |   12 +-
 .../clientpositive/auto_join_filters.q.out      |    8 +-
 .../clientpositive/auto_join_nulls.q.out        |    2 +-
 .../clientpositive/auto_join_stats.q.out        |  127 +-
 .../clientpositive/auto_join_stats2.q.out       |   75 +-
 .../auto_join_without_localtask.q.out           |    6 +-
 .../clientpositive/auto_smb_mapjoin_14.q.out    |   28 +-
 .../clientpositive/auto_sortmerge_join_12.q.out |    4 +-
 .../clientpositive/auto_sortmerge_join_6.q.out  |    8 +-
 .../clientpositive/auto_sortmerge_join_9.q.out  |   80 +-
 .../bucketsortoptimize_insert_7.q.out           |    2 +-
 .../cbo_rp_cross_product_check_2.q.out          |    4 +-
 .../results/clientpositive/cbo_rp_join0.q.out   |   29 +-
 .../results/clientpositive/cbo_rp_join1.q.out   |   96 +-
 .../clientpositive/cbo_rp_lineage2.q.out        |    8 +-
 .../cbo_rp_outer_join_ppr.q.java1.7.out         |   28 +-
 .../clientpositive/correlationoptimizer10.q.out |   24 +-
 .../clientpositive/correlationoptimizer13.q.out |    4 +-
 .../clientpositive/correlationoptimizer9.q.out  |   16 +-
 .../results/clientpositive/cross_join.q.out     |    4 +-
 .../clientpositive/cross_product_check_1.q.out  |    6 +-
 .../clientpositive/cross_product_check_2.q.out  |   16 +-
 .../clientpositive/dynamic_rdd_cache.q.out      |   12 +-
 .../encryption_join_unencrypted_tbl.q.out       |    4 +-
 .../clientpositive/explain_logical.q.out        |   74 +-
 .../clientpositive/filter_cond_pushdown.q.out   |    2 +-
 .../clientpositive/fouter_join_ppr.q.out        |    4 +-
 .../clientpositive/groupby_grouping_sets4.q.out |   84 +-
 .../clientpositive/groupby_position.q.out       |    4 +-
 .../test/results/clientpositive/having2.q.out   |   58 +-
 .../clientpositive/index_auto_mult_tables.q.out |   12 +-
 .../index_auto_mult_tables_compact.q.out        |   12 +-
 .../infer_bucket_sort_map_operators.q.out       |    4 +-
 ql/src/test/results/clientpositive/join12.q.out |    4 +-
 ql/src/test/results/clientpositive/join13.q.out |   17 +-
 ql/src/test/results/clientpositive/join16.q.out |    4 +-
 ql/src/test/results/clientpositive/join2.q.out  |   17 +-
 .../clientpositive/join_cond_pushdown_1.q.out   |    2 +-
 .../clientpositive/join_cond_pushdown_3.q.out   |    2 +-
 .../results/clientpositive/join_reorder.q.out   |   10 +-
 .../llap/bucket_map_join_tez2.q.out             |   12 +-
 .../llap/dynamic_partition_pruning.q.out        |  265 ++--
 .../clientpositive/llap/mapjoin_decimal.q.out   |    1 -
 .../llap/tez_dynpart_hashjoin_2.q.out           |   18 +-
 .../llap/tez_vector_dynpart_hashjoin_2.q.out    |   18 +-
 .../llap/vector_join_part_col_char.q.out        |    2 +-
 .../vectorized_dynamic_partition_pruning.q.out  |  265 ++--
 .../clientpositive/louter_join_ppr.q.out        |    4 +-
 .../clientpositive/mapjoin_mapjoin.q.out        |    2 +-
 .../results/clientpositive/multiMapJoin1.q.out  |   36 +-
 .../nonblock_op_deduplicate.q.out               |    4 +-
 .../test/results/clientpositive/orc_llap.q.out  |    6 +-
 .../clientpositive/outer_join_ppr.q.java1.7.out |    2 +-
 .../clientpositive/partition_boolexpr.q.out     |   26 +-
 .../results/clientpositive/ppd_gby_join.q.out   |   30 +-
 .../test/results/clientpositive/ppd_join.q.out  |   32 +-
 .../test/results/clientpositive/ppd_join2.q.out |   60 +-
 .../test/results/clientpositive/ppd_join3.q.out |   62 +-
 .../test/results/clientpositive/ppd_join5.q.out |    6 +-
 .../clientpositive/ppd_join_filter.q.out        |  108 +-
 .../clientpositive/ppd_outer_join2.q.out        |   34 +-
 .../clientpositive/ppd_outer_join3.q.out        |   34 +-
 .../clientpositive/ppd_outer_join4.q.out        |   49 +-
 .../results/clientpositive/ppd_random.q.out     |   24 +-
 .../clientpositive/ppd_repeated_alias.q.out     |    2 +-
 .../results/clientpositive/ppd_udf_case.q.out   |   26 +-
 .../results/clientpositive/ptfgroupbyjoin.q.out |   48 +-
 .../clientpositive/router_join_ppr.q.out        |    4 +-
 .../test/results/clientpositive/skewjoin.q.out  |   14 +-
 .../results/clientpositive/skewjoinopt18.q.out  |    4 +-
 .../clientpositive/spark/auto_join12.q.out      |    4 +-
 .../clientpositive/spark/auto_join13.q.out      |   45 +-
 .../clientpositive/spark/auto_join16.q.out      |    4 +-
 .../clientpositive/spark/auto_join2.q.out       |   45 +-
 .../spark/auto_join_filters.q.out               |    8 +-
 .../clientpositive/spark/auto_join_nulls.q.out  |    2 +-
 .../clientpositive/spark/auto_join_stats.q.out  |   85 +-
 .../clientpositive/spark/auto_join_stats2.q.out |   85 +-
 .../spark/auto_join_without_localtask.q.out     |    2 +-
 .../spark/auto_smb_mapjoin_14.q.out             |   28 +-
 .../spark/auto_sortmerge_join_12.q.out          |    4 +-
 .../spark/auto_sortmerge_join_6.q.out           |    8 +-
 .../spark/auto_sortmerge_join_9.q.out           |   66 +-
 .../spark/bucket_map_join_tez2.q.out            |   12 +-
 .../spark/bucketsortoptimize_insert_7.q.out     |    4 +-
 .../clientpositive/spark/cross_join.q.out       |    4 +-
 .../spark/cross_product_check_1.q.out           |    6 +-
 .../spark/cross_product_check_2.q.out           |   12 +-
 .../spark/dynamic_rdd_cache.q.out               |   12 +-
 .../clientpositive/spark/groupby_position.q.out |    4 +-
 .../spark/infer_bucket_sort_map_operators.q.out |    4 +-
 .../results/clientpositive/spark/join12.q.out   |    4 +-
 .../results/clientpositive/spark/join13.q.out   |   15 +-
 .../results/clientpositive/spark/join16.q.out   |    4 +-
 .../results/clientpositive/spark/join2.q.out    |   15 +-
 .../spark/join_cond_pushdown_1.q.out            |    2 +-
 .../spark/join_cond_pushdown_3.q.out            |    2 +-
 .../clientpositive/spark/join_reorder.q.out     |   10 +-
 .../clientpositive/spark/louter_join_ppr.q.out  |    4 +-
 .../clientpositive/spark/mapjoin_mapjoin.q.out  |    2 +-
 .../spark/outer_join_ppr.q.java1.7.out          |    2 +-
 .../clientpositive/spark/ppd_gby_join.q.out     |   30 +-
 .../results/clientpositive/spark/ppd_join.q.out |   32 +-
 .../clientpositive/spark/ppd_join2.q.out        |   58 +-
 .../clientpositive/spark/ppd_join3.q.out        |   60 +-
 .../clientpositive/spark/ppd_join5.q.out        |    6 +-
 .../clientpositive/spark/ppd_join_filter.q.out  |   68 +-
 .../clientpositive/spark/ppd_outer_join2.q.out  |   34 +-
 .../clientpositive/spark/ppd_outer_join3.q.out  |   34 +-
 .../clientpositive/spark/ppd_outer_join4.q.out  |   49 +-
 .../clientpositive/spark/router_join_ppr.q.out  |    4 +-
 .../results/clientpositive/spark/skewjoin.q.out |   14 +-
 .../clientpositive/spark/skewjoinopt18.q.out    |    4 +-
 .../clientpositive/spark/subquery_exists.q.out  |    4 +-
 .../clientpositive/spark/subquery_in.q.out      |   21 +-
 .../spark/table_access_keys_stats.q.out         |   24 +-
 .../clientpositive/subquery_exists.q.out        |    4 +-
 .../results/clientpositive/subquery_in.q.out    |   21 +-
 .../clientpositive/subquery_in_having.q.out     |    4 +-
 .../subquery_notin_having.q.java1.7.out         |    2 +-
 .../subquery_unqualcolumnrefs.q.out             |   16 +-
 .../results/clientpositive/subquery_views.q.out |    4 +-
 .../table_access_keys_stats.q.out               |   24 +-
 .../clientpositive/tez/auto_join_filters.q.out  |   10 +-
 .../clientpositive/tez/auto_join_nulls.q.out    |    2 +-
 .../tez/auto_sortmerge_join_12.q.out            |    4 +-
 .../tez/auto_sortmerge_join_6.q.out             |   12 +-
 .../tez/auto_sortmerge_join_9.q.out             |   74 +-
 .../tez/bucket_map_join_tez2.q.out              |   12 +-
 .../results/clientpositive/tez/cross_join.q.out |    8 +-
 .../tez/cross_product_check_1.q.out             |   12 +-
 .../tez/cross_product_check_2.q.out             |   12 +-
 .../tez/dynamic_partition_pruning.q.out         |  265 ++--
 .../clientpositive/tez/explainuser_1.q.out      | 1015 ++++++++-------
 .../clientpositive/tez/explainuser_2.q.out      | 1180 +++++++++---------
 .../clientpositive/tez/explainuser_3.q.out      |   12 +-
 .../clientpositive/tez/mapjoin_decimal.q.out    |    1 -
 .../clientpositive/tez/mapjoin_mapjoin.q.out    |    2 +-
 .../results/clientpositive/tez/mergejoin.q.out  |    2 +-
 .../results/clientpositive/tez/skewjoin.q.out   |   14 +-
 .../clientpositive/tez/subquery_exists.q.out    |    4 +-
 .../clientpositive/tez/subquery_in.q.out        |   21 +-
 .../tez/tez_dynpart_hashjoin_2.q.out            |   18 +-
 .../tez/tez_vector_dynpart_hashjoin_2.q.out     |   18 +-
 .../tez/vector_auto_smb_mapjoin_14.q.out        |  234 ++--
 .../tez/vector_between_columns.q.out            |    4 +-
 .../tez/vector_binary_join_groupby.q.out        |    2 +-
 .../tez/vector_char_mapjoin1.q.out              |    4 +-
 .../tez/vector_decimal_mapjoin.q.out            |    1 -
 .../tez/vector_interval_mapjoin.q.out           |   52 +-
 .../tez/vector_join_filters.q.out               |    2 +-
 .../clientpositive/tez/vector_join_nulls.q.out  |    2 +-
 .../tez/vector_join_part_col_char.q.out         |   22 +-
 .../tez/vector_varchar_mapjoin1.q.out           |    2 +-
 .../vectorized_dynamic_partition_pruning.q.out  |  265 ++--
 .../vector_auto_smb_mapjoin_14.q.out            |   28 +-
 .../clientpositive/vector_between_columns.q.out |    4 +-
 .../vector_binary_join_groupby.q.out            |    2 +-
 .../clientpositive/vector_char_mapjoin1.q.out   |    2 +-
 .../vector_interval_mapjoin.q.out               |   46 +-
 .../clientpositive/vector_join_filters.q.out    |    2 +-
 .../clientpositive/vector_join_nulls.q.out      |    2 +-
 .../vector_varchar_mapjoin1.q.out               |    2 +-
 180 files changed, 3418 insertions(+), 3546 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/hbase-handler/src/test/results/positive/hbase_queries.q.out
----------------------------------------------------------------------
diff --git a/hbase-handler/src/test/results/positive/hbase_queries.q.out b/hbase-handler/src/test/results/positive/hbase_queries.q.out
index 3907bc9..4f10564 100644
--- a/hbase-handler/src/test/results/positive/hbase_queries.q.out
+++ b/hbase-handler/src/test/results/positive/hbase_queries.q.out
@@ -121,7 +121,7 @@ STAGE PLANS:
             alias: hbase_table_1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -136,7 +136,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -272,7 +272,7 @@ STAGE PLANS:
             alias: hbase_table_1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (((100 < key) and (key < 120)) and key is not null) (type: boolean)
+              predicate: ((100 < key) and (key < 120)) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -287,7 +287,7 @@ STAGE PLANS:
             alias: hbase_table_2
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (((key < 120) and (100 < key)) and key is not null) (type: boolean)
+              predicate: ((key < 120) and (100 < key)) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key (type: int), value (type: string)
@@ -494,7 +494,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 aggregations: count(key)
@@ -529,7 +529,7 @@ STAGE PLANS:
             alias: hbase_table_1
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java
index 8f48e7d..7ec068c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/Optimizer.java
@@ -22,8 +22,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.optimizer.calcite.translator.HiveOpConverterPostProc;
 import org.apache.hadoop.hive.ql.optimizer.correlation.CorrelationOptimizer;
@@ -40,7 +38,10 @@ import org.apache.hadoop.hive.ql.parse.ParseContext;
 import org.apache.hadoop.hive.ql.parse.SemanticException;
 import org.apache.hadoop.hive.ql.ppd.PredicatePushDown;
 import org.apache.hadoop.hive.ql.ppd.PredicateTransitivePropagate;
+import org.apache.hadoop.hive.ql.ppd.SimplePredicatePushDown;
 import org.apache.hadoop.hive.ql.ppd.SyntheticJoinPredicate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
@@ -91,18 +92,25 @@ public class Optimizer {
         transformations.add(new PartitionColumnsSeparator());
     }
 
-    if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTPPD)) {
+    if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTPPD) &&
+            !pctx.getContext().isCboSucceeded()) {
       transformations.add(new PredicateTransitivePropagate());
       if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTCONSTANTPROPAGATION)) {
         transformations.add(new ConstantPropagate());
       }
       transformations.add(new SyntheticJoinPredicate());
       transformations.add(new PredicatePushDown());
+    } else if (pctx.getContext().isCboSucceeded()) {
+      if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTCONSTANTPROPAGATION)) {
+        transformations.add(new ConstantPropagate());
+      }
+      transformations.add(new SyntheticJoinPredicate());
+      transformations.add(new SimplePredicatePushDown());
     }
     if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTCONSTANTPROPAGATION)) {
       // We run constant propagation twice because after predicate pushdown, filter expressions
       // are combined and may become eligible for reduction (like is not null filter).
-        transformations.add(new ConstantPropagate());
+      transformations.add(new ConstantPropagate());
     }
 
     if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.HIVEOPTPPD)) {

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java
index 142812c..c5376bf 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveProject.java
@@ -166,7 +166,7 @@ public class HiveProject extends Project implements HiveRelNode {
   public Project copy(RelTraitSet traitSet, RelNode input, List<RexNode> exps, RelDataType rowType) {
     assert traitSet.containsIfApplicable(HiveRelNode.CONVENTION);
     HiveProject hp = new HiveProject(getCluster(), traitSet, input, exps, rowType, getFlags());
-    if (this.isSysnthetic()) {
+    if (this.isSynthetic()) {
       hp.setSynthetic();
     }
 
@@ -192,7 +192,7 @@ public class HiveProject extends Project implements HiveRelNode {
     this.isSysnthetic = true;
   }
 
-  public boolean isSysnthetic() {
+  public boolean isSynthetic() {
     return isSysnthetic;
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTSTransposeRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTSTransposeRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTSTransposeRule.java
index 8321504..f81c21b 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTSTransposeRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTSTransposeRule.java
@@ -58,7 +58,7 @@ public class HiveFilterProjectTSTransposeRule extends RelOptRule {
     // 2. If ProjectRel is not synthetic then PPD would have already pushed
     // relevant pieces down and hence no point in running PPD again.
     // 3. For synthetic Projects we don't care about non deterministic UDFs
-    if (!projRel.isSysnthetic()) {
+    if (!projRel.isSynthetic()) {
       return false;
     }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
index 7e484b9..1e947c3 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterProjectTransposeRule.java
@@ -25,23 +25,37 @@ import org.apache.calcite.rel.core.RelFactories.ProjectFactory;
 import org.apache.calcite.rel.rules.FilterProjectTransposeRule;
 import org.apache.calcite.rex.RexNode;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil;
+import org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelFactories;
+import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveProject;
 
 public class HiveFilterProjectTransposeRule extends FilterProjectTransposeRule {
 
+  public static final HiveFilterProjectTransposeRule INSTANCE_DETERMINISTIC =
+          new HiveFilterProjectTransposeRule(Filter.class, HiveRelFactories.HIVE_FILTER_FACTORY,
+          HiveProject.class, HiveRelFactories.HIVE_PROJECT_FACTORY, true);
+
+  public static final HiveFilterProjectTransposeRule INSTANCE =
+          new HiveFilterProjectTransposeRule(Filter.class, HiveRelFactories.HIVE_FILTER_FACTORY,
+          HiveProject.class, HiveRelFactories.HIVE_PROJECT_FACTORY, false);
+
+  private final boolean onlyDeterministic;
+
   public HiveFilterProjectTransposeRule(Class<? extends Filter> filterClass,
       FilterFactory filterFactory, Class<? extends Project> projectClass,
-      ProjectFactory projectFactory) {
+      ProjectFactory projectFactory, boolean onlyDeterministic) {
     super(filterClass, filterFactory, projectClass, projectFactory);
+    this.onlyDeterministic = onlyDeterministic;
   }
 
   @Override
   public boolean matches(RelOptRuleCall call) {
     final Filter filterRel = call.rel(0);
     RexNode condition = filterRel.getCondition();
-    if (!HiveCalciteUtil.isDeterministic(condition)) {
+    if (this.onlyDeterministic && !HiveCalciteUtil.isDeterministic(condition)) {
       return false;
     }
 
     return super.matches(call);
   }
+
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSortTransposeRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSortTransposeRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSortTransposeRule.java
new file mode 100644
index 0000000..cfd879f
--- /dev/null
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveFilterSortTransposeRule.java
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.optimizer.calcite.rules;
+
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.RelNode;
+import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil;
+import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter;
+import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveSortLimit;
+
+import com.google.common.collect.ImmutableList;
+
+public class HiveFilterSortTransposeRule extends RelOptRule {
+
+  public static final HiveFilterSortTransposeRule INSTANCE =
+      new HiveFilterSortTransposeRule();
+
+  //~ Constructors -----------------------------------------------------------
+
+  /**
+   * Creates a HiveFilterSortTransposeRule.
+   */
+  private HiveFilterSortTransposeRule() {
+    super(
+        operand(
+            HiveFilter.class,
+            operand(HiveSortLimit.class, any())));
+  }
+
+  //~ Methods ----------------------------------------------------------------
+
+  public boolean matches(RelOptRuleCall call) {
+    final HiveSortLimit sort = call.rel(1);
+
+    // If sort contains a limit operation, we bail out
+    if (HiveCalciteUtil.limitRelNode(sort)) {
+      return false;
+    }
+
+    return true;
+  }
+
+  public void onMatch(RelOptRuleCall call) {
+    final HiveFilter filter = call.rel(0);
+    final HiveSortLimit sort = call.rel(1);
+
+    final RelNode newFilter = filter.copy(sort.getInput().getTraitSet(),
+            ImmutableList.<RelNode>of(sort.getInput()));
+    final HiveSortLimit newSort = sort.copy(sort.getTraitSet(),
+            newFilter, sort.collation, sort.offset, sort.fetch);
+
+    call.transformTo(newSort);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
index c8de1d8..de880ce 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
@@ -36,19 +36,13 @@ import org.apache.calcite.rex.RexCall;
 import org.apache.calcite.rex.RexNode;
 import org.apache.calcite.rex.RexUtil;
 import org.apache.calcite.sql.SqlKind;
-import org.apache.calcite.sql.SqlOperator;
-import org.apache.calcite.sql.type.SqlTypeName;
-import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
 import org.apache.hadoop.hive.ql.optimizer.calcite.CalciteSemanticException;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil.JoinLeafPredicateInfo;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil.JoinPredicateInfo;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveRelFactories;
 import org.apache.hadoop.hive.ql.optimizer.calcite.reloperators.HiveFilter;
-import org.apache.hadoop.hive.ql.optimizer.calcite.translator.SqlFunctionConverter;
-import org.apache.hadoop.hive.ql.parse.SemanticException;
-
-import com.google.common.collect.ImmutableList;
 
 public final class HiveJoinAddNotNullRule extends RelOptRule {
 
@@ -146,9 +140,6 @@ public final class HiveJoinAddNotNullRule extends RelOptRule {
 
     boolean added = false;
 
-    final RelDataType returnType = cluster.getTypeFactory().
-            createSqlType(SqlTypeName.BOOLEAN);
-
     final Map<String,RexNode> newConditions;
     if (input instanceof HiveFilter) {
       newConditions = splitCondition(((HiveFilter) input).getCondition());
@@ -157,23 +148,17 @@ public final class HiveJoinAddNotNullRule extends RelOptRule {
       newConditions = new HashMap<String,RexNode>();
     }
     for (int pos : inputKeyPositions) {
-      try {
-        RelDataType keyType = input.getRowType().getFieldList().get(pos).getType();
-        // Nothing to do if key cannot be null
-        if (!keyType.isNullable()) {
-          continue;
-        }
-        SqlOperator funcCall = SqlFunctionConverter.getCalciteOperator(NOT_NULL_FUNC_NAME,
-                FunctionRegistry.getFunctionInfo(NOT_NULL_FUNC_NAME).getGenericUDF(),
-                ImmutableList.of(keyType), returnType);
-        RexNode cond = rexBuilder.makeCall(funcCall, rexBuilder.makeInputRef(input, pos));
-        String digest = cond.toString();
-        if (!newConditions.containsKey(digest)) {
-          newConditions.put(digest,cond);
-          added = true;
-        }
-      } catch (SemanticException e) {
-        throw new AssertionError(e.getMessage());
+      RelDataType keyType = input.getRowType().getFieldList().get(pos).getType();
+      // Nothing to do if key cannot be null
+      if (!keyType.isNullable()) {
+        continue;
+      }
+      RexNode cond = rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL,
+              rexBuilder.makeInputRef(input, pos));
+      String digest = cond.toString();
+      if (!newConditions.containsKey(digest)) {
+        newConditions.put(digest,cond);
+        added = true;
       }
     }
     // Nothing will be added to the expression

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
index 0ca6949..592de26 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
@@ -21,12 +21,12 @@ import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.math.BigDecimal;
+import java.util.AbstractMap.SimpleEntry;
 import java.util.ArrayList;
 import java.util.BitSet;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.AbstractMap.SimpleEntry;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -143,6 +143,7 @@ import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterJoinRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterProjectTSTransposeRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterProjectTransposeRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterSetOpTransposeRule;
+import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveFilterSortTransposeRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveInsertExchange4JoinRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveJoinAddNotNullRule;
 import org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveJoinCommuteRule;
@@ -489,6 +490,11 @@ public class CalcitePlanner extends SemanticAnalyzer {
   }
 
   @Override
+  boolean isCBOExecuted() {
+    return runCBO;
+  }
+
+  @Override
   boolean continueJoinMerge() {
     return !(runCBO && disableSemJoinReordering);
   }
@@ -995,6 +1001,9 @@ public class CalcitePlanner extends SemanticAnalyzer {
         calciteOptimizedPlan = hepPlan(calciteOptimizedPlan, false, mdProvider.getMetadataProvider(),
                 HepMatchOrder.BOTTOM_UP, ProjectRemoveRule.INSTANCE,
                 new ProjectMergeRule(false, HiveRelFactories.HIVE_PROJECT_FACTORY));
+        calciteOptimizedPlan = hepPlan(calciteOptimizedPlan, true, mdProvider.getMetadataProvider(),
+            new HiveFilterProjectTSTransposeRule(Filter.class, HiveRelFactories.HIVE_FILTER_FACTORY,
+                    HiveProject.class, HiveRelFactories.HIVE_PROJECT_FACTORY, HiveTableScan.class));
 
         // 8.2.  Introduce exchange operators below join/multijoin operators
         calciteOptimizedPlan = hepPlan(calciteOptimizedPlan, false, mdProvider.getMetadataProvider(),
@@ -1061,10 +1070,8 @@ public class CalcitePlanner extends SemanticAnalyzer {
       // TODO: Add in ReduceExpressionrules (Constant folding) to below once
       // HIVE-11927 is fixed.
       perfLogger.PerfLogBegin(this.getClass().getName(), PerfLogger.OPTIMIZER);
-      basePlan = hepPlan(basePlan, true, mdProvider, new HiveFilterProjectTransposeRule(
-          Filter.class, HiveRelFactories.HIVE_FILTER_FACTORY, HiveProject.class,
-          HiveRelFactories.HIVE_PROJECT_FACTORY), new HiveFilterSetOpTransposeRule(
-          HiveRelFactories.HIVE_FILTER_FACTORY), HiveFilterJoinRule.JOIN,
+      basePlan = hepPlan(basePlan, true, mdProvider, HiveFilterProjectTransposeRule.INSTANCE_DETERMINISTIC,
+          HiveFilterSetOpTransposeRule.INSTANCE, HiveFilterSortTransposeRule.INSTANCE, HiveFilterJoinRule.JOIN,
           HiveFilterJoinRule.FILTER_ON_JOIN, new HiveFilterAggregateTransposeRule(Filter.class,
               HiveRelFactories.HIVE_FILTER_FACTORY, Aggregate.class), new FilterMergeRule(
               HiveRelFactories.HIVE_FILTER_FACTORY));
@@ -1116,10 +1123,8 @@ public class CalcitePlanner extends SemanticAnalyzer {
       // TODO: Add in ReduceExpressionrules (Constant folding) to below once
       // HIVE-11927 is fixed.
       perfLogger.PerfLogBegin(this.getClass().getName(), PerfLogger.OPTIMIZER);
-      basePlan = hepPlan(basePlan, true, mdProvider, new HiveFilterProjectTransposeRule(
-          Filter.class, HiveRelFactories.HIVE_FILTER_FACTORY, HiveProject.class,
-          HiveRelFactories.HIVE_PROJECT_FACTORY), new HiveFilterSetOpTransposeRule(
-          HiveRelFactories.HIVE_FILTER_FACTORY), HiveFilterJoinRule.JOIN,
+      basePlan = hepPlan(basePlan, true, mdProvider, HiveFilterProjectTransposeRule.INSTANCE_DETERMINISTIC,
+          HiveFilterSetOpTransposeRule.INSTANCE, HiveFilterSortTransposeRule.INSTANCE, HiveFilterJoinRule.JOIN,
           HiveFilterJoinRule.FILTER_ON_JOIN, new HiveFilterAggregateTransposeRule(Filter.class,
               HiveRelFactories.HIVE_FILTER_FACTORY, Aggregate.class), new FilterMergeRule(
               HiveRelFactories.HIVE_FILTER_FACTORY));

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index b888860..5131951 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -7565,7 +7565,9 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
     for (int i = 0; i < srcOps.length; i++) {
       // generate a ReduceSink operator for the join
       String[] srcs = baseSrc[i] != null ? new String[] {baseSrc[i]} : joinTree.getLeftAliases();
-      srcOps[i] = genNotNullFilterForJoinSourcePlan(qb, srcOps[i], joinTree, joinKeys[i]);
+      if (!isCBOExecuted()) {
+        srcOps[i] = genNotNullFilterForJoinSourcePlan(qb, srcOps[i], joinTree, joinKeys[i]);
+      }
       srcOps[i] = genJoinReduceSinkChild(qb, joinKeys[i], srcOps[i], srcs, joinTree.getNextTag());
     }
 
@@ -8435,6 +8437,10 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
     return new ObjectPair(res, tgtToNodeExprMap);
   }
 
+  boolean isCBOExecuted() {
+    return false;
+  }
+
   boolean continueJoinMerge() {
     return true;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
index ccc4bb4..d04cb78 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java
@@ -80,6 +80,7 @@ public class FilterDesc extends AbstractOperatorDesc {
   private static final long serialVersionUID = 1L;
   private org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate;
   private boolean isSamplingPred;
+  private boolean syntheticJoinPredicate;
   private transient SampleDesc sampleDescr;
   //Is this a filter that should perform a comparison for sorted searches
   private boolean isSortedFilter;
@@ -163,6 +164,14 @@ public class FilterDesc extends AbstractOperatorDesc {
     this.isGenerated = isGenerated;
   }
 
+  public boolean isSyntheticJoinPredicate() {
+    return syntheticJoinPredicate;
+  }
+
+  public void setSyntheticJoinPredicate(boolean syntheticJoinPredicate) {
+    this.syntheticJoinPredicate = syntheticJoinPredicate;
+  }
+
   @Override
   public Object clone() {
     FilterDesc filterDesc = new FilterDesc(getPredicate().clone(), getIsSamplingPred());

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
index 1702628..4702f01 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
@@ -28,8 +28,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.Stack;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.exec.FilterOperator;
 import org.apache.hadoop.hive.ql.exec.JoinOperator;
@@ -39,6 +37,7 @@ import org.apache.hadoop.hive.ql.exec.OperatorFactory;
 import org.apache.hadoop.hive.ql.exec.PTFOperator;
 import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator;
 import org.apache.hadoop.hive.ql.exec.RowSchema;
+import org.apache.hadoop.hive.ql.exec.SelectOperator;
 import org.apache.hadoop.hive.ql.exec.TableScanOperator;
 import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.lib.Node;
@@ -75,6 +74,8 @@ import org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPLessThan;
 import org.apache.hadoop.hive.serde2.Deserializer;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.apache.hadoop.mapred.JobConf;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Operator factory for predicate pushdown processing of operator graph Each
@@ -400,6 +401,11 @@ public final class OpProcFactory {
     @Override
     public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
         Object... nodeOutputs) throws SemanticException {
+      return process(nd, stack, procCtx, false, nodeOutputs);
+    }
+
+    Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
+            boolean onlySyntheticJoinPredicate, Object... nodeOutputs) throws SemanticException {
       LOG.info("Processing for " + nd.getName() + "("
           + ((Operator) nd).getIdentifier() + ")");
 
@@ -411,7 +417,9 @@ public final class OpProcFactory {
       // Don't push a sampling predicate since createFilter() always creates filter
       // with isSamplePred = false. Also, the filterop with sampling pred is always
       // a child of TableScan, so there is no need to push this predicate.
-      if (ewi == null && !((FilterOperator)op).getConf().getIsSamplingPred()) {
+      if (ewi == null && !((FilterOperator)op).getConf().getIsSamplingPred()
+              && (!onlySyntheticJoinPredicate
+                      || ((FilterOperator)op).getConf().isSyntheticJoinPredicate())) {
         // get pushdown predicates for this operator's predicate
         ExprNodeDesc predicate = (((FilterOperator) nd).getConf()).getPredicate();
         ewi = ExprWalkerProcFactory.extractPushdownPreds(owi, op, predicate);
@@ -447,6 +455,38 @@ public final class OpProcFactory {
     }
   }
 
+  public static class SimpleFilterPPD extends FilterPPD implements NodeProcessor {
+    @Override
+    public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
+        Object... nodeOutputs) throws SemanticException {
+      FilterOperator filterOp = (FilterOperator) nd;
+      // We try to push the full Filter predicate iff:
+      // - the Filter is on top of a TableScan, or
+      // - the Filter is on top of a PTF (between PTF and Filter, there might be Select operators)
+      // Otherwise, we push only the synthetic join predicates
+      // Note : pushing Filter on top of PTF is necessary so the LimitPushdownOptimizer for Rank
+      // functions gets enabled
+      boolean parentTableScan = filterOp.getParentOperators().get(0) instanceof TableScanOperator;
+      boolean ancestorPTF = false;
+      if (!parentTableScan) {
+        Operator<?> parent = filterOp;
+        while (true) {
+          assert parent.getParentOperators().size() == 1;
+          parent = parent.getParentOperators().get(0);
+          if (parent instanceof SelectOperator) {
+            continue;
+          } else if (parent instanceof PTFOperator) {
+            ancestorPTF = true;
+            break;
+          } else {
+            break;
+          }
+        }
+      }
+      return process(nd, stack, procCtx, !parentTableScan && !ancestorPTF, nodeOutputs);
+    }
+  }
+
   /**
    * Determines predicates for which alias can be pushed to it's parents. See
    * the comments for getQualifiedAliases function.
@@ -971,6 +1011,10 @@ public final class OpProcFactory {
     return new FilterPPD();
   }
 
+  public static NodeProcessor getFilterSyntheticJoinPredicateProc() {
+    return new SimpleFilterPPD();
+  }
+
   public static NodeProcessor getJoinProc() {
     return new JoinPPD();
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/ppd/SimplePredicatePushDown.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ppd/SimplePredicatePushDown.java b/ql/src/java/org/apache/hadoop/hive/ql/ppd/SimplePredicatePushDown.java
new file mode 100644
index 0000000..2395c7a
--- /dev/null
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ppd/SimplePredicatePushDown.java
@@ -0,0 +1,110 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.ppd;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hive.ql.exec.CommonJoinOperator;
+import org.apache.hadoop.hive.ql.exec.FilterOperator;
+import org.apache.hadoop.hive.ql.exec.LateralViewForwardOperator;
+import org.apache.hadoop.hive.ql.exec.LateralViewJoinOperator;
+import org.apache.hadoop.hive.ql.exec.LimitOperator;
+import org.apache.hadoop.hive.ql.exec.Operator;
+import org.apache.hadoop.hive.ql.exec.PTFOperator;
+import org.apache.hadoop.hive.ql.exec.ReduceSinkOperator;
+import org.apache.hadoop.hive.ql.exec.ScriptOperator;
+import org.apache.hadoop.hive.ql.exec.TableScanOperator;
+import org.apache.hadoop.hive.ql.exec.UDTFOperator;
+import org.apache.hadoop.hive.ql.lib.DefaultGraphWalker;
+import org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher;
+import org.apache.hadoop.hive.ql.lib.Dispatcher;
+import org.apache.hadoop.hive.ql.lib.GraphWalker;
+import org.apache.hadoop.hive.ql.lib.Node;
+import org.apache.hadoop.hive.ql.lib.NodeProcessor;
+import org.apache.hadoop.hive.ql.lib.Rule;
+import org.apache.hadoop.hive.ql.lib.RuleRegExp;
+import org.apache.hadoop.hive.ql.optimizer.Transform;
+import org.apache.hadoop.hive.ql.parse.ParseContext;
+import org.apache.hadoop.hive.ql.parse.SemanticException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SimplePredicatePushDown extends Transform {
+
+  private static final Logger LOG = LoggerFactory.getLogger(SimplePredicatePushDown.class);
+  private ParseContext pGraphContext;
+
+  @Override
+  public ParseContext transform(ParseContext pctx) throws SemanticException {
+    pGraphContext = pctx;
+
+    // create a the context for walking operators
+    OpWalkerInfo opWalkerInfo = new OpWalkerInfo(pGraphContext);
+
+    Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>();
+    opRules.put(new RuleRegExp("R1",
+      FilterOperator.getOperatorName() + "%"),
+      OpProcFactory.getFilterSyntheticJoinPredicateProc());
+    opRules.put(new RuleRegExp("R2",
+      PTFOperator.getOperatorName() + "%"),
+      OpProcFactory.getPTFProc());
+    opRules.put(new RuleRegExp("R3",
+      CommonJoinOperator.getOperatorName() + "%"),
+      OpProcFactory.getJoinProc());
+    opRules.put(new RuleRegExp("R4",
+      TableScanOperator.getOperatorName() + "%"),
+      OpProcFactory.getTSProc());
+    opRules.put(new RuleRegExp("R5",
+      ScriptOperator.getOperatorName() + "%"),
+      OpProcFactory.getSCRProc());
+    opRules.put(new RuleRegExp("R6",
+      LimitOperator.getOperatorName() + "%"),
+      OpProcFactory.getLIMProc());
+    opRules.put(new RuleRegExp("R7",
+      UDTFOperator.getOperatorName() + "%"),
+      OpProcFactory.getUDTFProc());
+    opRules.put(new RuleRegExp("R8",
+      LateralViewForwardOperator.getOperatorName() + "%"),
+      OpProcFactory.getLVFProc());
+    opRules.put(new RuleRegExp("R9",
+      LateralViewJoinOperator.getOperatorName() + "%"),
+      OpProcFactory.getLVJProc());
+    opRules.put(new RuleRegExp("R10",
+        ReduceSinkOperator.getOperatorName() + "%"),
+        OpProcFactory.getRSProc());
+
+    // The dispatcher fires the processor corresponding to the closest matching
+    // rule and passes the context along
+    Dispatcher disp = new DefaultRuleDispatcher(OpProcFactory.getDefaultProc(),
+        opRules, opWalkerInfo);
+    GraphWalker ogw = new DefaultGraphWalker(disp);
+
+    // Create a list of topop nodes
+    ArrayList<Node> topNodes = new ArrayList<Node>();
+    topNodes.addAll(pGraphContext.getTopOps().values());
+    ogw.startWalking(topNodes, null);
+
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("After PPD:\n" + Operator.toString(pctx.getTopOps().values()));
+    }
+    return pGraphContext;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java b/ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java
index accfb3b..5d5f02d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/ppd/SyntheticJoinPredicate.java
@@ -105,7 +105,9 @@ public class SyntheticJoinPredicate extends Transform {
   // insert filter operator between target(child) and input(parent)
   private static Operator<FilterDesc> createFilter(Operator<?> target, Operator<?> parent,
       RowSchema parentRS, ExprNodeDesc filterExpr) {
-    Operator<FilterDesc> filter = OperatorFactory.get(new FilterDesc(filterExpr, false),
+    FilterDesc filterDesc = new FilterDesc(filterExpr, false);
+    filterDesc.setSyntheticJoinPredicate(true);
+    Operator<FilterDesc> filter = OperatorFactory.get(filterDesc,
         new RowSchema(parentRS.getSignature()));
     filter.getParentOperators().add(parent);
     filter.getChildOperators().add(target);

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join12.q.out b/ql/src/test/results/clientpositive/auto_join12.q.out
index 6f08aa8..8ef3664 100644
--- a/ql/src/test/results/clientpositive/auto_join12.q.out
+++ b/ql/src/test/results/clientpositive/auto_join12.q.out
@@ -41,7 +41,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -57,7 +57,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join13.q.out b/ql/src/test/results/clientpositive/auto_join13.q.out
index d29818c..fa03d2c 100644
--- a/ql/src/test/results/clientpositive/auto_join13.q.out
+++ b/ql/src/test/results/clientpositive/auto_join13.q.out
@@ -41,7 +41,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((UDFToDouble(key) < 200.0) and UDFToDouble(key) is not null) (type: boolean)
+              predicate: (UDFToDouble(key) < 200.0) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -88,30 +88,27 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col2) + UDFToDouble(_col0)) is not null (type: boolean)
-                    Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
-                        1 UDFToDouble(_col0) (type: double)
-                      outputColumnNames: _col1, _col2
+                  Map Join Operator
+                    condition map:
+                         Inner Join 0 to 1
+                    keys:
+                      0 (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
+                      1 UDFToDouble(_col0) (type: double)
+                    outputColumnNames: _col1, _col2
+                    Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: hash(_col2,_col1) (type: int)
+                      outputColumnNames: _col0
                       Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: hash(_col2,_col1) (type: int)
+                      Group By Operator
+                        aggregations: sum(_col0)
+                        mode: hash
                         outputColumnNames: _col0
-                        Statistics: Num rows: 200 Data size: 2132 Basic stats: COMPLETE Column stats: NONE
-                        Group By Operator
-                          aggregations: sum(_col0)
-                          mode: hash
-                          outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
       Local Work:
         Map Reduce Local Work
       Reduce Operator Tree:

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join16.q.out b/ql/src/test/results/clientpositive/auto_join16.q.out
index 38738ed..c1da6d2 100644
--- a/ql/src/test/results/clientpositive/auto_join16.q.out
+++ b/ql/src/test/results/clientpositive/auto_join16.q.out
@@ -32,7 +32,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) and key is not null) and value is not null) (type: boolean)
+              predicate: (((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) (type: boolean)
               Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -50,7 +50,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) and value is not null) (type: boolean)
+              predicate: (((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
               Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join2.q.out b/ql/src/test/results/clientpositive/auto_join2.q.out
index ce40ff3..26d16ee 100644
--- a/ql/src/test/results/clientpositive/auto_join2.q.out
+++ b/ql/src/test/results/clientpositive/auto_join2.q.out
@@ -51,7 +51,7 @@ STAGE PLANS:
             alias: src1
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -83,29 +83,26 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                        1 UDFToDouble(_col0) (type: double)
-                      outputColumnNames: _col0, _col3
+                  Map Join Operator
+                    condition map:
+                         Inner Join 0 to 1
+                    keys:
+                      0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                      1 UDFToDouble(_col0) (type: double)
+                    outputColumnNames: _col0, _col3
+                    Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: UDFToInteger(_col0) (type: int), _col3 (type: string)
+                      outputColumnNames: _col0, _col1
                       Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                      Select Operator
-                        expressions: UDFToInteger(_col0) (type: int), _col3 (type: string)
-                        outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
                         Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                        File Output Operator
-                          compressed: false
-                          Statistics: Num rows: 605 Data size: 6427 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
-                              name: default.dest_j2
+                        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
+                            name: default.dest_j2
       Local Work:
         Map Reduce Local Work
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join33.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join33.q.out b/ql/src/test/results/clientpositive/auto_join33.q.out
index 8b13bd0..b7aed2c 100644
--- a/ql/src/test/results/clientpositive/auto_join33.q.out
+++ b/ql/src/test/results/clientpositive/auto_join33.q.out
@@ -34,7 +34,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((UDFToDouble(key) + 1.0) < 10.0) and key is not null) and (UDFToDouble(key) + 1.0) is not null) (type: boolean)
+              predicate: (((UDFToDouble(key) + 1.0) < 10.0) and key is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -42,8 +42,8 @@ STAGE PLANS:
                 Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                 HashTable Sink Operator
                   keys:
-                    0 (UDFToDouble(_col0) + 1.0) (type: double)
-                    1 (UDFToDouble(_col0) + 2.0) (type: double)
+                    0 (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
+                    1 (UDFToDouble(_col0) + UDFToDouble(2)) (type: double)
 
   Stage: Stage-3
     Map Reduce
@@ -52,7 +52,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((UDFToDouble(key) + 2.0) < 10.0) and key is not null) and (UDFToDouble(key) + 2.0) is not null) (type: boolean)
+              predicate: (((UDFToDouble(key) + 2.0) < 10.0) and key is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -62,8 +62,8 @@ STAGE PLANS:
                   condition map:
                        Inner Join 0 to 1
                   keys:
-                    0 (UDFToDouble(_col0) + 1.0) (type: double)
-                    1 (UDFToDouble(_col0) + 2.0) (type: double)
+                    0 (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
+                    1 (UDFToDouble(_col0) + UDFToDouble(2)) (type: double)
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
                   File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_filters.q.out b/ql/src/test/results/clientpositive/auto_join_filters.q.out
index e0ed373..2fdf470 100644
--- a/ql/src/test/results/clientpositive/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_filters.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in3.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value))  FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -300,7 +300,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in2.txt' into table sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@smb_input2
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -310,7 +310,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -320,7 +320,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join_nulls.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_nulls.q.out b/ql/src/test/results/clientpositive/auto_join_nulls.q.out
index 954bf06..4af5535 100644
--- a/ql/src/test/results/clientpositive/auto_join_nulls.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_nulls.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in1.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_stats.q.out b/ql/src/test/results/clientpositive/auto_join_stats.q.out
index feb8186..9d9e111 100644
--- a/ql/src/test/results/clientpositive/auto_join_stats.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_stats.q.out
@@ -91,15 +91,12 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+                  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
       Local Work:
         Map Reduce Local Work
 
@@ -115,7 +112,7 @@ STAGE PLANS:
             alias: smalltable
             Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -192,15 +189,12 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+                  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
       Local Work:
         Map Reduce Local Work
 
@@ -246,15 +240,12 @@ STAGE PLANS:
             1 _col0 (type: string)
           outputColumnNames: _col0, _col1
           Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-            Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+          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
@@ -361,15 +352,12 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+                  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
       Local Work:
         Map Reduce Local Work
 
@@ -388,7 +376,7 @@ STAGE PLANS:
             alias: smalltable
             Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -403,7 +391,7 @@ STAGE PLANS:
             alias: smalltable2
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -426,24 +414,21 @@ STAGE PLANS:
                 1 UDFToDouble(_col0) (type: double)
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                Map Join Operator
-                  condition map:
-                       Inner Join 0 to 1
-                  keys:
-                    0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                    1 UDFToDouble(_col0) (type: double)
-                  outputColumnNames: _col0, _col1, _col2
+              Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                  1 UDFToDouble(_col0) (type: double)
+                outputColumnNames: _col0, _col1, _col2
+                Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
                   Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
-                  File Output Operator
-                    compressed: false
-                    Statistics: Num rows: 665 Data size: 7069 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
+                  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
       Local Work:
         Map Reduce Local Work
 
@@ -491,15 +476,12 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+                  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
       Local Work:
         Map Reduce Local Work
 
@@ -545,15 +527,12 @@ STAGE PLANS:
             1 _col0 (type: string)
           outputColumnNames: _col0, _col1
           Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-            Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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
+          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/827ff37f/ql/src/test/results/clientpositive/auto_join_stats2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_stats2.q.out b/ql/src/test/results/clientpositive/auto_join_stats2.q.out
index e0d0146..007ea03 100644
--- a/ql/src/test/results/clientpositive/auto_join_stats2.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_stats2.q.out
@@ -60,7 +60,7 @@ STAGE PLANS:
             alias: smalltable
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -92,24 +92,21 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                    Map Join Operator
-                      condition map:
-                           Inner Join 0 to 1
-                      keys:
-                        0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                        1 UDFToDouble(_col0) (type: double)
-                      outputColumnNames: _col0, _col1, _col2
+                  Map Join Operator
+                    condition map:
+                         Inner Join 0 to 1
+                    keys:
+                      0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                      1 UDFToDouble(_col0) (type: double)
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+                    File Output Operator
+                      compressed: false
                       Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                      File Output Operator
-                        compressed: false
-                        Statistics: Num rows: 605 Data size: 6427 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
+                      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
       Local Work:
         Map Reduce Local Work
 
@@ -198,7 +195,7 @@ STAGE PLANS:
             alias: smalltable
             Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -213,7 +210,7 @@ STAGE PLANS:
             alias: smalltable2
             Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -245,9 +242,14 @@ STAGE PLANS:
                     1 _col0 (type: string)
                   outputColumnNames: _col0, _col1
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+                  Map Join Operator
+                    condition map:
+                         Inner Join 0 to 1
+                    keys:
+                      0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                      1 UDFToDouble(_col0) (type: double)
+                    outputColumnNames: _col0, _col1, _col2
+                    Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
                     Map Join Operator
                       condition map:
                            Inner Join 0 to 1
@@ -255,25 +257,14 @@ STAGE PLANS:
                         0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
                         1 UDFToDouble(_col0) (type: double)
                       outputColumnNames: _col0, _col1, _col2
-                      Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
-                        Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-                        Map Join Operator
-                          condition map:
-                               Inner Join 0 to 1
-                          keys:
-                            0 (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                            1 UDFToDouble(_col0) (type: double)
-                          outputColumnNames: _col0, _col1, _col2
-                          Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 665 Data size: 7069 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
+                      Statistics: Num rows: 665 Data size: 7069 Basic stats: COMPLETE Column stats: NONE
+                      File Output Operator
+                        compressed: false
+                        Statistics: Num rows: 665 Data size: 7069 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
       Local Work:
         Map Reduce Local Work
 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_join_without_localtask.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_join_without_localtask.q.out b/ql/src/test/results/clientpositive/auto_join_without_localtask.q.out
index c63016d..d40b165 100644
--- a/ql/src/test/results/clientpositive/auto_join_without_localtask.q.out
+++ b/ql/src/test/results/clientpositive/auto_join_without_localtask.q.out
@@ -704,7 +704,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 100.0) and value is not null) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 100.0) and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -889,7 +889,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 100.0) and value is not null) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 100.0) and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -937,7 +937,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 100.0) and value is not null) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 100.0) and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)


[09/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/subquery_exists.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/subquery_exists.q.out b/ql/src/test/results/clientpositive/spark/subquery_exists.q.out
index 06c34b9..5f41ac7 100644
--- a/ql/src/test/results/clientpositive/spark/subquery_exists.q.out
+++ b/ql/src/test/results/clientpositive/spark/subquery_exists.q.out
@@ -41,7 +41,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_9') and key is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -58,7 +58,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_9') and key is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: value (type: string), key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/subquery_in.q.out b/ql/src/test/results/clientpositive/spark/subquery_in.q.out
index ec18be8..1d813f8 100644
--- a/ql/src/test/results/clientpositive/spark/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/spark/subquery_in.q.out
@@ -149,7 +149,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -166,7 +166,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -282,15 +282,12 @@ STAGE PLANS:
                       expressions: p_name (type: string), p_size (type: int), UDFToDouble(p_size) (type: double)
                       outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col2 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col2 (type: double)
+                        sort order: +
+                        Map-reduce partition columns: _col2 (type: double)
                         Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col2 (type: double)
-                          sort order: +
-                          Map-reduce partition columns: _col2 (type: double)
-                          Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col0 (type: string), _col1 (type: int)
+                        value expressions: _col0 (type: string), _col1 (type: int)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -632,7 +629,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -649,7 +646,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/table_access_keys_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/table_access_keys_stats.q.out b/ql/src/test/results/clientpositive/spark/table_access_keys_stats.q.out
index 7be8eca..f2c7b08 100644
--- a/ql/src/test/results/clientpositive/spark/table_access_keys_stats.q.out
+++ b/ql/src/test/results/clientpositive/spark/table_access_keys_stats.q.out
@@ -277,7 +277,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -296,7 +296,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key,val
 Table:default@t2
@@ -330,7 +330,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -351,7 +351,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -369,7 +369,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -390,7 +390,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -411,7 +411,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
@@ -435,7 +435,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -472,7 +472,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
@@ -503,13 +503,13 @@ PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 PREHOOK: Input: default@t3
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
 Keys:key
 
-Operator:GBY_18
+Operator:GBY_16
 Table:default@t3
 Keys:val
 
@@ -541,7 +541,7 @@ PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 PREHOOK: Input: default@t3
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_exists.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_exists.q.out b/ql/src/test/results/clientpositive/subquery_exists.q.out
index 9683e08..f3a2705 100644
--- a/ql/src/test/results/clientpositive/subquery_exists.q.out
+++ b/ql/src/test/results/clientpositive/subquery_exists.q.out
@@ -36,7 +36,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+              predicate: ((value > 'val_9') and key is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -51,7 +51,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+              predicate: ((value > 'val_9') and key is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: value (type: string), key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_in.q.out b/ql/src/test/results/clientpositive/subquery_in.q.out
index cb30789..a374dc0 100644
--- a/ql/src/test/results/clientpositive/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/subquery_in.q.out
@@ -136,7 +136,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -151,7 +151,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -347,15 +347,12 @@ STAGE PLANS:
                 expressions: p_name (type: string), p_size (type: int), UDFToDouble(p_size) (type: double)
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col2 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col2 (type: double)
+                  sort order: +
+                  Map-reduce partition columns: _col2 (type: double)
                   Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col2 (type: double)
-                    sort order: +
-                    Map-reduce partition columns: _col2 (type: double)
-                    Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: string), _col1 (type: int)
+                  value expressions: _col0 (type: string), _col1 (type: int)
           TableScan
             Reduce Output Operator
               key expressions: _col0 (type: double)
@@ -635,7 +632,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 keys: key (type: string), value (type: string)
@@ -672,7 +669,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_in_having.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_in_having.q.out b/ql/src/test/results/clientpositive/subquery_in_having.q.out
index 73250bd..87c5a62 100644
--- a/ql/src/test/results/clientpositive/subquery_in_having.q.out
+++ b/ql/src/test/results/clientpositive/subquery_in_having.q.out
@@ -375,13 +375,13 @@ STAGE PLANS:
           Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: _col1 (type: string), _col2 (type: bigint)
-            outputColumnNames: _col1, _col2
+            outputColumnNames: _col0, _col2
             Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: _col2 is not null (type: boolean)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
               Select Operator
-                expressions: _col2 (type: bigint), _col1 (type: string)
+                expressions: _col2 (type: bigint), _col0 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_notin_having.q.java1.7.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_notin_having.q.java1.7.out b/ql/src/test/results/clientpositive/subquery_notin_having.q.java1.7.out
index 7b7ccda..d6c6edc 100644
--- a/ql/src/test/results/clientpositive/subquery_notin_having.q.java1.7.out
+++ b/ql/src/test/results/clientpositive/subquery_notin_having.q.java1.7.out
@@ -354,7 +354,7 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2
           Statistics: Num rows: 13 Data size: 1573 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
-            predicate: ((_col0 is null or _col1 is null) and ((_col2 - _col1) > 600.0)) (type: boolean)
+            predicate: (((_col2 - _col1) > 600.0) and (_col0 is null or _col1 is null)) (type: boolean)
             Statistics: Num rows: 2 Data size: 242 Basic stats: COMPLETE Column stats: NONE
             Select Operator
               Statistics: Num rows: 2 Data size: 242 Basic stats: COMPLETE Column stats: NONE

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out b/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
index 3241787..ad5f72b 100644
--- a/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
+++ b/ql/src/test/results/clientpositive/subquery_unqualcolumnrefs.q.out
@@ -52,7 +52,7 @@ STAGE PLANS:
             alias: src11
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
-              predicate: (((key1 > '9') and value1 is not null) and key1 is not null) (type: boolean)
+              predicate: ((key1 > '9') and value1 is not null) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
                 expressions: key1 (type: string), value1 (type: string)
@@ -67,7 +67,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -122,7 +122,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -137,7 +137,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -549,7 +549,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Group By Operator
                 keys: key (type: string), value (type: string)
@@ -586,7 +586,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+              predicate: ((key > '9') and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -748,13 +748,13 @@ STAGE PLANS:
           Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
           Select Operator
             expressions: _col1 (type: string), _col2 (type: bigint)
-            outputColumnNames: _col1, _col2
+            outputColumnNames: _col0, _col2
             Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
               predicate: _col2 is not null (type: boolean)
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
               Select Operator
-                expressions: _col2 (type: bigint), _col1 (type: string)
+                expressions: _col2 (type: bigint), _col0 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/subquery_views.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/subquery_views.q.out b/ql/src/test/results/clientpositive/subquery_views.q.out
index 00c9bd8..76e53d3 100644
--- a/ql/src/test/results/clientpositive/subquery_views.q.out
+++ b/ql/src/test/results/clientpositive/subquery_views.q.out
@@ -220,7 +220,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((value > 'val_11') and key is not null) (type: boolean)
+              predicate: (value > 'val_11') (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), key (type: string)
@@ -375,7 +375,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((value > 'val_11') and (key < '11')) and key is not null) (type: boolean)
+              predicate: ((value > 'val_11') and (key < '11')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string), key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/table_access_keys_stats.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/table_access_keys_stats.q.out b/ql/src/test/results/clientpositive/table_access_keys_stats.q.out
index 7be8eca..f2c7b08 100644
--- a/ql/src/test/results/clientpositive/table_access_keys_stats.q.out
+++ b/ql/src/test/results/clientpositive/table_access_keys_stats.q.out
@@ -277,7 +277,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -296,7 +296,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key,val
 Table:default@t2
@@ -330,7 +330,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -351,7 +351,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -369,7 +369,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -390,7 +390,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val
 Table:default@t2
@@ -411,7 +411,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
@@ -435,7 +435,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:key
 Table:default@t2
@@ -472,7 +472,7 @@ PREHOOK: type: QUERY
 PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
@@ -503,13 +503,13 @@ PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 PREHOOK: Input: default@t3
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2
 Keys:key
 
-Operator:GBY_18
+Operator:GBY_16
 Table:default@t3
 Keys:val
 
@@ -541,7 +541,7 @@ PREHOOK: Input: default@t1
 PREHOOK: Input: default@t2
 PREHOOK: Input: default@t3
 #### A masked pattern was here ####
-Operator:JOIN_10
+Operator:JOIN_8
 Table:default@t1
 Keys:val,key
 Table:default@t2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/auto_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_join_filters.q.out b/ql/src/test/results/clientpositive/tez/auto_join_filters.q.out
index d44fff3..1559d4b 100644
--- a/ql/src/test/results/clientpositive/tez/auto_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_join_filters.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in3.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value))  FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -300,7 +300,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in2.txt' into table sm
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@smb_input2
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -310,7 +310,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a LEFT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -320,7 +320,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Map 2' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Map 2' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a RIGHT OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1
@@ -330,7 +330,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@myinput1
 #### A masked pattern was here ####
 3078400
-Warning: Shuffle Join MERGEJOIN[22][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[20][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a FULL OUTER JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/auto_join_nulls.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_join_nulls.q.out b/ql/src/test/results/clientpositive/tez/auto_join_nulls.q.out
index a390851..5b68bb7 100644
--- a/ql/src/test/results/clientpositive/tez/auto_join_nulls.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_join_nulls.q.out
@@ -14,7 +14,7 @@ POSTHOOK: query: LOAD DATA LOCAL INPATH '../../data/files/in1.txt' INTO TABLE my
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[15][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
index 17f0229..09a10bd 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_12.q.out
@@ -138,7 +138,7 @@ POSTHOOK: query: load data local inpath '../../data/files/smallsrcsortbucket3out
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_medium@ds=2008-04-08
-Warning: Map Join MAPJOIN[39][bigTable=?] in task 'Map 3' is a cross product
+Warning: Map Join MAPJOIN[35][bigTable=?] in task 'Map 3' is a cross product
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
@@ -619,7 +619,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[39][bigTable=?] in task 'Map 3' is a cross product
+Warning: Map Join MAPJOIN[35][bigTable=?] in task 'Map 3' is a cross product
 PREHOOK: query: select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@bucket_big

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_6.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_6.q.out
index 2956bf8..521485a 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_6.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_6.q.out
@@ -483,7 +483,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -494,7 +494,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -519,7 +519,7 @@ STAGE PLANS:
                   alias: c
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -955,7 +955,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -966,7 +966,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -991,7 +991,7 @@ STAGE PLANS:
                   alias: c
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_9.q.out b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_9.q.out
index fbd0bb8..98cc8cc 100644
--- a/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_9.q.out
+++ b/ql/src/test/results/clientpositive/tez/auto_sortmerge_join_9.q.out
@@ -840,7 +840,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -871,7 +871,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -992,7 +992,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -1023,7 +1023,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -1258,28 +1258,25 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
-                        Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Map Join Operator
-                          condition map:
-                               Inner Join 0 to 1
-                          keys:
-                            0 _col0 (type: int)
-                            1 _col0 (type: int)
-                          input vertices:
-                            1 Map 3
-                          Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
-                          HybridGraceHashJoin: true
-                          Group By Operator
-                            aggregations: count()
-                            mode: hash
-                            outputColumnNames: _col0
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        input vertices:
+                          1 Map 3
+                        Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
+                        HybridGraceHashJoin: true
+                        Group By Operator
+                          aggregations: count()
+                          mode: hash
+                          outputColumnNames: _col0
+                          Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                          Reduce Output Operator
+                            sort order: 
                             Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            Reduce Output Operator
-                              sort order: 
-                              Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                              value expressions: _col0 (type: bigint)
+                            value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -1292,14 +1289,11 @@ STAGE PLANS:
                       expressions: (key + 1) (type: int)
                       outputColumnNames: _col0
                       Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
                         Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
             Reduce Operator Tree:
               Group By Operator
@@ -1762,7 +1756,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -1793,7 +1787,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2654,7 +2648,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2685,7 +2679,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2806,7 +2800,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -2837,7 +2831,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -3452,7 +3446,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -3483,7 +3477,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                    predicate: ((key < 8) and (key < 6)) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/bucket_map_join_tez2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/bucket_map_join_tez2.q.out b/ql/src/test/results/clientpositive/tez/bucket_map_join_tez2.q.out
index 6adf820..c5cb360 100644
--- a/ql/src/test/results/clientpositive/tez/bucket_map_join_tez2.q.out
+++ b/ql/src/test/results/clientpositive/tez/bucket_map_join_tez2.q.out
@@ -257,7 +257,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)
@@ -275,7 +275,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -333,7 +333,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 1) and (key > 2)) and key is not null) (type: boolean)
+                    predicate: ((key > 1) and (key > 2)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -363,7 +363,7 @@ STAGE PLANS:
                   alias: tab_part
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > 2) and (key > 1)) and key is not null) (type: boolean)
+                    predicate: ((key > 2) and (key > 1)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int)
@@ -626,7 +626,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (value is not null and UDFToDouble(value) is not null) (type: boolean)
+                    predicate: value is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: value (type: string)
@@ -644,7 +644,7 @@ STAGE PLANS:
                   alias: tab
                   Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/cross_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/cross_join.q.out b/ql/src/test/results/clientpositive/tez/cross_join.q.out
index de3edbb..d397bd4 100644
--- a/ql/src/test/results/clientpositive/tez/cross_join.q.out
+++ b/ql/src/test/results/clientpositive/tez/cross_join.q.out
@@ -1,4 +1,4 @@
-Warning: Shuffle Join MERGEJOIN[11][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- current
 explain select src.key from src join src src2
 PREHOOK: type: QUERY
@@ -63,7 +63,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[11][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- ansi cross join
 explain select src.key from src cross join src src2
 PREHOOK: type: QUERY
@@ -203,7 +203,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: explain select src.key from src join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src join src src2
@@ -262,7 +262,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: explain select src.key from src cross join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src cross join src src2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/cross_product_check_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/cross_product_check_1.q.out b/ql/src/test/results/clientpositive/tez/cross_product_check_1.q.out
index 0e7c681..ca44973 100644
--- a/ql/src/test/results/clientpositive/tez/cross_product_check_1.q.out
+++ b/ql/src/test/results/clientpositive/tez/cross_product_check_1.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@B
-Warning: Shuffle Join MERGEJOIN[11][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[10][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: explain select * from A join B
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join B
@@ -94,7 +94,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[25][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product
+Warning: Shuffle Join MERGEJOIN[22][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -198,7 +198,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[30][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[27][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key
@@ -324,8 +324,8 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[24][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 4' is a cross product
-Warning: Shuffle Join MERGEJOIN[25][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[22][tables = [$hdt$_1, $hdt$_2]] in Stage 'Reducer 4' is a cross product
+Warning: Shuffle Join MERGEJOIN[23][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1  group by d1.key) od1
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1  group by d1.key) od1
@@ -434,7 +434,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[34][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 3' is a cross product
+Warning: Shuffle Join MERGEJOIN[31][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A  group by key) ss join
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/cross_product_check_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/cross_product_check_2.q.out b/ql/src/test/results/clientpositive/tez/cross_product_check_2.q.out
index efd8b5d..ecd7f6b 100644
--- a/ql/src/test/results/clientpositive/tez/cross_product_check_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/cross_product_check_2.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@B
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: explain select * from A join B
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join B
@@ -90,7 +90,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[25][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -184,7 +184,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[30][bigTable=?] in task 'Reducer 3' is a cross product
+Warning: Map Join MAPJOIN[27][bigTable=?] in task 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key 
@@ -301,8 +301,8 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[24][bigTable=?] in task 'Map 2' is a cross product
-Warning: Map Join MAPJOIN[25][bigTable=?] in task 'Reducer 3' is a cross product
+Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Map 2' is a cross product
+Warning: Map Join MAPJOIN[23][bigTable=?] in task 'Reducer 3' is a cross product
 PREHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
@@ -402,7 +402,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[34][bigTable=?] in task 'Reducer 4' is a cross product
+Warning: Map Join MAPJOIN[31][bigTable=?] in task 'Reducer 4' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A group by key) ss join 
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out b/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
index d4b670d..caa4398 100644
--- a/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
+++ b/ql/src/test/results/clientpositive/tez/dynamic_partition_pruning.q.out
@@ -1284,28 +1284,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1409,20 +1406,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
@@ -1462,7 +1456,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1534,28 +1528,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1644,20 +1635,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and (UDFToDouble(hr) * 2.0) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
@@ -1682,7 +1670,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1767,28 +1755,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
+                      sort order: +
+                      Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        sort order: +
-                        Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1820,7 +1805,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
+                  0 UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                   1 UDFToString(_col0) (type: string)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -2035,7 +2020,7 @@ POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
 #### A masked pattern was here ####
 1000
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- non-equi join
 EXPLAIN select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
@@ -2129,7 +2114,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -4138,42 +4123,39 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 UDFToDouble(_col0) (type: double)
+                        1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -4259,34 +4241,31 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 (UDFToDouble(_col0) * 2.0) (type: double)
-                          1 _col0 (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                        1 _col0 (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -5297,42 +5276,38 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart_orc
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: ds (type: string), hr (type: int)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: ds (type: string), hr (type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col0 (type: string), UDFToDouble(_col1) (type: double)
-                          1 _col0 (type: string), UDFToDouble(_col2) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 _col0 (type: string), UDFToDouble(_col1) (type: double)
+                        1 _col0 (type: string), UDFToDouble(_col2) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_date_hour
-                  filterExpr: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                   Statistics: Num rows: 4 Data size: 108 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                     Statistics: Num rows: 2 Data size: 54 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ds (type: string), hr (type: string)


[03/15] hive git commit: HIVE-11531: Add mysql-style LIMIT support to Hive, or improve ROW_NUMBER performance-wise (Hui Zheng, reviewed by Sergey Shelukhin, Jesus Camacho Rodriguez)

Posted by jc...@apache.org.
HIVE-11531: Add mysql-style LIMIT support to Hive, or improve ROW_NUMBER performance-wise (Hui Zheng, reviewed by Sergey Shelukhin, Jesus Camacho Rodriguez)


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

Branch: refs/heads/branch-2.0
Commit: 6273bee32601c759f16293fae119d7a7bb7473e1
Parents: a59d4ff
Author: Hui Zheng <hu...@yahoo-corp.jp>
Authored: Mon Dec 21 02:11:51 2015 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon Dec 21 02:11:51 2015 +0100

----------------------------------------------------------------------
 .../hadoop/hive/ql/exec/LimitOperator.java      |    6 +-
 .../ql/exec/vector/VectorLimitOperator.java     |   26 +-
 .../hive/ql/optimizer/GenMapRedUtils.java       |    3 +-
 .../hive/ql/optimizer/GlobalLimitOptimizer.java |   22 +-
 .../ql/optimizer/LimitPushdownOptimizer.java    |    5 +-
 .../calcite/reloperators/HiveSortLimit.java     |    4 +
 .../calcite/translator/ASTBuilder.java          |    5 +-
 .../calcite/translator/ASTConverter.java        |   11 +-
 .../hadoop/hive/ql/parse/CalcitePlanner.java    |   15 +-
 .../hadoop/hive/ql/parse/GlobalLimitCtx.java    |   10 +-
 .../org/apache/hadoop/hive/ql/parse/HiveLexer.g |    1 +
 .../apache/hadoop/hive/ql/parse/HiveParser.g    |    5 +-
 .../hadoop/hive/ql/parse/IdentifiersParser.g    |    2 +-
 .../hadoop/hive/ql/parse/MapReduceCompiler.java |    3 +-
 .../hadoop/hive/ql/parse/QBParseInfo.java       |   20 +-
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |   27 +-
 .../apache/hadoop/hive/ql/plan/LimitDesc.java   |   19 +
 .../test/queries/clientpositive/offset_limit.q  |   25 +
 .../offset_limit_global_optimizer.q             |   45 +
 .../clientpositive/offset_limit_ppd_optimizer.q |   80 +
 .../clientpositive/vectorization_offset_limit.q |   10 +
 .../results/clientpositive/offset_limit.q.out   |  257 ++
 .../offset_limit_global_optimizer.q.out         | 3390 ++++++++++++++++++
 .../offset_limit_ppd_optimizer.q.out            | 1377 +++++++
 .../vectorization_offset_limit.q.out            |  118 +
 25 files changed, 5442 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java
index 8fe96be..fc85bea 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/LimitOperator.java
@@ -34,6 +34,7 @@ public class LimitOperator extends Operator<LimitDesc> implements Serializable {
   private static final long serialVersionUID = 1L;
 
   protected transient int limit;
+  protected transient int offset;
   protected transient int leastRow;
   protected transient int currCount;
   protected transient boolean isMap;
@@ -43,15 +44,18 @@ public class LimitOperator extends Operator<LimitDesc> implements Serializable {
     super.initializeOp(hconf);
     limit = conf.getLimit();
     leastRow = conf.getLeastRows();
+    offset = (conf.getOffset() == null) ? 0 : conf.getOffset();
     currCount = 0;
     isMap = hconf.getBoolean("mapred.task.is.map", true);
   }
 
   @Override
   public void process(Object row, int tag) throws HiveException {
-    if (currCount < limit) {
+    if (offset <= currCount && currCount < (offset + limit)) {
       forward(row, inputObjInspectors[tag]);
       currCount++;
+    } else if (offset > currCount) {
+      currCount++;
     } else {
       setDone(true);
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorLimitOperator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorLimitOperator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorLimitOperator.java
index 2f4e46b..4cb91d4 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorLimitOperator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorLimitOperator.java
@@ -42,12 +42,30 @@ public class VectorLimitOperator extends LimitOperator  {
   public void process(Object row, int tag) throws HiveException {
     VectorizedRowBatch batch = (VectorizedRowBatch) row;
 
-    if (currCount < limit) {
-      batch.size = Math.min(batch.size, limit - currCount);
-      forward(row, inputObjInspectors[tag]);
+    if (currCount + batch.size < offset) {
       currCount += batch.size;
-    } else {
+    } else if (currCount >= offset + limit) {
       setDone(true);
+    } else {
+      int skipSize = 0;
+      if (currCount < offset) {
+        skipSize = offset - currCount;
+      }
+      //skip skipSize rows of batch
+      batch.size = Math.min(batch.size, offset + limit - currCount);
+      if (batch.selectedInUse == false) {
+        batch.selectedInUse = true;
+        batch.selected = new int[batch.size];
+        for (int i = 0; i < batch.size - skipSize; i++) {
+          batch.selected[i] = skipSize + i;
+        }
+      } else {
+        for (int i = 0; i < batch.size - skipSize; i++) {
+          batch.selected[i] = batch.selected[skipSize + i];
+        }
+      }
+      forward(row, inputObjInspectors[tag]);
+      currCount += batch.size;
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
index 0cd7b62..a42df71 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java
@@ -544,7 +544,8 @@ public final class GenMapRedUtils {
       } else {
         long sizePerRow = HiveConf.getLongVar(parseCtx.getConf(),
             HiveConf.ConfVars.HIVELIMITMAXROWSIZE);
-        sizeNeeded = parseCtx.getGlobalLimitCtx().getGlobalLimit() * sizePerRow;
+        sizeNeeded = (parseCtx.getGlobalLimitCtx().getGlobalOffset()
+            + parseCtx.getGlobalLimitCtx().getGlobalLimit()) * sizePerRow;
         // for the optimization that reduce number of input file, we limit number
         // of files allowed. If more than specific number of files have to be
         // selected, we skip this optimization. Since having too many files as

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java
index 74d6292..2062df1 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/GlobalLimitOptimizer.java
@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.hadoop.hive.ql.Context;
 import org.apache.hadoop.hive.ql.exec.FilterOperator;
 import org.apache.hadoop.hive.ql.exec.GroupByOperator;
+import org.apache.hadoop.hive.ql.plan.LimitDesc;
 import org.apache.hadoop.hive.ql.exec.LimitOperator;
 import org.apache.hadoop.hive.ql.exec.Operator;
 import org.apache.hadoop.hive.ql.exec.OperatorUtils;
@@ -93,16 +94,19 @@ public class GlobalLimitOptimizer extends Transform {
       //    SELECT * FROM (SELECT col1 as col2 (SELECT * FROM ...) t1 LIMIT ...) t2);
       //
       TableScanOperator ts = (TableScanOperator) topOps.values().toArray()[0];
-      Integer tempGlobalLimit = checkQbpForGlobalLimit(ts);
+      LimitOperator tempGlobalLimit = checkQbpForGlobalLimit(ts);
 
       // query qualify for the optimization
-      if (tempGlobalLimit != null && tempGlobalLimit != 0) {
+      if (tempGlobalLimit != null) {
+        LimitDesc tempGlobalLimitDesc = tempGlobalLimit.getConf();
         Table tab = ts.getConf().getTableMetadata();
         Set<FilterOperator> filterOps = OperatorUtils.findOperators(ts, FilterOperator.class);
 
         if (!tab.isPartitioned()) {
           if (filterOps.size() == 0) {
-            globalLimitCtx.enableOpt(tempGlobalLimit);
+            Integer tempOffset = tempGlobalLimitDesc.getOffset();
+            globalLimitCtx.enableOpt(tempGlobalLimitDesc.getLimit(),
+                (tempOffset == null) ? 0 : tempOffset);
           }
         } else {
           // check if the pruner only contains partition columns
@@ -114,11 +118,15 @@ public class GlobalLimitOptimizer extends Transform {
             // If there is any unknown partition, create a map-reduce job for
             // the filter to prune correctly
             if (!partsList.hasUnknownPartitions()) {
-              globalLimitCtx.enableOpt(tempGlobalLimit);
+              Integer tempOffset = tempGlobalLimitDesc.getOffset();
+              globalLimitCtx.enableOpt(tempGlobalLimitDesc.getLimit(),
+                  (tempOffset == null) ? 0 : tempOffset);
             }
           }
         }
         if (globalLimitCtx.isEnable()) {
+          LOG.info("Qualify the optimize that reduces input size for 'offset' for offset "
+              + globalLimitCtx.getGlobalOffset());
           LOG.info("Qualify the optimize that reduces input size for 'limit' for limit "
               + globalLimitCtx.getGlobalLimit());
         }
@@ -143,7 +151,7 @@ public class GlobalLimitOptimizer extends Transform {
    *         if there is no limit, return 0
    *         otherwise, return null
    */
-  private static Integer checkQbpForGlobalLimit(TableScanOperator ts) {
+  private static LimitOperator checkQbpForGlobalLimit(TableScanOperator ts) {
     Set<Class<? extends Operator<?>>> searchedClasses =
           new ImmutableSet.Builder<Class<? extends Operator<?>>>()
             .add(ReduceSinkOperator.class)
@@ -185,10 +193,10 @@ public class GlobalLimitOptimizer extends Transform {
     // Otherwise, return null
     Collection<Operator<?>> limitOps = ops.get(LimitOperator.class);
     if (limitOps.size() == 1) {
-      return ((LimitOperator) limitOps.iterator().next()).getConf().getLimit();
+      return (LimitOperator) limitOps.iterator().next();
     }
     else if (limitOps.size() == 0) {
-      return 0;
+      return null;
     }
     return null;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java
index 5a55061..4ca2d7d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/LimitPushdownOptimizer.java
@@ -41,6 +41,7 @@ import org.apache.hadoop.hive.ql.lib.Rule;
 import org.apache.hadoop.hive.ql.lib.RuleRegExp;
 import org.apache.hadoop.hive.ql.parse.ParseContext;
 import org.apache.hadoop.hive.ql.parse.SemanticException;
+import org.apache.hadoop.hive.ql.plan.LimitDesc;
 
 /**
  * Make RS calculate top-K selection for limit clause.
@@ -130,7 +131,9 @@ public class LimitPushdownOptimizer extends Transform {
           return false;
         }
         LimitOperator limit = (LimitOperator) nd;
-        rs.getConf().setTopN(limit.getConf().getLimit());
+        LimitDesc limitDesc = limit.getConf();
+        Integer offset = limitDesc.getOffset();
+        rs.getConf().setTopN(limitDesc.getLimit() + ((offset == null) ? 0 : offset));
         rs.getConf().setTopNMemoryUsage(((LimitPushdownContext) procCtx).threshold);
         if (rs.getNumChild() == 1 && rs.getChildren().get(0) instanceof GroupByOperator) {
           rs.getConf().setMapGroupBy(true);

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveSortLimit.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveSortLimit.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveSortLimit.java
index 0c8728d..6ed2914 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveSortLimit.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveSortLimit.java
@@ -83,6 +83,10 @@ public class HiveSortLimit extends Sort implements HiveRelNode {
     return fetch;
   }
 
+  public RexNode getOffsetExpr() {
+    return offset;
+  }
+
   public void setInputRefToCallMap(ImmutableMap<Integer, RexNode> refToCall) {
     this.mapOfInputRefToRexCall = refToCall;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java
index 1f5d919..425514d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java
@@ -128,9 +128,10 @@ class ASTBuilder {
     return ASTBuilder.construct(HiveParser.TOK_HAVING, "TOK_HAVING").add(cond).node();
   }
 
-  static ASTNode limit(Object value) {
+  static ASTNode limit(Object offset, Object limit) {
     return ASTBuilder.construct(HiveParser.TOK_LIMIT, "TOK_LIMIT")
-        .add(HiveParser.Number, value.toString()).node();
+        .add(HiveParser.Number, offset.toString())
+        .add(HiveParser.Number, limit.toString()).node();
   }
 
   static ASTNode selectExpr(ASTNode expr, String alias) {

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
index d026e58..3f2267d 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java
@@ -251,10 +251,13 @@ public class ASTConverter {
         hiveAST.order = orderAst;
       }
 
-      RexNode limitExpr = hiveSortLimit.getFetchExpr();
-      if (limitExpr != null) {
-        Object val = ((RexLiteral) limitExpr).getValue2();
-        hiveAST.limit = ASTBuilder.limit(val);
+      RexNode offsetExpr = hiveSortLimit.getOffsetExpr();
+      RexNode fetchExpr = hiveSortLimit.getFetchExpr();
+      if (fetchExpr != null) {
+        Object offset = (offsetExpr == null) ?
+            new Integer(0) : ((RexLiteral) offsetExpr).getValue2();
+        Object fetch = ((RexLiteral) fetchExpr).getValue2();
+        hiveAST.limit = ASTBuilder.limit(offset, fetch);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
index 20945a0..0ca6949 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
@@ -26,6 +26,7 @@ import java.util.BitSet;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashMap;
+import java.util.AbstractMap.SimpleEntry;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -2440,13 +2441,17 @@ public class CalcitePlanner extends SemanticAnalyzer {
     private RelNode genLimitLogicalPlan(QB qb, RelNode srcRel) throws SemanticException {
       HiveRelNode sortRel = null;
       QBParseInfo qbp = getQBParseInfo(qb);
-      Integer limit = qbp.getDestToLimit().get(qbp.getClauseNames().iterator().next());
-
-      if (limit != null) {
-        RexNode fetch = cluster.getRexBuilder().makeExactLiteral(BigDecimal.valueOf(limit));
+      SimpleEntry<Integer,Integer> entry =
+          qbp.getDestToLimit().get(qbp.getClauseNames().iterator().next());
+      Integer offset = (entry == null) ? 0 : entry.getKey();
+      Integer fetch = (entry == null) ? null : entry.getValue();
+
+      if (fetch != null) {
+        RexNode offsetRN = cluster.getRexBuilder().makeExactLiteral(BigDecimal.valueOf(offset));
+        RexNode fetchRN = cluster.getRexBuilder().makeExactLiteral(BigDecimal.valueOf(fetch));
         RelTraitSet traitSet = cluster.traitSetOf(HiveRelNode.CONVENTION);
         RelCollation canonizedCollation = traitSet.canonize(RelCollations.EMPTY);
-        sortRel = new HiveSortLimit(cluster, traitSet, srcRel, canonizedCollation, null, fetch);
+        sortRel = new HiveSortLimit(cluster, traitSet, srcRel, canonizedCollation, offsetRN, fetchRN);
 
         RowResolver outputRR = new RowResolver();
         if (!RowResolver.add(outputRR, relToHiveRR.get(srcRel))) {

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/GlobalLimitCtx.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/GlobalLimitCtx.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/GlobalLimitCtx.java
index 6cd636c..c37f9ce 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/GlobalLimitCtx.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/GlobalLimitCtx.java
@@ -27,6 +27,7 @@ public class GlobalLimitCtx {
 
   private boolean enable;
   private int globalLimit;
+  private int globalOffset;
   private boolean hasTransformOrUDTF;
   private LimitDesc lastReduceLimitDesc;
 
@@ -38,6 +39,10 @@ public class GlobalLimitCtx {
     return globalLimit;
   }
 
+  public int getGlobalOffset() {
+    return globalOffset;
+  }
+
   public boolean ifHasTransformOrUDTF() {
     return hasTransformOrUDTF;
   }
@@ -58,20 +63,23 @@ public class GlobalLimitCtx {
     return enable;
   }
 
-  public void enableOpt(int globalLimit) {
+  public void enableOpt(int globalLimit, int globalOffset) {
     this.enable = true;
     this.globalLimit = globalLimit;
+    this.globalOffset = globalOffset;
   }
 
   public void disableOpt() {
     this.enable = false;
     this.globalLimit = -1;
+    this.globalOffset = 0;
     this.lastReduceLimitDesc = null;
   }
 
   public void reset() {
     enable = false;
     globalLimit = -1;
+    globalOffset = 0;
     hasTransformOrUDTF = false;
     lastReduceLimitDesc = null;
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
index 395152f..1c72b1c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
@@ -185,6 +185,7 @@ KW_DEFERRED: 'DEFERRED';
 KW_SERDEPROPERTIES: 'SERDEPROPERTIES';
 KW_DBPROPERTIES: 'DBPROPERTIES';
 KW_LIMIT: 'LIMIT';
+KW_OFFSET: 'OFFSET';
 KW_SET: 'SET';
 KW_UNSET: 'UNSET';
 KW_TBLPROPERTIES: 'TBLPROPERTIES';

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
index f6ea2a3..d5051ce 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
@@ -249,6 +249,7 @@ TOK_INDEXPROPERTIES;
 TOK_INDEXPROPLIST;
 TOK_TABTYPE;
 TOK_LIMIT;
+TOK_OFFSET;
 TOK_TABLEPROPERTY;
 TOK_IFEXISTS;
 TOK_IFNOTEXISTS;
@@ -497,6 +498,7 @@ import org.apache.hadoop.hive.conf.HiveConf;
     xlateMap.put("KW_WITH", "WITH");
     xlateMap.put("KW_SERDEPROPERTIES", "SERDEPROPERTIES");
     xlateMap.put("KW_LIMIT", "LIMIT");
+    xlateMap.put("KW_OFFSET", "OFFSET");
     xlateMap.put("KW_SET", "SET");
     xlateMap.put("KW_PROPERTIES", "TBLPROPERTIES");
     xlateMap.put("KW_VALUE_TYPE", "\$VALUE\$");
@@ -2362,7 +2364,8 @@ limitClause
 @init { pushMsg("limit clause", state); }
 @after { popMsg(state); }
    :
-   KW_LIMIT num=Number -> ^(TOK_LIMIT $num)
+   KW_LIMIT ((offset=Number COMMA)? num=Number) -> ^(TOK_LIMIT ($offset)? $num)
+   | KW_LIMIT num=Number KW_OFFSET offset=Number -> ^(TOK_LIMIT ($offset)? $num)
    ;
 
 //DELETE FROM <tableName> WHERE ...;

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
index bac0d22..15ca754 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g
@@ -653,7 +653,7 @@ nonReserved
     | KW_ENABLE | KW_ESCAPED | KW_EXCLUSIVE | KW_EXPLAIN | KW_EXPORT | KW_FIELDS | KW_FILE | KW_FILEFORMAT
     | KW_FIRST | KW_FORMAT | KW_FORMATTED | KW_FUNCTIONS | KW_HOLD_DDLTIME | KW_HOUR | KW_IDXPROPERTIES | KW_IGNORE
     | KW_INDEX | KW_INDEXES | KW_INPATH | KW_INPUTDRIVER | KW_INPUTFORMAT | KW_ITEMS | KW_JAR
-    | KW_KEYS | KW_KEY_TYPE | KW_LIMIT | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
+    | KW_KEYS | KW_KEY_TYPE | KW_LIMIT | KW_OFFSET | KW_LINES | KW_LOAD | KW_LOCATION | KW_LOCK | KW_LOCKS | KW_LOGICAL | KW_LONG
     | KW_MAPJOIN | KW_MATERIALIZED | KW_METADATA | KW_MINUS | KW_MINUTE | KW_MONTH | KW_MSCK | KW_NOSCAN | KW_NO_DROP | KW_OFFLINE
     | KW_OPTION | KW_OUTPUTDRIVER | KW_OUTPUTFORMAT | KW_OVERWRITE | KW_OWNER | KW_PARTITIONED | KW_PARTITIONS | KW_PLUS | KW_PRETTY
     | KW_PRINCIPALS | KW_PROTECTION | KW_PURGE | KW_READ | KW_READONLY | KW_REBUILD | KW_RECORDREADER | KW_RECORDWRITER

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/MapReduceCompiler.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/MapReduceCompiler.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/MapReduceCompiler.java
index d41253f..5b08ed2 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/MapReduceCompiler.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/MapReduceCompiler.java
@@ -215,7 +215,8 @@ public class MapReduceCompiler extends TaskCompiler {
           //
           long sizePerRow = HiveConf.getLongVar(conf,
               HiveConf.ConfVars.HIVELIMITMAXROWSIZE);
-          estimatedInput = globalLimitCtx.getGlobalLimit() * sizePerRow;
+          estimatedInput = (globalLimitCtx.getGlobalOffset() +
+              globalLimitCtx.getGlobalLimit()) * sizePerRow;
           long minSplitSize = HiveConf.getLongVar(conf,
               HiveConf.ConfVars.MAPREDMINSPLITSIZE);
           long estimatedNumMap = inputSummary.getLength() / minSplitSize + 1;

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java
index 186c2a8..3a226e7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java
@@ -26,6 +26,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.AbstractMap.SimpleEntry;
 
 import org.antlr.runtime.tree.Tree;
 import org.slf4j.Logger;
@@ -99,7 +100,10 @@ public class QBParseInfo {
 
   /* Order by clause */
   private final HashMap<String, ASTNode> destToOrderby;
-  private final HashMap<String, Integer> destToLimit;
+  // Use SimpleEntry to save the offset and rowcount of limit clause
+  // KEY of SimpleEntry: offset
+  // VALUE of SimpleEntry: rowcount
+  private final HashMap<String, SimpleEntry<Integer, Integer>> destToLimit;
   private int outerQueryLimit;
 
   // used by GroupBy
@@ -128,7 +132,7 @@ public class QBParseInfo {
     destToDistributeby = new HashMap<String, ASTNode>();
     destToSortby = new HashMap<String, ASTNode>();
     destToOrderby = new HashMap<String, ASTNode>();
-    destToLimit = new HashMap<String, Integer>();
+    destToLimit = new HashMap<String, SimpleEntry<Integer, Integer>>();
     insertIntoTables = new HashSet<String>();
     destRollups = new HashSet<String>();
     destCubes = new HashSet<String>();
@@ -440,12 +444,16 @@ public class QBParseInfo {
     exprToColumnAlias.put(expr,  alias);
   }
 
-  public void setDestLimit(String dest, Integer limit) {
-    destToLimit.put(dest, limit);
+  public void setDestLimit(String dest, Integer offset, Integer limit) {
+    destToLimit.put(dest, new SimpleEntry<>(offset, limit));
   }
 
   public Integer getDestLimit(String dest) {
-    return destToLimit.get(dest);
+    return destToLimit.get(dest) == null ? null : destToLimit.get(dest).getValue();
+  }
+
+  public Integer getDestLimitOffset(String dest) {
+    return destToLimit.get(dest) == null ? 0 : destToLimit.get(dest).getKey();
   }
 
   /**
@@ -566,7 +574,7 @@ public class QBParseInfo {
     return tableSpecs.get(tName.next());
   }
 
-  public HashMap<String, Integer> getDestToLimit() {
+  public HashMap<String, SimpleEntry<Integer,Integer>> getDestToLimit() {
     return destToLimit;
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 5803a9c..b888860 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -1328,7 +1328,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
         break;
 
       case HiveParser.TOK_LIMIT:
-        qbp.setDestLimit(ctx_1.dest, new Integer(ast.getChild(0).getText()));
+        if (ast.getChildCount() == 2) {
+          qbp.setDestLimit(ctx_1.dest,
+              new Integer(ast.getChild(0).getText()),
+              new Integer(ast.getChild(1).getText()));
+        } else {
+          qbp.setDestLimit(ctx_1.dest, new Integer(0),
+              new Integer(ast.getChild(0).getText()));
+        }
         break;
 
       case HiveParser.TOK_ANALYZE:
@@ -6801,7 +6808,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
   }
 
   @SuppressWarnings("nls")
-  private Operator genLimitPlan(String dest, QB qb, Operator input, int limit)
+  private Operator genLimitPlan(String dest, QB qb, Operator input, int offset, int limit)
       throws SemanticException {
     // A map-only job can be optimized - instead of converting it to a
     // map-reduce job, we can have another map
@@ -6812,7 +6819,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
 
     RowResolver inputRR = opParseCtx.get(input).getRowResolver();
 
-    LimitDesc limitDesc = new LimitDesc(limit);
+    LimitDesc limitDesc = new LimitDesc(offset, limit);
     globalLimitCtx.setLastReduceLimitDesc(limitDesc);
 
     Operator limitMap = putOpInsertMap(OperatorFactory.getAndMakeChild(
@@ -6922,14 +6929,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
 
   @SuppressWarnings("nls")
   private Operator genLimitMapRedPlan(String dest, QB qb, Operator input,
-      int limit, boolean extraMRStep) throws SemanticException {
+      int offset, int limit, boolean extraMRStep) throws SemanticException {
     // A map-only job can be optimized - instead of converting it to a
     // map-reduce job, we can have another map
     // job to do the same to avoid the cost of sorting in the map-reduce phase.
     // A better approach would be to
     // write into a local file and then have a map-only job.
     // Add the limit operator to get the value fields
-    Operator curr = genLimitPlan(dest, qb, input, limit);
+    Operator curr = genLimitPlan(dest, qb, input, offset, limit);
 
     // the client requested that an extra map-reduce step be performed
     if (!extraMRStep) {
@@ -6938,7 +6945,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
 
     // Create a reduceSink operator followed by another limit
     curr = genReduceSinkPlan(dest, qb, curr, 1, false);
-    return genLimitPlan(dest, qb, curr, limit);
+    return genLimitPlan(dest, qb, curr, offset, limit);
   }
 
   private ArrayList<ExprNodeDesc> getPartitionColsFromBucketCols(String dest, QB qb, Table tab,
@@ -8871,6 +8878,7 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
 
     curr = genSelectPlan(dest, qb, curr, gbySource);
     Integer limit = qbp.getDestLimit(dest);
+    Integer offset = (qbp.getDestLimitOffset(dest) == null) ? 0 : qbp.getDestLimitOffset(dest);
 
     // Expressions are not supported currently without a alias.
 
@@ -8915,7 +8923,8 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
       if (limit != null) {
         // In case of order by, only 1 reducer is used, so no need of
         // another shuffle
-        curr = genLimitMapRedPlan(dest, qb, curr, limit.intValue(), !hasOrderBy);
+        curr = genLimitMapRedPlan(dest, qb, curr, offset.intValue(),
+            limit.intValue(), !hasOrderBy);
       }
     } else {
       // exact limit can be taken care of by the fetch operator
@@ -8928,8 +8937,8 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
           extraMRStep = false;
         }
 
-        curr = genLimitMapRedPlan(dest, qb, curr, limit.intValue(),
-            extraMRStep);
+        curr = genLimitMapRedPlan(dest, qb, curr, offset.intValue(),
+            limit.intValue(), extraMRStep);
         qb.getParseInfo().setOuterQueryLimit(limit.intValue());
       }
       if (!SessionState.get().getHiveOperation().equals(HiveOperation.CREATEVIEW)) {

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java b/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java
index f88bf63..8448a41 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/plan/LimitDesc.java
@@ -27,6 +27,7 @@ import org.apache.hadoop.hive.ql.plan.Explain.Level;
 @Explain(displayName = "Limit", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
 public class LimitDesc extends AbstractOperatorDesc {
   private static final long serialVersionUID = 1L;
+  private int offset = 0;
   private int limit;
   private int leastRows = -1;
 
@@ -37,6 +38,24 @@ public class LimitDesc extends AbstractOperatorDesc {
     this.limit = limit;
   }
 
+  public LimitDesc(final int offset, final int limit) {
+    this.offset = offset;
+    this.limit = limit;
+  }
+
+  /**
+   * not to print the offset if it is 0 we need to turn null.
+   * use Integer instead of int.
+   */
+  @Explain(displayName = "Offset of rows", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
+  public Integer getOffset() {
+    return (offset == 0) ? null : new Integer(offset);
+  }
+
+  public void setOffset(Integer offset) {
+    this.offset = offset;
+  }
+
   @Explain(displayName = "Number of rows", explainLevels = { Level.USER, Level.DEFAULT, Level.EXTENDED })
   public int getLimit() {
     return limit;

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/queries/clientpositive/offset_limit.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/offset_limit.q b/ql/src/test/queries/clientpositive/offset_limit.q
new file mode 100644
index 0000000..80d559a
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/offset_limit.q
@@ -0,0 +1,25 @@
+EXPLAIN
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300;
+
+set hive.cbo.enable=false;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100;
+
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/queries/clientpositive/offset_limit_global_optimizer.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/offset_limit_global_optimizer.q b/ql/src/test/queries/clientpositive/offset_limit_global_optimizer.q
new file mode 100644
index 0000000..5ddb9a6
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/offset_limit_global_optimizer.q
@@ -0,0 +1,45 @@
+set hive.limit.optimize.enable=true;
+set hive.limit.row.max.size=12;
+set hive.mapred.mode=nonstrict;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600;
+
+set hive.cbo.enable=false;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20;
+
+EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600;
+
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/queries/clientpositive/offset_limit_ppd_optimizer.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/offset_limit_ppd_optimizer.q b/ql/src/test/queries/clientpositive/offset_limit_ppd_optimizer.q
new file mode 100644
index 0000000..2895203
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/offset_limit_ppd_optimizer.q
@@ -0,0 +1,80 @@
+set hive.explain.user=false;
+set hive.limit.pushdown.memory.usage=0.3f;
+set hive.optimize.reducededuplication.min.reducer=1;
+
+explain
+select key,value from src order by key limit 10,20;
+select key,value from src order by key limit 10,20;
+
+explain
+select key,value from src order by key desc limit 10,20;
+select key,value from src order by key desc limit 10,20;
+
+explain
+select value, sum(key + 1) as sum from src group by value order by value limit 10,20;
+select value, sum(key + 1) as sum from src group by value order by value limit 10,20;
+
+-- deduped RS
+explain
+select value,avg(key + 1) from src group by value order by value limit 10,20;
+select value,avg(key + 1) from src group by value order by value limit 10,20;
+
+-- distincts
+explain
+select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20;
+select distinct(cdouble) as dis from alltypesorc order by dis limit 10,20;
+
+explain
+select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20;
+select ctinyint, count(distinct(cdouble)) from alltypesorc group by ctinyint order by ctinyint limit 10,20;
+
+explain
+select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20;
+select ctinyint, count(cdouble) from (select ctinyint, cdouble from alltypesorc group by ctinyint, cdouble) t1 group by ctinyint order by ctinyint limit 10,20;
+
+-- multi distinct
+explain
+select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20;
+select ctinyint, count(distinct(cstring1)), count(distinct(cstring2)) from alltypesorc group by ctinyint order by ctinyint limit 10,20;
+
+-- limit zero
+explain
+select key,value from src order by key limit 0,0;
+select key,value from src order by key limit 0,0;
+
+-- 2MR (applied to last RS)
+explain
+select value, sum(key) as sum from src group by value order by sum limit 10,20;
+select value, sum(key) as sum from src group by value order by sum limit 10,20;
+
+set hive.map.aggr=false;
+-- map aggregation disabled
+explain
+select value, sum(key) as sum from src group by value order by value limit 10,20;
+select value, sum(key) as sum from src group by value order by value limit 10,20;
+
+set hive.limit.pushdown.memory.usage=0.00002f;
+
+-- flush for order-by
+explain
+select key,value,value,value,value,value,value,value,value from src order by key limit 30,70;
+select key,value,value,value,value,value,value,value,value from src order by key limit 30,70;
+
+-- flush for group-by
+explain
+select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70;
+select sum(key) as sum from src group by concat(key,value,value,value,value,value,value,value,value,value) order by sum limit 30,70;
+
+-- subqueries
+explain
+select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5;
+select * from
+(select key, count(1) from src group by key order by key limit 10,20) subq
+join
+(select key, count(1) from src group by key order by key limit 20,20) subq2
+on subq.key=subq2.key limit 3,5;
+

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/queries/clientpositive/vectorization_offset_limit.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/vectorization_offset_limit.q b/ql/src/test/queries/clientpositive/vectorization_offset_limit.q
new file mode 100644
index 0000000..3d01154
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/vectorization_offset_limit.q
@@ -0,0 +1,10 @@
+set hive.explain.user=false;
+SET hive.vectorized.execution.enabled=true;
+set hive.mapred.mode=nonstrict;
+
+explain SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2;
+SELECT cbigint, cdouble FROM alltypesorc WHERE cbigint < cdouble and cint > 0 limit 3,2;
+
+explain
+select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3;
+select ctinyint,cdouble,csmallint from alltypesorc where ctinyint is not null order by ctinyint,cdouble limit 10,3;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/results/clientpositive/offset_limit.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/offset_limit.q.out b/ql/src/test/results/clientpositive/offset_limit.q.out
new file mode 100644
index 0000000..2092c1d
--- /dev/null
+++ b/ql/src/test/results/clientpositive/offset_limit.q.out
@@ -0,0 +1,257 @@
+PREHOOK: query: EXPLAIN
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: key, value
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Group By Operator
+                aggregations: sum(substr(value, 5))
+                keys: key (type: string)
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
+                  Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: double)
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations: sum(VALUE._col0)
+          keys: KEY._col0 (type: string)
+          mode: mergepartial
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 0.1
+              value expressions: _col1 (type: double)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: double)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 10
+            Offset of rows: 10
+            Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 10 Data size: 100 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: 10
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+116	116.0
+118	236.0
+119	357.0
+12	24.0
+120	240.0
+125	250.0
+126	126.0
+128	384.0
+129	258.0
+131	131.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	0.0
+10	10.0
+100	200.0
+103	206.0
+104	208.0
+105	105.0
+11	11.0
+111	111.0
+113	226.0
+114	114.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+10	10.0
+100	200.0
+103	206.0
+104	208.0
+105	105.0
+11	11.0
+111	111.0
+113	226.0
+114	114.0
+116	116.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+86	86.0
+87	87.0
+9	9.0
+90	270.0
+92	92.0
+95	190.0
+96	96.0
+97	194.0
+98	196.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+86	86.0
+87	87.0
+9	9.0
+90	270.0
+92	92.0
+95	190.0
+96	96.0
+97	194.0
+98	196.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 10,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+116	116.0
+118	236.0
+119	357.0
+12	24.0
+120	240.0
+125	250.0
+126	126.0
+128	384.0
+129	258.0
+131	131.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 0,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	0.0
+10	10.0
+100	200.0
+103	206.0
+104	208.0
+105	105.0
+11	11.0
+111	111.0
+113	226.0
+114	114.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 1,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+10	10.0
+100	200.0
+103	206.0
+104	208.0
+105	105.0
+11	11.0
+111	111.0
+113	226.0
+114	114.0
+116	116.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 300,100
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+86	86.0
+87	87.0
+9	9.0
+90	270.0
+92	92.0
+95	190.0
+96	96.0
+97	194.0
+98	196.0
+PREHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key ORDER BY src.key LIMIT 100 OFFSET 300
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+86	86.0
+87	87.0
+9	9.0
+90	270.0
+92	92.0
+95	190.0
+96	96.0
+97	194.0
+98	196.0


[07/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainuser_2.q.out b/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
index 61a9580..eb7d564 100644
--- a/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainuser_2.q.out
@@ -189,20 +189,20 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 3
-         File Output Operator [FS_20]
+         File Output Operator [FS_16]
             compressed:false
             Statistics:Num rows: 605 Data size: 6427 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"}
-            Select Operator [SEL_19]
+            Select Operator [SEL_15]
                outputColumnNames:["_col0","_col1","_col2"]
                Statistics:Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
-               Merge Join Operator [MERGEJOIN_30]
+               Merge Join Operator [MERGEJOIN_26]
                |  condition map:[{"":"Inner Join 0 to 1"}]
                |  keys:{"0":"_col3 (type: string)","1":"_col0 (type: string)"}
                |  outputColumnNames:["_col0","_col3","_col6"]
                |  Statistics:Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
                |<-Map 5 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_17]
+               |  Reduce Output Operator [RS_13]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -211,26 +211,26 @@ Stage-0
                |     Select Operator [SEL_8]
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |        Filter Operator [FIL_28]
+               |        Filter Operator [FIL_24]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |           TableScan [TS_6]
                |              alias:y
                |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 2 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_15]
+                  Reduce Output Operator [RS_12]
                      key expressions:_col3 (type: string)
                      Map-reduce partition columns:_col3 (type: string)
                      sort order:+
                      Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                      value expressions:_col0 (type: string)
-                     Merge Join Operator [MERGEJOIN_29]
+                     Merge Join Operator [MERGEJOIN_25]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: string)","1":"_col1 (type: string)"}
                      |  outputColumnNames:["_col0","_col3"]
                      |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                      |<-Map 1 [SIMPLE_EDGE]
-                     |  Reduce Output Operator [RS_10]
+                     |  Reduce Output Operator [RS_9]
                      |     key expressions:_col0 (type: string)
                      |     Map-reduce partition columns:_col0 (type: string)
                      |     sort order:+
@@ -238,14 +238,14 @@ Stage-0
                      |     Select Operator [SEL_2]
                      |        outputColumnNames:["_col0"]
                      |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                     |        Filter Operator [FIL_26]
+                     |        Filter Operator [FIL_22]
                      |           predicate:value is not null (type: boolean)
                      |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                      |           TableScan [TS_0]
                      |              alias:z
                      |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                      |<-Map 4 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_12]
+                        Reduce Output Operator [RS_10]
                            key expressions:_col1 (type: string)
                            Map-reduce partition columns:_col1 (type: string)
                            sort order:+
@@ -254,7 +254,7 @@ Stage-0
                            Select Operator [SEL_5]
                               outputColumnNames:["_col0","_col1"]
                               Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                              Filter Operator [FIL_27]
+                              Filter Operator [FIL_23]
                                  predicate:(key is not null and value is not null) (type: boolean)
                                  Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                                  TableScan [TS_3]
@@ -335,79 +335,79 @@ Stage-0
       limit:100
       Stage-1
          Reducer 5
-         File Output Operator [FS_69]
+         File Output Operator [FS_55]
             compressed:false
             Statistics:Num rows: 100 Data size: 1000 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"}
-            Limit [LIM_68]
+            Limit [LIM_54]
                Number of rows:100
                Statistics:Num rows: 100 Data size: 1000 Basic stats: COMPLETE Column stats: NONE
-               Select Operator [SEL_67]
+               Select Operator [SEL_53]
                |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                |  Statistics:Num rows: 805 Data size: 8553 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_66]
+                  Reduce Output Operator [RS_52]
                      key expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string)
                      sort order:+++
                      Statistics:Num rows: 805 Data size: 8553 Basic stats: COMPLETE Column stats: NONE
                      value expressions:_col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint)
-                     Select Operator [SEL_65]
+                     Select Operator [SEL_51]
                         outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                         Statistics:Num rows: 805 Data size: 8553 Basic stats: COMPLETE Column stats: NONE
-                        Group By Operator [GBY_64]
+                        Group By Operator [GBY_50]
                         |  aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"]
                         |  keys:KEY._col0 (type: string), KEY._col1 (type: string), KEY._col2 (type: string)
                         |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                         |  Statistics:Num rows: 805 Data size: 8553 Basic stats: COMPLETE Column stats: NONE
                         |<-Reducer 3 [SIMPLE_EDGE]
-                           Reduce Output Operator [RS_63]
+                           Reduce Output Operator [RS_49]
                               key expressions:_col0 (type: string), _col1 (type: string), _col2 (type: string)
                               Map-reduce partition columns:_col0 (type: string), _col1 (type: string), _col2 (type: string)
                               sort order:+++
                               Statistics:Num rows: 1610 Data size: 17107 Basic stats: COMPLETE Column stats: NONE
                               value expressions:_col3 (type: bigint), _col4 (type: bigint), _col5 (type: bigint)
-                              Group By Operator [GBY_62]
+                              Group By Operator [GBY_48]
                                  aggregations:["count(_col13)","count(_col21)","count(_col3)"]
                                  keys:_col2 (type: string), _col12 (type: string), _col20 (type: string)
                                  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                  Statistics:Num rows: 1610 Data size: 17107 Basic stats: COMPLETE Column stats: NONE
-                                 Select Operator [SEL_61]
+                                 Select Operator [SEL_47]
                                     outputColumnNames:["_col2","_col12","_col20","_col13","_col21","_col3"]
                                     Statistics:Num rows: 1610 Data size: 17107 Basic stats: COMPLETE Column stats: NONE
-                                    Merge Join Operator [MERGEJOIN_111]
+                                    Merge Join Operator [MERGEJOIN_97]
                                     |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |  keys:{"0":"_col1 (type: string), _col3 (type: string)","1":"_col15 (type: string), _col17 (type: string)"}
                                     |  outputColumnNames:["_col2","_col3","_col12","_col13","_col20","_col21"]
                                     |  Statistics:Num rows: 1610 Data size: 17107 Basic stats: COMPLETE Column stats: NONE
                                     |<-Reducer 11 [SIMPLE_EDGE]
-                                    |  Reduce Output Operator [RS_59]
+                                    |  Reduce Output Operator [RS_45]
                                     |     key expressions:_col15 (type: string), _col17 (type: string)
                                     |     Map-reduce partition columns:_col15 (type: string), _col17 (type: string)
                                     |     sort order:++
                                     |     Statistics:Num rows: 1464 Data size: 15552 Basic stats: COMPLETE Column stats: NONE
                                     |     value expressions:_col6 (type: string), _col7 (type: string), _col14 (type: string)
-                                    |     Select Operator [SEL_50]
+                                    |     Select Operator [SEL_40]
                                     |        outputColumnNames:["_col14","_col15","_col17","_col6","_col7"]
                                     |        Statistics:Num rows: 1464 Data size: 15552 Basic stats: COMPLETE Column stats: NONE
-                                    |        Merge Join Operator [MERGEJOIN_110]
+                                    |        Merge Join Operator [MERGEJOIN_96]
                                     |        |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |        |  keys:{"0":"_col4 (type: string), _col6 (type: string)","1":"_col2 (type: string), _col4 (type: string)"}
                                     |        |  outputColumnNames:["_col2","_col3","_col14","_col15","_col17"]
                                     |        |  Statistics:Num rows: 1464 Data size: 15552 Basic stats: COMPLETE Column stats: NONE
                                     |        |<-Reducer 10 [SIMPLE_EDGE]
-                                    |        |  Reduce Output Operator [RS_46]
+                                    |        |  Reduce Output Operator [RS_37]
                                     |        |     key expressions:_col4 (type: string), _col6 (type: string)
                                     |        |     Map-reduce partition columns:_col4 (type: string), _col6 (type: string)
                                     |        |     sort order:++
                                     |        |     Statistics:Num rows: 1331 Data size: 14139 Basic stats: COMPLETE Column stats: NONE
                                     |        |     value expressions:_col2 (type: string), _col3 (type: string)
-                                    |        |     Merge Join Operator [MERGEJOIN_108]
+                                    |        |     Merge Join Operator [MERGEJOIN_94]
                                     |        |     |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |        |     |  keys:{"0":"_col3 (type: string)","1":"_col1 (type: string)"}
                                     |        |     |  outputColumnNames:["_col2","_col3","_col4","_col6"]
                                     |        |     |  Statistics:Num rows: 1331 Data size: 14139 Basic stats: COMPLETE Column stats: NONE
                                     |        |     |<-Map 14 [SIMPLE_EDGE]
-                                    |        |     |  Reduce Output Operator [RS_43]
+                                    |        |     |  Reduce Output Operator [RS_35]
                                     |        |     |     key expressions:_col1 (type: string)
                                     |        |     |     Map-reduce partition columns:_col1 (type: string)
                                     |        |     |     sort order:+
@@ -415,26 +415,26 @@ Stage-0
                                     |        |     |     Select Operator [SEL_17]
                                     |        |     |        outputColumnNames:["_col1"]
                                     |        |     |        Statistics:Num rows: 12 Data size: 91 Basic stats: COMPLETE Column stats: NONE
-                                    |        |     |        Filter Operator [FIL_102]
+                                    |        |     |        Filter Operator [FIL_88]
                                     |        |     |           predicate:((key = 'src1key') and value is not null) (type: boolean)
                                     |        |     |           Statistics:Num rows: 12 Data size: 91 Basic stats: COMPLETE Column stats: NONE
                                     |        |     |           TableScan [TS_15]
                                     |        |     |              alias:src1
                                     |        |     |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                                     |        |     |<-Reducer 9 [SIMPLE_EDGE]
-                                    |        |        Reduce Output Operator [RS_41]
+                                    |        |        Reduce Output Operator [RS_34]
                                     |        |           key expressions:_col3 (type: string)
                                     |        |           Map-reduce partition columns:_col3 (type: string)
                                     |        |           sort order:+
                                     |        |           Statistics:Num rows: 1210 Data size: 12854 Basic stats: COMPLETE Column stats: NONE
                                     |        |           value expressions:_col2 (type: string), _col4 (type: string), _col6 (type: string)
-                                    |        |           Merge Join Operator [MERGEJOIN_107]
+                                    |        |           Merge Join Operator [MERGEJOIN_93]
                                     |        |           |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |        |           |  keys:{"0":"_col2 (type: string)","1":"_col0 (type: string)"}
                                     |        |           |  outputColumnNames:["_col2","_col3","_col4","_col6"]
                                     |        |           |  Statistics:Num rows: 1210 Data size: 12854 Basic stats: COMPLETE Column stats: NONE
                                     |        |           |<-Map 13 [SIMPLE_EDGE]
-                                    |        |           |  Reduce Output Operator [RS_38]
+                                    |        |           |  Reduce Output Operator [RS_32]
                                     |        |           |     key expressions:_col0 (type: string)
                                     |        |           |     Map-reduce partition columns:_col0 (type: string)
                                     |        |           |     sort order:+
@@ -442,26 +442,26 @@ Stage-0
                                     |        |           |     Select Operator [SEL_14]
                                     |        |           |        outputColumnNames:["_col0"]
                                     |        |           |        Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-                                    |        |           |        Filter Operator [FIL_101]
+                                    |        |           |        Filter Operator [FIL_87]
                                     |        |           |           predicate:((value = 'd1value') and key is not null) (type: boolean)
                                     |        |           |           Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                                     |        |           |           TableScan [TS_12]
                                     |        |           |              alias:d1
                                     |        |           |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                                     |        |           |<-Reducer 8 [SIMPLE_EDGE]
-                                    |        |              Reduce Output Operator [RS_36]
+                                    |        |              Reduce Output Operator [RS_31]
                                     |        |                 key expressions:_col2 (type: string)
                                     |        |                 Map-reduce partition columns:_col2 (type: string)
                                     |        |                 sort order:+
                                     |        |                 Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
                                     |        |                 value expressions:_col3 (type: string), _col4 (type: string), _col6 (type: string)
-                                    |        |                 Merge Join Operator [MERGEJOIN_106]
+                                    |        |                 Merge Join Operator [MERGEJOIN_92]
                                     |        |                 |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |        |                 |  keys:{"0":"_col1 (type: string)","1":"_col3 (type: string)"}
                                     |        |                 |  outputColumnNames:["_col2","_col3","_col4","_col6"]
                                     |        |                 |  Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
                                     |        |                 |<-Map 12 [SIMPLE_EDGE]
-                                    |        |                 |  Reduce Output Operator [RS_33]
+                                    |        |                 |  Reduce Output Operator [RS_29]
                                     |        |                 |     key expressions:_col3 (type: string)
                                     |        |                 |     Map-reduce partition columns:_col3 (type: string)
                                     |        |                 |     sort order:+
@@ -470,14 +470,14 @@ Stage-0
                                     |        |                 |     Select Operator [SEL_11]
                                     |        |                 |        outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
                                     |        |                 |        Statistics:Num rows: 42 Data size: 1455 Basic stats: COMPLETE Column stats: NONE
-                                    |        |                 |        Filter Operator [FIL_100]
+                                    |        |                 |        Filter Operator [FIL_86]
                                     |        |                 |           predicate:(((((k3 is not null and (v3 = 'ssv3')) and k2 is not null) and k1 is not null) and v1 is not null) and v2 is not null) (type: boolean)
                                     |        |                 |           Statistics:Num rows: 42 Data size: 1455 Basic stats: COMPLETE Column stats: NONE
                                     |        |                 |           TableScan [TS_9]
                                     |        |                 |              alias:ss
                                     |        |                 |              Statistics:Num rows: 85 Data size: 2945 Basic stats: COMPLETE Column stats: NONE
                                     |        |                 |<-Map 7 [SIMPLE_EDGE]
-                                    |        |                    Reduce Output Operator [RS_31]
+                                    |        |                    Reduce Output Operator [RS_28]
                                     |        |                       key expressions:_col1 (type: string)
                                     |        |                       Map-reduce partition columns:_col1 (type: string)
                                     |        |                       sort order:+
@@ -485,26 +485,26 @@ Stage-0
                                     |        |                       Select Operator [SEL_8]
                                     |        |                          outputColumnNames:["_col1"]
                                     |        |                          Statistics:Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
-                                    |        |                          Filter Operator [FIL_99]
+                                    |        |                          Filter Operator [FIL_85]
                                     |        |                             predicate:((key = 'srcpartkey') and value is not null) (type: boolean)
                                     |        |                             Statistics:Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
                                     |        |                             TableScan [TS_6]
                                     |        |                                alias:srcpart
                                     |        |                                Statistics:Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
                                     |        |<-Reducer 16 [SIMPLE_EDGE]
-                                    |           Reduce Output Operator [RS_48]
+                                    |           Reduce Output Operator [RS_38]
                                     |              key expressions:_col2 (type: string), _col4 (type: string)
                                     |              Map-reduce partition columns:_col2 (type: string), _col4 (type: string)
                                     |              sort order:++
                                     |              Statistics:Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                                     |              value expressions:_col3 (type: string), _col5 (type: string)
-                                    |              Merge Join Operator [MERGEJOIN_109]
+                                    |              Merge Join Operator [MERGEJOIN_95]
                                     |              |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |              |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                     |              |  outputColumnNames:["_col2","_col3","_col4","_col5"]
                                     |              |  Statistics:Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                                     |              |<-Map 15 [SIMPLE_EDGE]
-                                    |              |  Reduce Output Operator [RS_25]
+                                    |              |  Reduce Output Operator [RS_24]
                                     |              |     key expressions:_col0 (type: string)
                                     |              |     Map-reduce partition columns:_col0 (type: string)
                                     |              |     sort order:+
@@ -513,14 +513,14 @@ Stage-0
                                     |              |     Select Operator [SEL_20]
                                     |              |        outputColumnNames:["_col0","_col2","_col3","_col4","_col5"]
                                     |              |        Statistics:Num rows: 42 Data size: 1455 Basic stats: COMPLETE Column stats: NONE
-                                    |              |        Filter Operator [FIL_103]
+                                    |              |        Filter Operator [FIL_89]
                                     |              |           predicate:((((((v1 = 'srv1') and k3 is not null) and k2 is not null) and v3 is not null) and v2 is not null) and k1 is not null) (type: boolean)
                                     |              |           Statistics:Num rows: 42 Data size: 1455 Basic stats: COMPLETE Column stats: NONE
                                     |              |           TableScan [TS_18]
                                     |              |              alias:sr
                                     |              |              Statistics:Num rows: 85 Data size: 2945 Basic stats: COMPLETE Column stats: NONE
                                     |              |<-Map 17 [SIMPLE_EDGE]
-                                    |                 Reduce Output Operator [RS_27]
+                                    |                 Reduce Output Operator [RS_25]
                                     |                    key expressions:_col0 (type: string)
                                     |                    Map-reduce partition columns:_col0 (type: string)
                                     |                    sort order:+
@@ -528,26 +528,26 @@ Stage-0
                                     |                    Select Operator [SEL_23]
                                     |                       outputColumnNames:["_col0"]
                                     |                       Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-                                    |                       Filter Operator [FIL_104]
+                                    |                       Filter Operator [FIL_90]
                                     |                          predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null) (type: boolean)
                                     |                          Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                                     |                          TableScan [TS_21]
                                     |                             alias:d1
                                     |                             Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                                     |<-Reducer 2 [SIMPLE_EDGE]
-                                       Reduce Output Operator [RS_57]
+                                       Reduce Output Operator [RS_44]
                                           key expressions:_col1 (type: string), _col3 (type: string)
                                           Map-reduce partition columns:_col1 (type: string), _col3 (type: string)
                                           sort order:++
                                           Statistics:Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                                           value expressions:_col2 (type: string)
-                                          Merge Join Operator [MERGEJOIN_105]
+                                          Merge Join Operator [MERGEJOIN_91]
                                           |  condition map:[{"":"Inner Join 0 to 1"}]
                                           |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                           |  outputColumnNames:["_col1","_col2","_col3"]
                                           |  Statistics:Num rows: 275 Data size: 2921 Basic stats: COMPLETE Column stats: NONE
                                           |<-Map 1 [SIMPLE_EDGE]
-                                          |  Reduce Output Operator [RS_52]
+                                          |  Reduce Output Operator [RS_41]
                                           |     key expressions:_col0 (type: string)
                                           |     Map-reduce partition columns:_col0 (type: string)
                                           |     sort order:+
@@ -556,14 +556,14 @@ Stage-0
                                           |     Select Operator [SEL_2]
                                           |        outputColumnNames:["_col0","_col1","_col2","_col3"]
                                           |        Statistics:Num rows: 170 Data size: 5890 Basic stats: COMPLETE Column stats: NONE
-                                          |        Filter Operator [FIL_97]
+                                          |        Filter Operator [FIL_83]
                                           |           predicate:((v3 is not null and v2 is not null) and k1 is not null) (type: boolean)
                                           |           Statistics:Num rows: 170 Data size: 5890 Basic stats: COMPLETE Column stats: NONE
                                           |           TableScan [TS_0]
                                           |              alias:cs
                                           |              Statistics:Num rows: 170 Data size: 5890 Basic stats: COMPLETE Column stats: NONE
                                           |<-Map 6 [SIMPLE_EDGE]
-                                             Reduce Output Operator [RS_54]
+                                             Reduce Output Operator [RS_42]
                                                 key expressions:_col0 (type: string)
                                                 Map-reduce partition columns:_col0 (type: string)
                                                 sort order:+
@@ -571,7 +571,7 @@ Stage-0
                                                 Select Operator [SEL_5]
                                                    outputColumnNames:["_col0"]
                                                    Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-                                                   Filter Operator [FIL_98]
+                                                   Filter Operator [FIL_84]
                                                       predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null) (type: boolean)
                                                       Statistics:Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                                                       TableScan [TS_3]
@@ -616,148 +616,148 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 7
-         File Output Operator [FS_67]
+         File Output Operator [FS_59]
             compressed:false
             Statistics:Num rows: 550 Data size: 5843 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"}
-            Group By Operator [GBY_65]
+            Group By Operator [GBY_57]
             |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
             |  outputColumnNames:["_col0","_col1"]
             |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
             |<-Union 6 [SIMPLE_EDGE]
                |<-Reducer 15 [CONTAINS]
-               |  Reduce Output Operator [RS_64]
+               |  Reduce Output Operator [RS_56]
                |     key expressions:_col0 (type: string), _col1 (type: string)
                |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |     sort order:++
                |     Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-               |     Group By Operator [GBY_63]
+               |     Group By Operator [GBY_55]
                |        keys:_col0 (type: string), _col1 (type: string)
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-               |        Select Operator [SEL_59]
+               |        Select Operator [SEL_51]
                |           outputColumnNames:["_col0","_col1"]
                |           Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-               |           Merge Join Operator [MERGEJOIN_93]
+               |           Merge Join Operator [MERGEJOIN_85]
                |           |  condition map:[{"":"Inner Join 0 to 1"}]
                |           |  keys:{"0":"_col2 (type: string)","1":"_col0 (type: string)"}
                |           |  outputColumnNames:["_col1","_col2"]
                |           |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                |           |<-Map 18 [SIMPLE_EDGE]
-               |           |  Reduce Output Operator [RS_57]
+               |           |  Reduce Output Operator [RS_49]
                |           |     key expressions:_col0 (type: string)
                |           |     Map-reduce partition columns:_col0 (type: string)
                |           |     sort order:+
                |           |     Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |           |     Select Operator [SEL_48]
+               |           |     Select Operator [SEL_44]
                |           |        outputColumnNames:["_col0"]
                |           |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |           |        Filter Operator [FIL_89]
+               |           |        Filter Operator [FIL_81]
                |           |           predicate:key is not null (type: boolean)
                |           |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |           |           TableScan [TS_46]
+               |           |           TableScan [TS_42]
                |           |              alias:y
                |           |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |           |<-Reducer 14 [SIMPLE_EDGE]
-               |              Reduce Output Operator [RS_55]
+               |              Reduce Output Operator [RS_48]
                |                 key expressions:_col2 (type: string)
                |                 Map-reduce partition columns:_col2 (type: string)
                |                 sort order:+
                |                 Statistics:Num rows: 288 Data size: 3020 Basic stats: COMPLETE Column stats: NONE
                |                 value expressions:_col1 (type: string)
-               |                 Merge Join Operator [MERGEJOIN_92]
+               |                 Merge Join Operator [MERGEJOIN_84]
                |                 |  condition map:[{"":"Inner Join 0 to 1"}]
                |                 |  keys:{"0":"_col1 (type: string)","1":"_col1 (type: string)"}
                |                 |  outputColumnNames:["_col1","_col2"]
                |                 |  Statistics:Num rows: 288 Data size: 3020 Basic stats: COMPLETE Column stats: NONE
                |                 |<-Map 17 [SIMPLE_EDGE]
-               |                 |  Reduce Output Operator [RS_52]
+               |                 |  Reduce Output Operator [RS_46]
                |                 |     key expressions:_col1 (type: string)
                |                 |     Map-reduce partition columns:_col1 (type: string)
                |                 |     sort order:+
                |                 |     Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                 |     value expressions:_col0 (type: string)
-               |                 |     Select Operator [SEL_45]
+               |                 |     Select Operator [SEL_41]
                |                 |        outputColumnNames:["_col0","_col1"]
                |                 |        Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                 |        Filter Operator [FIL_88]
+               |                 |        Filter Operator [FIL_80]
                |                 |           predicate:(key is not null and value is not null) (type: boolean)
                |                 |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                 |           TableScan [TS_43]
+               |                 |           TableScan [TS_39]
                |                 |              alias:x
                |                 |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                 |<-Reducer 13 [SIMPLE_EDGE]
-               |                    Reduce Output Operator [RS_50]
+               |                    Reduce Output Operator [RS_45]
                |                       key expressions:_col1 (type: string)
                |                       Map-reduce partition columns:_col1 (type: string)
                |                       sort order:+
                |                       Statistics:Num rows: 262 Data size: 2746 Basic stats: COMPLETE Column stats: NONE
-               |                       Select Operator [SEL_42]
+               |                       Select Operator [SEL_38]
                |                          outputColumnNames:["_col1"]
                |                          Statistics:Num rows: 262 Data size: 2746 Basic stats: COMPLETE Column stats: NONE
-               |                          Group By Operator [GBY_41]
+               |                          Group By Operator [GBY_37]
                |                          |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                |                          |  outputColumnNames:["_col0","_col1"]
                |                          |  Statistics:Num rows: 262 Data size: 2746 Basic stats: COMPLETE Column stats: NONE
                |                          |<-Union 12 [SIMPLE_EDGE]
                |                             |<-Map 11 [CONTAINS]
-               |                             |  Reduce Output Operator [RS_40]
+               |                             |  Reduce Output Operator [RS_36]
                |                             |     key expressions:_col0 (type: string), _col1 (type: string)
                |                             |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                             |     sort order:++
                |                             |     Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                             |     Group By Operator [GBY_39]
+               |                             |     Group By Operator [GBY_35]
                |                             |        keys:_col0 (type: string), _col1 (type: string)
                |                             |        outputColumnNames:["_col0","_col1"]
                |                             |        Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                             |        Select Operator [SEL_32]
+               |                             |        Select Operator [SEL_28]
                |                             |           outputColumnNames:["_col0","_col1"]
                |                             |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                             |           Filter Operator [FIL_86]
+               |                             |           Filter Operator [FIL_78]
                |                             |              predicate:value is not null (type: boolean)
                |                             |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                             |              TableScan [TS_30]
+               |                             |              TableScan [TS_26]
                |                             |                 alias:x
                |                             |                 Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                             |<-Map 16 [CONTAINS]
-               |                                Reduce Output Operator [RS_40]
+               |                                Reduce Output Operator [RS_36]
                |                                   key expressions:_col0 (type: string), _col1 (type: string)
                |                                   Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                   sort order:++
                |                                   Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                   Group By Operator [GBY_39]
+               |                                   Group By Operator [GBY_35]
                |                                      keys:_col0 (type: string), _col1 (type: string)
                |                                      outputColumnNames:["_col0","_col1"]
                |                                      Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                      Select Operator [SEL_35]
+               |                                      Select Operator [SEL_31]
                |                                         outputColumnNames:["_col0","_col1"]
                |                                         Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                         Filter Operator [FIL_87]
+               |                                         Filter Operator [FIL_79]
                |                                            predicate:value is not null (type: boolean)
                |                                            Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                            TableScan [TS_33]
+               |                                            TableScan [TS_29]
                |                                               alias:y
                |                                               Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 5 [CONTAINS]
-                  Reduce Output Operator [RS_64]
+                  Reduce Output Operator [RS_56]
                      key expressions:_col0 (type: string), _col1 (type: string)
                      Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                      sort order:++
                      Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                     Group By Operator [GBY_63]
+                     Group By Operator [GBY_55]
                         keys:_col0 (type: string), _col1 (type: string)
                         outputColumnNames:["_col0","_col1"]
                         Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                        Select Operator [SEL_29]
+                        Select Operator [SEL_25]
                            outputColumnNames:["_col0","_col1"]
                            Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                           Merge Join Operator [MERGEJOIN_91]
+                           Merge Join Operator [MERGEJOIN_83]
                            |  condition map:[{"":"Inner Join 0 to 1"}]
                            |  keys:{"0":"_col2 (type: string)","1":"_col0 (type: string)"}
                            |  outputColumnNames:["_col1","_col2"]
                            |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                            |<-Map 10 [SIMPLE_EDGE]
-                           |  Reduce Output Operator [RS_27]
+                           |  Reduce Output Operator [RS_23]
                            |     key expressions:_col0 (type: string)
                            |     Map-reduce partition columns:_col0 (type: string)
                            |     sort order:+
@@ -765,26 +765,26 @@ Stage-0
                            |     Select Operator [SEL_18]
                            |        outputColumnNames:["_col0"]
                            |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                           |        Filter Operator [FIL_85]
+                           |        Filter Operator [FIL_77]
                            |           predicate:key is not null (type: boolean)
                            |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                            |           TableScan [TS_16]
                            |              alias:y
                            |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                            |<-Reducer 4 [SIMPLE_EDGE]
-                              Reduce Output Operator [RS_25]
+                              Reduce Output Operator [RS_22]
                                  key expressions:_col2 (type: string)
                                  Map-reduce partition columns:_col2 (type: string)
                                  sort order:+
                                  Statistics:Num rows: 288 Data size: 3020 Basic stats: COMPLETE Column stats: NONE
                                  value expressions:_col1 (type: string)
-                                 Merge Join Operator [MERGEJOIN_90]
+                                 Merge Join Operator [MERGEJOIN_82]
                                  |  condition map:[{"":"Inner Join 0 to 1"}]
                                  |  keys:{"0":"_col1 (type: string)","1":"_col1 (type: string)"}
                                  |  outputColumnNames:["_col1","_col2"]
                                  |  Statistics:Num rows: 288 Data size: 3020 Basic stats: COMPLETE Column stats: NONE
                                  |<-Map 9 [SIMPLE_EDGE]
-                                 |  Reduce Output Operator [RS_22]
+                                 |  Reduce Output Operator [RS_20]
                                  |     key expressions:_col1 (type: string)
                                  |     Map-reduce partition columns:_col1 (type: string)
                                  |     sort order:+
@@ -793,14 +793,14 @@ Stage-0
                                  |     Select Operator [SEL_15]
                                  |        outputColumnNames:["_col0","_col1"]
                                  |        Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                                 |        Filter Operator [FIL_84]
+                                 |        Filter Operator [FIL_76]
                                  |           predicate:(key is not null and value is not null) (type: boolean)
                                  |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                                  |           TableScan [TS_13]
                                  |              alias:x
                                  |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                                  |<-Reducer 3 [SIMPLE_EDGE]
-                                    Reduce Output Operator [RS_20]
+                                    Reduce Output Operator [RS_19]
                                        key expressions:_col1 (type: string)
                                        Map-reduce partition columns:_col1 (type: string)
                                        sort order:+
@@ -826,7 +826,7 @@ Stage-0
                                              |        Select Operator [SEL_2]
                                              |           outputColumnNames:["_col0","_col1"]
                                              |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                                             |           Filter Operator [FIL_82]
+                                             |           Filter Operator [FIL_74]
                                              |              predicate:value is not null (type: boolean)
                                              |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                                              |              TableScan [TS_0]
@@ -845,7 +845,7 @@ Stage-0
                                                       Select Operator [SEL_5]
                                                          outputColumnNames:["_col0","_col1"]
                                                          Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                                                         Filter Operator [FIL_83]
+                                                         Filter Operator [FIL_75]
                                                             predicate:value is not null (type: boolean)
                                                             Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                                                             TableScan [TS_3]
@@ -910,378 +910,378 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 9
-         File Output Operator [FS_134]
+         File Output Operator [FS_122]
             compressed:false
             Statistics:Num rows: 550 Data size: 5843 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"}
-            Group By Operator [GBY_132]
+            Group By Operator [GBY_120]
             |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
             |  outputColumnNames:["_col0","_col1"]
             |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
             |<-Union 8 [SIMPLE_EDGE]
                |<-Reducer 32 [CONTAINS]
-               |  Reduce Output Operator [RS_131]
+               |  Reduce Output Operator [RS_119]
                |     key expressions:_col0 (type: string), _col1 (type: string)
                |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |     sort order:++
                |     Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-               |     Group By Operator [GBY_130]
+               |     Group By Operator [GBY_118]
                |        keys:_col0 (type: string), _col1 (type: string)
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-               |        Select Operator [SEL_126]
+               |        Select Operator [SEL_114]
                |           outputColumnNames:["_col0","_col1"]
                |           Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-               |           Merge Join Operator [MERGEJOIN_182]
+               |           Merge Join Operator [MERGEJOIN_170]
                |           |  condition map:[{"":"Inner Join 0 to 1"}]
                |           |  keys:{"0":"_col2 (type: string)","1":"_col0 (type: string)"}
                |           |  outputColumnNames:["_col2","_col5"]
                |           |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                |           |<-Map 37 [SIMPLE_EDGE]
-               |           |  Reduce Output Operator [RS_124]
+               |           |  Reduce Output Operator [RS_112]
                |           |     key expressions:_col0 (type: string)
                |           |     Map-reduce partition columns:_col0 (type: string)
                |           |     sort order:+
                |           |     Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |           |     value expressions:_col1 (type: string)
-               |           |     Select Operator [SEL_115]
+               |           |     Select Operator [SEL_107]
                |           |        outputColumnNames:["_col0","_col1"]
                |           |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |           |        Filter Operator [FIL_176]
+               |           |        Filter Operator [FIL_164]
                |           |           predicate:key is not null (type: boolean)
                |           |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |           |           TableScan [TS_113]
+               |           |           TableScan [TS_105]
                |           |              alias:y
                |           |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |           |<-Reducer 31 [SIMPLE_EDGE]
-               |              Reduce Output Operator [RS_122]
+               |              Reduce Output Operator [RS_111]
                |                 key expressions:_col2 (type: string)
                |                 Map-reduce partition columns:_col2 (type: string)
                |                 sort order:+
                |                 Statistics:Num rows: 484 Data size: 5131 Basic stats: COMPLETE Column stats: NONE
-               |                 Merge Join Operator [MERGEJOIN_181]
+               |                 Merge Join Operator [MERGEJOIN_169]
                |                 |  condition map:[{"":"Inner Join 0 to 1"}]
                |                 |  keys:{"0":"_col1 (type: string)","1":"_col1 (type: string)"}
                |                 |  outputColumnNames:["_col2"]
                |                 |  Statistics:Num rows: 484 Data size: 5131 Basic stats: COMPLETE Column stats: NONE
                |                 |<-Map 36 [SIMPLE_EDGE]
-               |                 |  Reduce Output Operator [RS_119]
+               |                 |  Reduce Output Operator [RS_109]
                |                 |     key expressions:_col1 (type: string)
                |                 |     Map-reduce partition columns:_col1 (type: string)
                |                 |     sort order:+
                |                 |     Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                 |     value expressions:_col0 (type: string)
-               |                 |     Select Operator [SEL_112]
+               |                 |     Select Operator [SEL_104]
                |                 |        outputColumnNames:["_col0","_col1"]
                |                 |        Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                 |        Filter Operator [FIL_175]
+               |                 |        Filter Operator [FIL_163]
                |                 |           predicate:(key is not null and value is not null) (type: boolean)
                |                 |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                 |           TableScan [TS_110]
+               |                 |           TableScan [TS_102]
                |                 |              alias:x
                |                 |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                 |<-Reducer 30 [SIMPLE_EDGE]
-               |                    Reduce Output Operator [RS_117]
+               |                    Reduce Output Operator [RS_108]
                |                       key expressions:_col1 (type: string)
                |                       Map-reduce partition columns:_col1 (type: string)
                |                       sort order:+
                |                       Statistics:Num rows: 440 Data size: 4665 Basic stats: COMPLETE Column stats: NONE
-               |                       Select Operator [SEL_109]
+               |                       Select Operator [SEL_101]
                |                          outputColumnNames:["_col1"]
                |                          Statistics:Num rows: 440 Data size: 4665 Basic stats: COMPLETE Column stats: NONE
-               |                          Group By Operator [GBY_108]
+               |                          Group By Operator [GBY_100]
                |                          |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                |                          |  outputColumnNames:["_col0","_col1"]
                |                          |  Statistics:Num rows: 440 Data size: 4665 Basic stats: COMPLETE Column stats: NONE
                |                          |<-Union 29 [SIMPLE_EDGE]
                |                             |<-Map 35 [CONTAINS]
-               |                             |  Reduce Output Operator [RS_107]
+               |                             |  Reduce Output Operator [RS_99]
                |                             |     key expressions:_col0 (type: string), _col1 (type: string)
                |                             |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                             |     sort order:++
                |                             |     Statistics:Num rows: 881 Data size: 9341 Basic stats: COMPLETE Column stats: NONE
-               |                             |     Group By Operator [GBY_106]
+               |                             |     Group By Operator [GBY_98]
                |                             |        keys:_col0 (type: string), _col1 (type: string)
                |                             |        outputColumnNames:["_col0","_col1"]
                |                             |        Statistics:Num rows: 881 Data size: 9341 Basic stats: COMPLETE Column stats: NONE
-               |                             |        Select Operator [SEL_102]
+               |                             |        Select Operator [SEL_94]
                |                             |           outputColumnNames:["_col0","_col1"]
                |                             |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                             |           Filter Operator [FIL_174]
+               |                             |           Filter Operator [FIL_162]
                |                             |              predicate:value is not null (type: boolean)
                |                             |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                             |              TableScan [TS_100]
+               |                             |              TableScan [TS_92]
                |                             |                 alias:y
                |                             |                 Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |                             |<-Reducer 28 [CONTAINS]
-               |                                Reduce Output Operator [RS_107]
+               |                                Reduce Output Operator [RS_99]
                |                                   key expressions:_col0 (type: string), _col1 (type: string)
                |                                   Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                   sort order:++
                |                                   Statistics:Num rows: 881 Data size: 9341 Basic stats: COMPLETE Column stats: NONE
-               |                                   Group By Operator [GBY_106]
+               |                                   Group By Operator [GBY_98]
                |                                      keys:_col0 (type: string), _col1 (type: string)
                |                                      outputColumnNames:["_col0","_col1"]
                |                                      Statistics:Num rows: 881 Data size: 9341 Basic stats: COMPLETE Column stats: NONE
-               |                                      Group By Operator [GBY_98]
+               |                                      Group By Operator [GBY_90]
                |                                      |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                |                                      |  outputColumnNames:["_col0","_col1"]
                |                                      |  Statistics:Num rows: 381 Data size: 4029 Basic stats: COMPLETE Column stats: NONE
                |                                      |<-Union 27 [SIMPLE_EDGE]
                |                                         |<-Map 34 [CONTAINS]
-               |                                         |  Reduce Output Operator [RS_97]
+               |                                         |  Reduce Output Operator [RS_89]
                |                                         |     key expressions:_col0 (type: string), _col1 (type: string)
                |                                         |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                         |     sort order:++
                |                                         |     Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-               |                                         |     Group By Operator [GBY_96]
+               |                                         |     Group By Operator [GBY_88]
                |                                         |        keys:_col0 (type: string), _col1 (type: string)
                |                                         |        outputColumnNames:["_col0","_col1"]
                |                                         |        Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-               |                                         |        Select Operator [SEL_92]
+               |                                         |        Select Operator [SEL_84]
                |                                         |           outputColumnNames:["_col0","_col1"]
                |                                         |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                         |           Filter Operator [FIL_173]
+               |                                         |           Filter Operator [FIL_161]
                |                                         |              predicate:value is not null (type: boolean)
                |                                         |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                         |              TableScan [TS_90]
+               |                                         |              TableScan [TS_82]
                |                                         |                 alias:y
                |                                         |                 Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |                                         |<-Reducer 26 [CONTAINS]
-               |                                            Reduce Output Operator [RS_97]
+               |                                            Reduce Output Operator [RS_89]
                |                                               key expressions:_col0 (type: string), _col1 (type: string)
                |                                               Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                               sort order:++
                |                                               Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-               |                                               Group By Operator [GBY_96]
+               |                                               Group By Operator [GBY_88]
                |                                                  keys:_col0 (type: string), _col1 (type: string)
                |                                                  outputColumnNames:["_col0","_col1"]
                |                                                  Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-               |                                                  Group By Operator [GBY_88]
+               |                                                  Group By Operator [GBY_80]
                |                                                  |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                |                                                  |  outputColumnNames:["_col0","_col1"]
                |                                                  |  Statistics:Num rows: 262 Data size: 2746 Basic stats: COMPLETE Column stats: NONE
                |                                                  |<-Union 25 [SIMPLE_EDGE]
                |                                                     |<-Map 24 [CONTAINS]
-               |                                                     |  Reduce Output Operator [RS_87]
+               |                                                     |  Reduce Output Operator [RS_79]
                |                                                     |     key expressions:_col0 (type: string), _col1 (type: string)
                |                                                     |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                                     |     sort order:++
                |                                                     |     Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                                     |     Group By Operator [GBY_86]
+               |                                                     |     Group By Operator [GBY_78]
                |                                                     |        keys:_col0 (type: string), _col1 (type: string)
                |                                                     |        outputColumnNames:["_col0","_col1"]
                |                                                     |        Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                                     |        Select Operator [SEL_79]
+               |                                                     |        Select Operator [SEL_71]
                |                                                     |           outputColumnNames:["_col0","_col1"]
                |                                                     |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                                                     |           Filter Operator [FIL_171]
+               |                                                     |           Filter Operator [FIL_159]
                |                                                     |              predicate:value is not null (type: boolean)
                |                                                     |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-               |                                                     |              TableScan [TS_77]
+               |                                                     |              TableScan [TS_69]
                |                                                     |                 alias:x
                |                                                     |                 Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                |                                                     |<-Map 33 [CONTAINS]
-               |                                                        Reduce Output Operator [RS_87]
+               |                                                        Reduce Output Operator [RS_79]
                |                                                           key expressions:_col0 (type: string), _col1 (type: string)
                |                                                           Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                |                                                           sort order:++
                |                                                           Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                                           Group By Operator [GBY_86]
+               |                                                           Group By Operator [GBY_78]
                |                                                              keys:_col0 (type: string), _col1 (type: string)
                |                                                              outputColumnNames:["_col0","_col1"]
                |                                                              Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-               |                                                              Select Operator [SEL_82]
+               |                                                              Select Operator [SEL_74]
                |                                                                 outputColumnNames:["_col0","_col1"]
                |                                                                 Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                                                 Filter Operator [FIL_172]
+               |                                                                 Filter Operator [FIL_160]
                |                                                                    predicate:value is not null (type: boolean)
                |                                                                    Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-               |                                                                    TableScan [TS_80]
+               |                                                                    TableScan [TS_72]
                |                                                                       alias:y
                |                                                                       Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 7 [CONTAINS]
-                  Reduce Output Operator [RS_131]
+                  Reduce Output Operator [RS_119]
                      key expressions:_col0 (type: string), _col1 (type: string)
                      Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                      sort order:++
                      Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                     Group By Operator [GBY_130]
+                     Group By Operator [GBY_118]
                         keys:_col0 (type: string), _col1 (type: string)
                         outputColumnNames:["_col0","_col1"]
                         Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                        Group By Operator [GBY_75]
+                        Group By Operator [GBY_67]
                         |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                         |  outputColumnNames:["_col0","_col1"]
                         |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                         |<-Union 6 [SIMPLE_EDGE]
                            |<-Reducer 19 [CONTAINS]
-                           |  Reduce Output Operator [RS_74]
+                           |  Reduce Output Operator [RS_66]
                            |     key expressions:_col0 (type: string), _col1 (type: string)
                            |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                            |     sort order:++
                            |     Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                           |     Group By Operator [GBY_73]
+                           |     Group By Operator [GBY_65]
                            |        keys:_col0 (type: string), _col1 (type: string)
                            |        outputColumnNames:["_col0","_col1"]
                            |        Statistics:Num rows: 1100 Data size: 11686 Basic stats: COMPLETE Column stats: NONE
-                           |        Select Operator [SEL_69]
+                           |        Select Operator [SEL_61]
                            |           outputColumnNames:["_col0","_col1"]
                            |           Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                           |           Merge Join Operator [MERGEJOIN_180]
+                           |           Merge Join Operator [MERGEJOIN_168]
                            |           |  condition map:[{"":"Inner Join 0 to 1"}]
                            |           |  keys:{"0":"_col2 (type: string)","1":"_col0 (type: string)"}
                            |           |  outputColumnNames:["_col2","_col5"]
                            |           |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                            |           |<-Map 23 [SIMPLE_EDGE]
-                           |           |  Reduce Output Operator [RS_67]
+                           |           |  Reduce Output Operator [RS_59]
                            |           |     key expressions:_col0 (type: string)
                            |           |     Map-reduce partition columns:_col0 (type: string)
                            |           |     sort order:+
                            |           |     Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                            |           |     value expressions:_col1 (type: string)
-                           |           |     Select Operator [SEL_58]
+                           |           |     Select Operator [SEL_54]
                            |           |        outputColumnNames:["_col0","_col1"]
                            |           |        Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                           |           |        Filter Operator [FIL_170]
+                           |           |        Filter Operator [FIL_158]
                            |           |           predicate:key is not null (type: boolean)
                            |           |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                           |           |           TableScan [TS_56]
+                           |           |           TableScan [TS_52]
                            |           |              alias:y
                            |           |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                            |           |<-Reducer 18 [SIMPLE_EDGE]
-                           |              Reduce Output Operator [RS_65]
+                           |              Reduce Output Operator [RS_58]
                            |                 key expressions:_col2 (type: string)
                            |                 Map-reduce partition columns:_col2 (type: string)
                            |                 sort order:+
                            |                 Statistics:Num rows: 419 Data size: 4431 Basic stats: COMPLETE Column stats: NONE
-                           |                 Merge Join Operator [MERGEJOIN_179]
+                           |                 Merge Join Operator [MERGEJOIN_167]
                            |                 |  condition map:[{"":"Inner Join 0 to 1"}]
                            |                 |  keys:{"0":"_col1 (type: string)","1":"_col1 (type: string)"}
                            |                 |  outputColumnNames:["_col2"]
                            |                 |  Statistics:Num rows: 419 Data size: 4431 Basic stats: COMPLETE Column stats: NONE
                            |                 |<-Map 22 [SIMPLE_EDGE]
-                           |                 |  Reduce Output Operator [RS_62]
+                           |                 |  Reduce Output Operator [RS_56]
                            |                 |     key expressions:_col1 (type: string)
                            |                 |     Map-reduce partition columns:_col1 (type: string)
                            |                 |     sort order:+
                            |                 |     Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                            |                 |     value expressions:_col0 (type: string)
-                           |                 |     Select Operator [SEL_55]
+                           |                 |     Select Operator [SEL_51]
                            |                 |        outputColumnNames:["_col0","_col1"]
                            |                 |        Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                           |                 |        Filter Operator [FIL_169]
+                           |                 |        Filter Operator [FIL_157]
                            |                 |           predicate:(key is not null and value is not null) (type: boolean)
                            |                 |           Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                           |                 |           TableScan [TS_53]
+                           |                 |           TableScan [TS_49]
                            |                 |              alias:x
                            |                 |              Statistics:Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                            |                 |<-Reducer 17 [SIMPLE_EDGE]
-                           |                    Reduce Output Operator [RS_60]
+                           |                    Reduce Output Operator [RS_55]
                            |                       key expressions:_col1 (type: string)
                            |                       Map-reduce partition columns:_col1 (type: string)
                            |                       sort order:+
                            |                       Statistics:Num rows: 381 Data size: 4029 Basic stats: COMPLETE Column stats: NONE
-                           |                       Select Operator [SEL_52]
+                           |                       Select Operator [SEL_48]
                            |                          outputColumnNames:["_col1"]
                            |                          Statistics:Num rows: 381 Data size: 4029 Basic stats: COMPLETE Column stats: NONE
-                           |                          Group By Operator [GBY_51]
+                           |                          Group By Operator [GBY_47]
                            |                          |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                            |                          |  outputColumnNames:["_col0","_col1"]
                            |                          |  Statistics:Num rows: 381 Data size: 4029 Basic stats: COMPLETE Column stats: NONE
                            |                          |<-Union 16 [SIMPLE_EDGE]
                            |                             |<-Map 21 [CONTAINS]
-                           |                             |  Reduce Output Operator [RS_50]
+                           |                             |  Reduce Output Operator [RS_46]
                            |                             |     key expressions:_col0 (type: string), _col1 (type: string)
                            |                             |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                            |                             |     sort order:++
                            |                             |     Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-                           |                             |     Group By Operator [GBY_49]
+                           |                             |     Group By Operator [GBY_45]
                            |                             |        keys:_col0 (type: string), _col1 (type: string)
                            |                             |        outputColumnNames:["_col0","_col1"]
                            |                             |        Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-                           |                             |        Select Operator [SEL_45]
+                           |                             |        Select Operator [SEL_41]
                            |                             |           outputColumnNames:["_col0","_col1"]
                            |                             |           Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                           |                             |           Filter Operator [FIL_168]
+                           |                             |           Filter Operator [FIL_156]
                            |                             |              predicate:value is not null (type: boolean)
                            |                             |              Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                           |                             |              TableScan [TS_43]
+                           |                             |              TableScan [TS_39]
                            |                             |                 alias:y
                            |                             |                 Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                            |                             |<-Reducer 15 [CONTAINS]
-                           |                                Reduce Output Operator [RS_50]
+                           |                                Reduce Output Operator [RS_46]
                            |                                   key expressions:_col0 (type: string), _col1 (type: string)
                            |                                   Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                            |                                   sort order:++
                            |                                   Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-                           |                                   Group By Operator [GBY_49]
+                           |                                   Group By Operator [GBY_45]
                            |                                      keys:_col0 (type: string), _col1 (type: string)
                            |                                      outputColumnNames:["_col0","_col1"]
                            |                                      Statistics:Num rows: 762 Data size: 8058 Basic stats: COMPLETE Column stats: NONE
-                           |                                      Group By Operator [GBY_41]
+                           |                                      Group By Operator [GBY_37]
                            |                                      |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                            |                                      |  outputColumnNames:["_col0","_col1"]
                            |                                      |  Statistics:Num rows: 262 Data size: 2746 Basic stats: COMPLETE Column stats: NONE
                            |                                      |<-Union 14 [SIMPLE_EDGE]
                            |                                         |<-Map 13 [CONTAINS]
-                           |                                         |  Reduce Output Operator [RS_40]
+                           |                                         |  Reduce Output Operator [RS_36]
                            |                                         |     key expressions:_col0 (type: string), _col1 (type: string)
                            |                                         |     Map-reduce partition columns:_col0 (type: string), _col1 (type: string)
                            |                                         |     sort order:++
                            |                                         |     Statistics:Num rows: 525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
-                           |                                         |     Group By Operator [GBY_39]
+                           |                                       

<TRUNCATED>

[02/15] hive git commit: HIVE-11531: Add mysql-style LIMIT support to Hive, or improve ROW_NUMBER performance-wise (Hui Zheng, reviewed by Sergey Shelukhin, Jesus Camacho Rodriguez)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/6273bee3/ql/src/test/results/clientpositive/offset_limit_global_optimizer.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/offset_limit_global_optimizer.q.out b/ql/src/test/results/clientpositive/offset_limit_global_optimizer.q.out
new file mode 100644
index 0000000..999c5e6
--- /dev/null
+++ b/ql/src/test/results/clientpositive/offset_limit_global_optimizer.q.out
@@ -0,0 +1,3390 @@
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         400
+         10
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 10
+                Offset of rows: 400
+                Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: kv1.txt
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11/kv1.txt [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 10
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+70	70	2008-04-08	11
+163	163	2008-04-08	11
+438	438	2008-04-08	11
+119	119	2008-04-08	11
+414	414	2008-04-08	11
+200	200	2008-04-08	11
+491	491	2008-04-08	11
+237	237	2008-04-08	11
+439	439	2008-04-08	11
+360	360	2008-04-08	11
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         490
+         10
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 10
+                Offset of rows: 490
+                Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11 [srcpart]
+        /srcpart/ds=2008-04-08/hr=12 [srcpart]
+        /srcpart/ds=2008-04-09/hr=11 [srcpart]
+        /srcpart/ds=2008-04-09/hr=12 [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 10
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+414	414	2008-04-08	11
+477	477	2008-04-08	11
+222	222	2008-04-08	11
+126	126	2008-04-08	11
+90	90	2008-04-08	11
+169	169	2008-04-08	11
+403	403	2008-04-08	11
+400	400	2008-04-08	11
+200	200	2008-04-08	11
+97	97	2008-04-08	11
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         490
+         20
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 20
+                Offset of rows: 490
+                Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11 [srcpart]
+        /srcpart/ds=2008-04-08/hr=12 [srcpart]
+        /srcpart/ds=2008-04-09/hr=11 [srcpart]
+        /srcpart/ds=2008-04-09/hr=12 [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 20
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+414	414	2008-04-08	11
+477	477	2008-04-08	11
+222	222	2008-04-08	11
+126	126	2008-04-08	11
+90	90	2008-04-08	11
+169	169	2008-04-08	11
+403	403	2008-04-08	11
+400	400	2008-04-08	11
+200	200	2008-04-08	11
+97	97	2008-04-08	11
+238	238	2008-04-08	12
+86	86	2008-04-08	12
+311	311	2008-04-08	12
+27	27	2008-04-08	12
+165	165	2008-04-08	12
+409	409	2008-04-08	12
+255	255	2008-04-08	12
+278	278	2008-04-08	12
+98	98	2008-04-08	12
+484	484	2008-04-08	12
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         490
+         600
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 600
+                Offset of rows: 490
+                Statistics: Num rows: 600 Data size: 6000 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 600 Data size: 6000 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11 [srcpart]
+        /srcpart/ds=2008-04-08/hr=12 [srcpart]
+        /srcpart/ds=2008-04-09/hr=11 [srcpart]
+        /srcpart/ds=2008-04-09/hr=12 [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 600
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,600
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+414	414	2008-04-08	11
+477	477	2008-04-08	11
+222	222	2008-04-08	11
+126	126	2008-04-08	11
+90	90	2008-04-08	11
+169	169	2008-04-08	11
+403	403	2008-04-08	11
+400	400	2008-04-08	11
+200	200	2008-04-08	11
+97	97	2008-04-08	11
+238	238	2008-04-08	12
+86	86	2008-04-08	12
+311	311	2008-04-08	12
+27	27	2008-04-08	12
+165	165	2008-04-08	12
+409	409	2008-04-08	12
+255	255	2008-04-08	12
+278	278	2008-04-08	12
+98	98	2008-04-08	12
+484	484	2008-04-08	12
+265	265	2008-04-08	12
+193	193	2008-04-08	12
+401	401	2008-04-08	12
+150	150	2008-04-08	12
+273	273	2008-04-08	12
+224	224	2008-04-08	12
+369	369	2008-04-08	12
+66	66	2008-04-08	12
+128	128	2008-04-08	12
+213	213	2008-04-08	12
+146	146	2008-04-08	12
+406	406	2008-04-08	12
+429	429	2008-04-08	12
+374	374	2008-04-08	12
+152	152	2008-04-08	12
+469	469	2008-04-08	12
+145	145	2008-04-08	12
+495	495	2008-04-08	12
+37	37	2008-04-08	12
+327	327	2008-04-08	12
+281	281	2008-04-08	12
+277	277	2008-04-08	12
+209	209	2008-04-08	12
+15	15	2008-04-08	12
+82	82	2008-04-08	12
+403	403	2008-04-08	12
+166	166	2008-04-08	12
+417	417	2008-04-08	12
+430	430	2008-04-08	12
+252	252	2008-04-08	12
+292	292	2008-04-08	12
+219	219	2008-04-08	12
+287	287	2008-04-08	12
+153	153	2008-04-08	12
+193	193	2008-04-08	12
+338	338	2008-04-08	12
+446	446	2008-04-08	12
+459	459	2008-04-08	12
+394	394	2008-04-08	12
+237	237	2008-04-08	12
+482	482	2008-04-08	12
+174	174	2008-04-08	12
+413	413	2008-04-08	12
+494	494	2008-04-08	12
+207	207	2008-04-08	12
+199	199	2008-04-08	12
+466	466	2008-04-08	12
+208	208	2008-04-08	12
+174	174	2008-04-08	12
+399	399	2008-04-08	12
+396	396	2008-04-08	12
+247	247	2008-04-08	12
+417	417	2008-04-08	12
+489	489	2008-04-08	12
+162	162	2008-04-08	12
+377	377	2008-04-08	12
+397	397	2008-04-08	12
+309	309	2008-04-08	12
+365	365	2008-04-08	12
+266	266	2008-04-08	12
+439	439	2008-04-08	12
+342	342	2008-04-08	12
+367	367	2008-04-08	12
+325	325	2008-04-08	12
+167	167	2008-04-08	12
+195	195	2008-04-08	12
+475	475	2008-04-08	12
+17	17	2008-04-08	12
+113	113	2008-04-08	12
+155	155	2008-04-08	12
+203	203	2008-04-08	12
+339	339	2008-04-08	12
+0	0	2008-04-08	12
+455	455	2008-04-08	12
+128	128	2008-04-08	12
+311	311	2008-04-08	12
+316	316	2008-04-08	12
+57	57	2008-04-08	12
+302	302	2008-04-08	12
+205	205	2008-04-08	12
+149	149	2008-04-08	12
+438	438	2008-04-08	12
+345	345	2008-04-08	12
+129	129	2008-04-08	12
+170	170	2008-04-08	12
+20	20	2008-04-08	12
+489	489	2008-04-08	12
+157	157	2008-04-08	12
+378	378	2008-04-08	12
+221	221	2008-04-08	12
+92	92	2008-04-08	12
+111	111	2008-04-08	12
+47	47	2008-04-08	12
+72	72	2008-04-08	12
+4	4	2008-04-08	12
+280	280	2008-04-08	12
+35	35	2008-04-08	12
+427	427	2008-04-08	12
+277	277	2008-04-08	12
+208	208	2008-04-08	12
+356	356	2008-04-08	12
+399	399	2008-04-08	12
+169	169	2008-04-08	12
+382	382	2008-04-08	12
+498	498	2008-04-08	12
+125	125	2008-04-08	12
+386	386	2008-04-08	12
+437	437	2008-04-08	12
+469	469	2008-04-08	12
+192	192	2008-04-08	12
+286	286	2008-04-08	12
+187	187	2008-04-08	12
+176	176	2008-04-08	12
+54	54	2008-04-08	12
+459	459	2008-04-08	12
+51	51	2008-04-08	12
+138	138	2008-04-08	12
+103	103	2008-04-08	12
+239	239	2008-04-08	12
+213	213	2008-04-08	12
+216	216	2008-04-08	12
+430	430	2008-04-08	12
+278	278	2008-04-08	12
+176	176	2008-04-08	12
+289	289	2008-04-08	12
+221	221	2008-04-08	12
+65	65	2008-04-08	12
+318	318	2008-04-08	12
+332	332	2008-04-08	12
+311	311	2008-04-08	12
+275	275	2008-04-08	12
+137	137	2008-04-08	12
+241	241	2008-04-08	12
+83	83	2008-04-08	12
+333	333	2008-04-08	12
+180	180	2008-04-08	12
+284	284	2008-04-08	12
+12	12	2008-04-08	12
+230	230	2008-04-08	12
+181	181	2008-04-08	12
+67	67	2008-04-08	12
+260	260	2008-04-08	12
+404	404	2008-04-08	12
+384	384	2008-04-08	12
+489	489	2008-04-08	12
+353	353	2008-04-08	12
+373	373	2008-04-08	12
+272	272	2008-04-08	12
+138	138	2008-04-08	12
+217	217	2008-04-08	12
+84	84	2008-04-08	12
+348	348	2008-04-08	12
+466	466	2008-04-08	12
+58	58	2008-04-08	12
+8	8	2008-04-08	12
+411	411	2008-04-08	12
+230	230	2008-04-08	12
+208	208	2008-04-08	12
+348	348	2008-04-08	12
+24	24	2008-04-08	12
+463	463	2008-04-08	12
+431	431	2008-04-08	12
+179	179	2008-04-08	12
+172	172	2008-04-08	12
+42	42	2008-04-08	12
+129	129	2008-04-08	12
+158	158	2008-04-08	12
+119	119	2008-04-08	12
+496	496	2008-04-08	12
+0	0	2008-04-08	12
+322	322	2008-04-08	12
+197	197	2008-04-08	12
+468	468	2008-04-08	12
+393	393	2008-04-08	12
+454	454	2008-04-08	12
+100	100	2008-04-08	12
+298	298	2008-04-08	12
+199	199	2008-04-08	12
+191	191	2008-04-08	12
+418	418	2008-04-08	12
+96	96	2008-04-08	12
+26	26	2008-04-08	12
+165	165	2008-04-08	12
+327	327	2008-04-08	12
+230	230	2008-04-08	12
+205	205	2008-04-08	12
+120	120	2008-04-08	12
+131	131	2008-04-08	12
+51	51	2008-04-08	12
+404	404	2008-04-08	12
+43	43	2008-04-08	12
+436	436	2008-04-08	12
+156	156	2008-04-08	12
+469	469	2008-04-08	12
+468	468	2008-04-08	12
+308	308	2008-04-08	12
+95	95	2008-04-08	12
+196	196	2008-04-08	12
+288	288	2008-04-08	12
+481	481	2008-04-08	12
+457	457	2008-04-08	12
+98	98	2008-04-08	12
+282	282	2008-04-08	12
+197	197	2008-04-08	12
+187	187	2008-04-08	12
+318	318	2008-04-08	12
+318	318	2008-04-08	12
+409	409	2008-04-08	12
+470	470	2008-04-08	12
+137	137	2008-04-08	12
+369	369	2008-04-08	12
+316	316	2008-04-08	12
+169	169	2008-04-08	12
+413	413	2008-04-08	12
+85	85	2008-04-08	12
+77	77	2008-04-08	12
+0	0	2008-04-08	12
+490	490	2008-04-08	12
+87	87	2008-04-08	12
+364	364	2008-04-08	12
+179	179	2008-04-08	12
+118	118	2008-04-08	12
+134	134	2008-04-08	12
+395	395	2008-04-08	12
+282	282	2008-04-08	12
+138	138	2008-04-08	12
+238	238	2008-04-08	12
+419	419	2008-04-08	12
+15	15	2008-04-08	12
+118	118	2008-04-08	12
+72	72	2008-04-08	12
+90	90	2008-04-08	12
+307	307	2008-04-08	12
+19	19	2008-04-08	12
+435	435	2008-04-08	12
+10	10	2008-04-08	12
+277	277	2008-04-08	12
+273	273	2008-04-08	12
+306	306	2008-04-08	12
+224	224	2008-04-08	12
+309	309	2008-04-08	12
+389	389	2008-04-08	12
+327	327	2008-04-08	12
+242	242	2008-04-08	12
+369	369	2008-04-08	12
+392	392	2008-04-08	12
+272	272	2008-04-08	12
+331	331	2008-04-08	12
+401	401	2008-04-08	12
+242	242	2008-04-08	12
+452	452	2008-04-08	12
+177	177	2008-04-08	12
+226	226	2008-04-08	12
+5	5	2008-04-08	12
+497	497	2008-04-08	12
+402	402	2008-04-08	12
+396	396	2008-04-08	12
+317	317	2008-04-08	12
+395	395	2008-04-08	12
+58	58	2008-04-08	12
+35	35	2008-04-08	12
+336	336	2008-04-08	12
+95	95	2008-04-08	12
+11	11	2008-04-08	12
+168	168	2008-04-08	12
+34	34	2008-04-08	12
+229	229	2008-04-08	12
+233	233	2008-04-08	12
+143	143	2008-04-08	12
+472	472	2008-04-08	12
+322	322	2008-04-08	12
+498	498	2008-04-08	12
+160	160	2008-04-08	12
+195	195	2008-04-08	12
+42	42	2008-04-08	12
+321	321	2008-04-08	12
+430	430	2008-04-08	12
+119	119	2008-04-08	12
+489	489	2008-04-08	12
+458	458	2008-04-08	12
+78	78	2008-04-08	12
+76	76	2008-04-08	12
+41	41	2008-04-08	12
+223	223	2008-04-08	12
+492	492	2008-04-08	12
+149	149	2008-04-08	12
+449	449	2008-04-08	12
+218	218	2008-04-08	12
+228	228	2008-04-08	12
+138	138	2008-04-08	12
+453	453	2008-04-08	12
+30	30	2008-04-08	12
+209	209	2008-04-08	12
+64	64	2008-04-08	12
+468	468	2008-04-08	12
+76	76	2008-04-08	12
+74	74	2008-04-08	12
+342	342	2008-04-08	12
+69	69	2008-04-08	12
+230	230	2008-04-08	12
+33	33	2008-04-08	12
+368	368	2008-04-08	12
+103	103	2008-04-08	12
+296	296	2008-04-08	12
+113	113	2008-04-08	12
+216	216	2008-04-08	12
+367	367	2008-04-08	12
+344	344	2008-04-08	12
+167	167	2008-04-08	12
+274	274	2008-04-08	12
+219	219	2008-04-08	12
+239	239	2008-04-08	12
+485	485	2008-04-08	12
+116	116	2008-04-08	12
+223	223	2008-04-08	12
+256	256	2008-04-08	12
+263	263	2008-04-08	12
+70	70	2008-04-08	12
+487	487	2008-04-08	12
+480	480	2008-04-08	12
+401	401	2008-04-08	12
+288	288	2008-04-08	12
+191	191	2008-04-08	12
+5	5	2008-04-08	12
+244	244	2008-04-08	12
+438	438	2008-04-08	12
+128	128	2008-04-08	12
+467	467	2008-04-08	12
+432	432	2008-04-08	12
+202	202	2008-04-08	12
+316	316	2008-04-08	12
+229	229	2008-04-08	12
+469	469	2008-04-08	12
+463	463	2008-04-08	12
+280	280	2008-04-08	12
+2	2	2008-04-08	12
+35	35	2008-04-08	12
+283	283	2008-04-08	12
+331	331	2008-04-08	12
+235	235	2008-04-08	12
+80	80	2008-04-08	12
+44	44	2008-04-08	12
+193	193	2008-04-08	12
+321	321	2008-04-08	12
+335	335	2008-04-08	12
+104	104	2008-04-08	12
+466	466	2008-04-08	12
+366	366	2008-04-08	12
+175	175	2008-04-08	12
+403	403	2008-04-08	12
+483	483	2008-04-08	12
+53	53	2008-04-08	12
+105	105	2008-04-08	12
+257	257	2008-04-08	12
+406	406	2008-04-08	12
+409	409	2008-04-08	12
+190	190	2008-04-08	12
+406	406	2008-04-08	12
+401	401	2008-04-08	12
+114	114	2008-04-08	12
+258	258	2008-04-08	12
+90	90	2008-04-08	12
+203	203	2008-04-08	12
+262	262	2008-04-08	12
+348	348	2008-04-08	12
+424	424	2008-04-08	12
+12	12	2008-04-08	12
+396	396	2008-04-08	12
+201	201	2008-04-08	12
+217	217	2008-04-08	12
+164	164	2008-04-08	12
+431	431	2008-04-08	12
+454	454	2008-04-08	12
+478	478	2008-04-08	12
+298	298	2008-04-08	12
+125	125	2008-04-08	12
+431	431	2008-04-08	12
+164	164	2008-04-08	12
+424	424	2008-04-08	12
+187	187	2008-04-08	12
+382	382	2008-04-08	12
+5	5	2008-04-08	12
+70	70	2008-04-08	12
+397	397	2008-04-08	12
+480	480	2008-04-08	12
+291	291	2008-04-08	12
+24	24	2008-04-08	12
+351	351	2008-04-08	12
+255	255	2008-04-08	12
+104	104	2008-04-08	12
+70	70	2008-04-08	12
+163	163	2008-04-08	12
+438	438	2008-04-08	12
+119	119	2008-04-08	12
+414	414	2008-04-08	12
+200	200	2008-04-08	12
+491	491	2008-04-08	12
+237	237	2008-04-08	12
+439	439	2008-04-08	12
+360	360	2008-04-08	12
+248	248	2008-04-08	12
+479	479	2008-04-08	12
+305	305	2008-04-08	12
+417	417	2008-04-08	12
+199	199	2008-04-08	12
+444	444	2008-04-08	12
+120	120	2008-04-08	12
+429	429	2008-04-08	12
+169	169	2008-04-08	12
+443	443	2008-04-08	12
+323	323	2008-04-08	12
+325	325	2008-04-08	12
+277	277	2008-04-08	12
+230	230	2008-04-08	12
+478	478	2008-04-08	12
+178	178	2008-04-08	12
+468	468	2008-04-08	12
+310	310	2008-04-08	12
+317	317	2008-04-08	12
+333	333	2008-04-08	12
+493	493	2008-04-08	12
+460	460	2008-04-08	12
+207	207	2008-04-08	12
+249	249	2008-04-08	12
+265	265	2008-04-08	12
+480	480	2008-04-08	12
+83	83	2008-04-08	12
+136	136	2008-04-08	12
+353	353	2008-04-08	12
+172	172	2008-04-08	12
+214	214	2008-04-08	12
+462	462	2008-04-08	12
+233	233	2008-04-08	12
+406	406	2008-04-08	12
+133	133	2008-04-08	12
+175	175	2008-04-08	12
+189	189	2008-04-08	12
+454	454	2008-04-08	12
+375	375	2008-04-08	12
+401	401	2008-04-08	12
+421	421	2008-04-08	12
+407	407	2008-04-08	12
+384	384	2008-04-08	12
+256	256	2008-04-08	12
+26	26	2008-04-08	12
+134	134	2008-04-08	12
+67	67	2008-04-08	12
+384	384	2008-04-08	12
+379	379	2008-04-08	12
+18	18	2008-04-08	12
+462	462	2008-04-08	12
+492	492	2008-04-08	12
+100	100	2008-04-08	12
+298	298	2008-04-08	12
+9	9	2008-04-08	12
+341	341	2008-04-08	12
+498	498	2008-04-08	12
+146	146	2008-04-08	12
+458	458	2008-04-08	12
+362	362	2008-04-08	12
+186	186	2008-04-08	12
+285	285	2008-04-08	12
+348	348	2008-04-08	12
+167	167	2008-04-08	12
+18	18	2008-04-08	12
+273	273	2008-04-08	12
+183	183	2008-04-08	12
+281	281	2008-04-08	12
+344	344	2008-04-08	12
+97	97	2008-04-08	12
+469	469	2008-04-08	12
+315	315	2008-04-08	12
+84	84	2008-04-08	12
+28	28	2008-04-08	12
+37	37	2008-04-08	12
+448	448	2008-04-08	12
+152	152	2008-04-08	12
+348	348	2008-04-08	12
+307	307	2008-04-08	12
+194	194	2008-04-08	12
+414	414	2008-04-08	12
+477	477	2008-04-08	12
+222	222	2008-04-08	12
+126	126	2008-04-08	12
+90	90	2008-04-08	12
+169	169	2008-04-08	12
+403	403	2008-04-08	12
+400	400	2008-04-08	12
+200	200	2008-04-08	12
+97	97	2008-04-08	12
+238	238	2008-04-09	11
+86	86	2008-04-09	11
+311	311	2008-04-09	11
+27	27	2008-04-09	11
+165	165	2008-04-09	11
+409	409	2008-04-09	11
+255	255	2008-04-09	11
+278	278	2008-04-09	11
+98	98	2008-04-09	11
+484	484	2008-04-09	11
+265	265	2008-04-09	11
+193	193	2008-04-09	11
+401	401	2008-04-09	11
+150	150	2008-04-09	11
+273	273	2008-04-09	11
+224	224	2008-04-09	11
+369	369	2008-04-09	11
+66	66	2008-04-09	11
+128	128	2008-04-09	11
+213	213	2008-04-09	11
+146	146	2008-04-09	11
+406	406	2008-04-09	11
+429	429	2008-04-09	11
+374	374	2008-04-09	11
+152	152	2008-04-09	11
+469	469	2008-04-09	11
+145	145	2008-04-09	11
+495	495	2008-04-09	11
+37	37	2008-04-09	11
+327	327	2008-04-09	11
+281	281	2008-04-09	11
+277	277	2008-04-09	11
+209	209	2008-04-09	11
+15	15	2008-04-09	11
+82	82	2008-04-09	11
+403	403	2008-04-09	11
+166	166	2008-04-09	11
+417	417	2008-04-09	11
+430	430	2008-04-09	11
+252	252	2008-04-09	11
+292	292	2008-04-09	11
+219	219	2008-04-09	11
+287	287	2008-04-09	11
+153	153	2008-04-09	11
+193	193	2008-04-09	11
+338	338	2008-04-09	11
+446	446	2008-04-09	11
+459	459	2008-04-09	11
+394	394	2008-04-09	11
+237	237	2008-04-09	11
+482	482	2008-04-09	11
+174	174	2008-04-09	11
+413	413	2008-04-09	11
+494	494	2008-04-09	11
+207	207	2008-04-09	11
+199	199	2008-04-09	11
+466	466	2008-04-09	11
+208	208	2008-04-09	11
+174	174	2008-04-09	11
+399	399	2008-04-09	11
+396	396	2008-04-09	11
+247	247	2008-04-09	11
+417	417	2008-04-09	11
+489	489	2008-04-09	11
+162	162	2008-04-09	11
+377	377	2008-04-09	11
+397	397	2008-04-09	11
+309	309	2008-04-09	11
+365	365	2008-04-09	11
+266	266	2008-04-09	11
+439	439	2008-04-09	11
+342	342	2008-04-09	11
+367	367	2008-04-09	11
+325	325	2008-04-09	11
+167	167	2008-04-09	11
+195	195	2008-04-09	11
+475	475	2008-04-09	11
+17	17	2008-04-09	11
+113	113	2008-04-09	11
+155	155	2008-04-09	11
+203	203	2008-04-09	11
+339	339	2008-04-09	11
+0	0	2008-04-09	11
+455	455	2008-04-09	11
+128	128	2008-04-09	11
+311	311	2008-04-09	11
+316	316	2008-04-09	11
+57	57	2008-04-09	11
+302	302	2008-04-09	11
+205	205	2008-04-09	11
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         400
+         10
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 10
+                Offset of rows: 400
+                Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: kv1.txt
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11/kv1.txt [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 10
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 400,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+70	70	2008-04-08	11
+163	163	2008-04-08	11
+438	438	2008-04-08	11
+119	119	2008-04-08	11
+414	414	2008-04-08	11
+200	200	2008-04-08	11
+491	491	2008-04-08	11
+237	237	2008-04-08	11
+439	439	2008-04-08	11
+360	360	2008-04-08	11
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         490
+         10
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 10
+                Offset of rows: 490
+                Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 10 Data size: 100 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11 [srcpart]
+        /srcpart/ds=2008-04-08/hr=12 [srcpart]
+        /srcpart/ds=2008-04-09/hr=11 [srcpart]
+        /srcpart/ds=2008-04-09/hr=12 [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 10
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+PREHOOK: type: QUERY
+PREHOOK: Input: default@srcpart
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+PREHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,10
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@srcpart
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=11
+POSTHOOK: Input: default@srcpart@ds=2008-04-09/hr=12
+#### A masked pattern was here ####
+414	414	2008-04-08	11
+477	477	2008-04-08	11
+222	222	2008-04-08	11
+126	126	2008-04-08	11
+90	90	2008-04-08	11
+169	169	2008-04-08	11
+403	403	2008-04-08	11
+400	400	2008-04-08	11
+200	200	2008-04-08	11
+97	97	2008-04-08	11
+PREHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN EXTENDED
+SELECT srcpart.key, substr(srcpart.value,5), ds, hr FROM srcpart LIMIT 490,20
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_TABREF
+         TOK_TABNAME
+            srcpart
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  srcpart
+               key
+         TOK_SELEXPR
+            TOK_FUNCTION
+               substr
+               .
+                  TOK_TABLE_OR_COL
+                     srcpart
+                  value
+               5
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               ds
+         TOK_SELEXPR
+            TOK_TABLE_OR_COL
+               hr
+      TOK_LIMIT
+         490
+         20
+
+
+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: srcpart
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            GatherStats: false
+            Select Operator
+              expressions: key (type: string), substr(value, 5) (type: string), ds (type: string), hr (type: string)
+              outputColumnNames: _col0, _col1, _col2, _col3
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 20
+                Offset of rows: 490
+                Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+                  Statistics: Num rows: 20 Data size: 200 Basic stats: COMPLETE Column stats: NONE
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1,_col2,_col3
+                        columns.types string:string:string:string
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.escape.crlf true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+      Path -> Alias:
+#### A masked pattern was here ####
+      Path -> Partition:
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-08
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=11
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 11
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+#### A masked pattern was here ####
+          Partition
+            base file name: hr=12
+            input format: org.apache.hadoop.mapred.TextInputFormat
+            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+            partition values:
+              ds 2008-04-09
+              hr 12
+            properties:
+              COLUMN_STATS_ACCURATE true
+              bucket_count -1
+              columns key,value
+              columns.comments 'default','default'
+              columns.types string:string
+#### A masked pattern was here ####
+              name default.srcpart
+              numFiles 1
+              numRows 500
+              partition_columns ds/hr
+              partition_columns.types string:string
+              rawDataSize 5312
+              serialization.ddl struct srcpart { string key, string value}
+              serialization.format 1
+              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              totalSize 5812
+#### A masked pattern was here ####
+            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          
+              input format: org.apache.hadoop.mapred.TextInputFormat
+              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+              properties:
+                bucket_count -1
+                columns key,value
+                columns.comments 'default','default'
+                columns.types string:string
+#### A masked pattern was here ####
+                name default.srcpart
+                partition_columns ds/hr
+                partition_columns.types string:string
+                serialization.ddl struct srcpart { string key, string value}
+                serialization.format 1
+                serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+#### A masked pattern was here ####
+              serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+              name: default.srcpart
+            name: default.srcpart
+      Truncated Path -> Alias:
+        /srcpart/ds=2008-04-08/hr=11 [srcpart]
+        /srcpart/ds=2008-04-08/hr=12 [srcpart]
+        /srcpart/ds=2008-04-09/hr=11 [srcpart]
+        /srcpart/ds=2008-04-09/hr=12 [srcpart]
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 20
+      Processor Tree:
+        ListSink
+
+

<TRUNCATED>

[06/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/explainuser_3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainuser_3.q.out b/ql/src/test/results/clientpositive/tez/explainuser_3.q.out
index 33d9457..e2db163 100644
--- a/ql/src/test/results/clientpositive/tez/explainuser_3.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainuser_3.q.out
@@ -719,14 +719,14 @@ Stage-0
       limit:-1
       Stage-1
          Map 2
-         File Output Operator [FS_12]
+         File Output Operator [FS_10]
             compressed:false
             Statistics:Num rows: 550 Data size: 5843 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"}
-            Select Operator [SEL_11]
+            Select Operator [SEL_9]
                outputColumnNames:["_col0","_col1","_col2"]
                Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-               Map Join Operator [MAPJOIN_17]
+               Map Join Operator [MAPJOIN_15]
                |  BucketMapJoin:true
                |  condition map:[{"":"Inner Join 0 to 1"}]
                |  HybridGraceHashJoin:true
@@ -734,7 +734,7 @@ Stage-0
                |  outputColumnNames:["_col0","_col1","_col3"]
                |  Statistics:Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                |<-Map 1 [CUSTOM_EDGE]
-               |  Reduce Output Operator [RS_7]
+               |  Reduce Output Operator [RS_6]
                |     key expressions:_col0 (type: int)
                |     Map-reduce partition columns:_col0 (type: int)
                |     sort order:+
@@ -743,7 +743,7 @@ Stage-0
                |     Select Operator [SEL_2]
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
-               |        Filter Operator [FIL_15]
+               |        Filter Operator [FIL_13]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 242 Data size: 2566 Basic stats: COMPLETE Column stats: NONE
                |           TableScan [TS_0]
@@ -752,7 +752,7 @@ Stage-0
                |<-Select Operator [SEL_5]
                      outputColumnNames:["_col0","_col1"]
                      Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                     Filter Operator [FIL_16]
+                     Filter Operator [FIL_14]
                         predicate:key is not null (type: boolean)
                         Statistics:Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                         TableScan [TS_3]

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out b/ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out
index 3c7b406..012c28e 100644
--- a/ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out
+++ b/ql/src/test/results/clientpositive/tez/mapjoin_decimal.q.out
@@ -139,7 +139,6 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: decimal(6,2))
                         Statistics: Num rows: 1049 Data size: 117488 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: decimal(4,0))
         Reducer 2 
             Reduce Operator Tree:
               Select Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out b/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
index 485e1c1..63b9462 100644
--- a/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/mapjoin_mapjoin.q.out
@@ -490,7 +490,7 @@ STAGE PLANS:
                   alias: srcpart
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_450') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_450') and key is not null) (type: boolean)
                     Statistics: Num rows: 666 Data size: 7075 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/mergejoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/mergejoin.q.out b/ql/src/test/results/clientpositive/tez/mergejoin.q.out
index 15c204d..4b2d963 100644
--- a/ql/src/test/results/clientpositive/tez/mergejoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/mergejoin.q.out
@@ -2711,7 +2711,7 @@ NULL	NULL	NULL	98	val_98	2008-04-08	98	val_98	2008-04-08
 NULL	NULL	NULL	98	val_98	2008-04-08	98	val_98	2008-04-08
 NULL	NULL	NULL	98	val_98	2008-04-08	98	val_98	2008-04-08
 NULL	NULL	NULL	98	val_98	2008-04-08	98	val_98	2008-04-08
-Warning: Shuffle Join MERGEJOIN[20][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: select * from
 (select * from tab where tab.key = 0)a
 join

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/skewjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/skewjoin.q.out b/ql/src/test/results/clientpositive/tez/skewjoin.q.out
index 70d2418..fc084cc 100644
--- a/ql/src/test/results/clientpositive/tez/skewjoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/skewjoin.q.out
@@ -705,7 +705,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((value is not null and key is not null) and UDFToDouble(substring(value, 5)) is not null) (type: boolean)
+                    predicate: (value is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -722,16 +722,16 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((value is not null and key is not null) and (UDFToDouble(substring(value, 5)) + 1.0) is not null) (type: boolean)
+                    predicate: (value is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                        key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                         sort order: ++
-                        Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                        Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: string)
         Reducer 2 
@@ -741,7 +741,7 @@ STAGE PLANS:
                      Inner Join 0 to 1
                 keys:
                   0 _col0 (type: string), UDFToDouble(substring(_col1, 5)) (type: double)
-                  1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                  1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                 outputColumnNames: _col2, _col3
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
@@ -837,7 +837,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -854,7 +854,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/subquery_exists.q.out b/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
index 66b48d4..5121a14 100644
--- a/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
+++ b/ql/src/test/results/clientpositive/tez/subquery_exists.q.out
@@ -41,7 +41,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_9') and key is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -58,7 +58,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_9') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_9') and key is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: value (type: string), key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/subquery_in.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/subquery_in.q.out b/ql/src/test/results/clientpositive/tez/subquery_in.q.out
index ff75000..a4887e4 100644
--- a/ql/src/test/results/clientpositive/tez/subquery_in.q.out
+++ b/ql/src/test/results/clientpositive/tez/subquery_in.q.out
@@ -149,7 +149,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -166,7 +166,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -282,15 +282,12 @@ STAGE PLANS:
                       expressions: p_name (type: string), p_size (type: int), UDFToDouble(p_size) (type: double)
                       outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col2 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col2 (type: double)
+                        sort order: +
+                        Map-reduce partition columns: _col2 (type: double)
                         Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col2 (type: double)
-                          sort order: +
-                          Map-reduce partition columns: _col2 (type: double)
-                          Statistics: Num rows: 26 Data size: 3147 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col0 (type: string), _col1 (type: int)
+                        value expressions: _col0 (type: string), _col1 (type: int)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -632,7 +629,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -649,7 +646,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((key > '9') and value is not null) and key is not null) (type: boolean)
+                    predicate: ((key > '9') and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/tez_dynpart_hashjoin_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/tez_dynpart_hashjoin_2.q.out b/ql/src/test/results/clientpositive/tez/tez_dynpart_hashjoin_2.q.out
index c9e712d..322462b 100644
--- a/ql/src/test/results/clientpositive/tez/tez_dynpart_hashjoin_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/tez_dynpart_hashjoin_2.q.out
@@ -44,7 +44,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -62,7 +62,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -79,7 +79,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -230,7 +230,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -248,7 +248,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -265,7 +265,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -414,7 +414,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -432,7 +432,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -449,7 +449,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/tez_vector_dynpart_hashjoin_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/tez_vector_dynpart_hashjoin_2.q.out b/ql/src/test/results/clientpositive/tez/tez_vector_dynpart_hashjoin_2.q.out
index e71a4ef..d45ff04 100644
--- a/ql/src/test/results/clientpositive/tez/tez_vector_dynpart_hashjoin_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/tez_vector_dynpart_hashjoin_2.q.out
@@ -44,7 +44,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -62,7 +62,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -79,7 +79,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -230,7 +230,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -249,7 +249,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -266,7 +266,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -416,7 +416,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 12288 Data size: 2641964 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((csmallint < 100) and UDFToInteger(csmallint) is not null) (type: boolean)
+                    predicate: (csmallint < 100) (type: boolean)
                     Statistics: Num rows: 4096 Data size: 880654 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ctinyint (type: tinyint), csmallint (type: smallint), cint (type: int), cbigint (type: bigint), cfloat (type: float), cdouble (type: double), cstring1 (type: string), cstring2 (type: string), ctimestamp1 (type: timestamp), ctimestamp2 (type: timestamp), cboolean1 (type: boolean), cboolean2 (type: boolean)
@@ -435,7 +435,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToInteger(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -452,7 +452,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToInteger(key) + 0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_auto_smb_mapjoin_14.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_auto_smb_mapjoin_14.q.out b/ql/src/test/results/clientpositive/tez/vector_auto_smb_mapjoin_14.q.out
index 9b62353..51c4ac8 100644
--- a/ql/src/test/results/clientpositive/tez/vector_auto_smb_mapjoin_14.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_auto_smb_mapjoin_14.q.out
@@ -64,24 +64,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
@@ -89,7 +89,7 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
+                     |     Filter Operator [FIL_18]
                      |        predicate:key is not null (type: boolean)
                      |        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
@@ -98,7 +98,7 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
+                           Filter Operator [FIL_17]
                               predicate:key is not null (type: boolean)
                               Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
@@ -153,40 +153,40 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 3 vectorized
-         File Output Operator [FS_21]
+         File Output Operator [FS_19]
             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"}
-            Group By Operator [OP_31]
+            Group By Operator [OP_29]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Reducer 2 [SIMPLE_EDGE] vectorized
-               Reduce Output Operator [RS_18]
+               Reduce Output Operator [RS_16]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [OP_30]
+                  Group By Operator [OP_28]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Select Operator [OP_29]
+                     Select Operator [OP_27]
                         Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
-                        Group By Operator [OP_28]
+                        Group By Operator [OP_26]
                         |  keys:KEY._col0 (type: int)
                         |  outputColumnNames:["_col0"]
                         |  Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
                         |<-Map 1 [SIMPLE_EDGE]
-                           Reduce Output Operator [RS_13]
+                           Reduce Output Operator [RS_11]
                               key expressions:_col0 (type: int)
                               Map-reduce partition columns:_col0 (type: int)
                               sort order:+
                               Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
-                              Group By Operator [GBY_12]
+                              Group By Operator [GBY_10]
                                  keys:_col0 (type: int)
                                  outputColumnNames:["_col0"]
                                  Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
-                                 Merge Join Operator [MERGEJOIN_26]
+                                 Merge Join Operator [MERGEJOIN_24]
                                  |  condition map:[{"":"Inner Join 0 to 1"}]
                                  |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                                  |  outputColumnNames:["_col0"]
@@ -195,7 +195,7 @@ Stage-0
                                  |<-Select Operator [SEL_5]
                                  |     outputColumnNames:["_col0"]
                                  |     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                 |     Filter Operator [FIL_25]
+                                 |     Filter Operator [FIL_23]
                                  |        predicate:key is not null (type: boolean)
                                  |        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                                  |        TableScan [TS_3]
@@ -204,7 +204,7 @@ Stage-0
                                  |<-Select Operator [SEL_2]
                                        outputColumnNames:["_col0"]
                                        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                       Filter Operator [FIL_24]
+                                       Filter Operator [FIL_22]
                                           predicate:key is not null (type: boolean)
                                           Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                                           TableScan [TS_0]
@@ -286,43 +286,43 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 3
-         File Output Operator [FS_38]
+         File Output Operator [FS_32]
             compressed:false
             Statistics:Num rows: 5 Data size: 511 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"}
-            Select Operator [SEL_37]
+            Select Operator [SEL_31]
                outputColumnNames:["_col0","_col1","_col2"]
                Statistics:Num rows: 5 Data size: 511 Basic stats: COMPLETE Column stats: NONE
-               Merge Join Operator [MERGEJOIN_55]
+               Merge Join Operator [MERGEJOIN_49]
                |  condition map:[{"":"Inner Join 0 to 1"}]
                |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                |  outputColumnNames:["_col0","_col1","_col3"]
                |  Statistics:Num rows: 5 Data size: 511 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 2 [SIMPLE_EDGE] vectorized
-               |  Reduce Output Operator [RS_57]
+               |  Reduce Output Operator [RS_51]
                |     key expressions:_col0 (type: int)
                |     Map-reduce partition columns:_col0 (type: int)
                |     sort order:+
                |     Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
                |     value expressions:_col1 (type: bigint)
-               |     Group By Operator [OP_56]
+               |     Group By Operator [OP_50]
                |     |  aggregations:["count(VALUE._col0)"]
                |     |  keys:KEY._col0 (type: int)
                |     |  outputColumnNames:["_col0","_col1"]
                |     |  Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
                |     |<-Map 1 [SIMPLE_EDGE]
-               |        Reduce Output Operator [RS_13]
+               |        Reduce Output Operator [RS_11]
                |           key expressions:_col0 (type: int)
                |           Map-reduce partition columns:_col0 (type: int)
                |           sort order:+
                |           Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
                |           value expressions:_col1 (type: bigint)
-               |           Group By Operator [GBY_12]
+               |           Group By Operator [GBY_10]
                |              aggregations:["count()"]
                |              keys:_col0 (type: int)
                |              outputColumnNames:["_col0","_col1"]
                |              Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
-               |              Merge Join Operator [MERGEJOIN_51]
+               |              Merge Join Operator [MERGEJOIN_45]
                |              |  condition map:[{"":"Inner Join 0 to 1"}]
                |              |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                |              |  outputColumnNames:["_col0"]
@@ -331,7 +331,7 @@ Stage-0
                |              |<-Select Operator [SEL_5]
                |              |     outputColumnNames:["_col0"]
                |              |     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-               |              |     Filter Operator [FIL_48]
+               |              |     Filter Operator [FIL_42]
                |              |        predicate:key is not null (type: boolean)
                |              |        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                |              |        TableScan [TS_3]
@@ -340,58 +340,58 @@ Stage-0
                |              |<-Select Operator [SEL_2]
                |                    outputColumnNames:["_col0"]
                |                    Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-               |                    Filter Operator [FIL_47]
+               |                    Filter Operator [FIL_41]
                |                       predicate:key is not null (type: boolean)
                |                       Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                |                       TableScan [TS_0]
                |                          alias:a
                |                          Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                |<-Reducer 6 [SIMPLE_EDGE] vectorized
-                  Reduce Output Operator [RS_59]
+                  Reduce Output Operator [RS_53]
                      key expressions:_col0 (type: int)
                      Map-reduce partition columns:_col0 (type: int)
                      sort order:+
                      Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
                      value expressions:_col1 (type: bigint)
-                     Group By Operator [OP_58]
+                     Group By Operator [OP_52]
                      |  aggregations:["count(VALUE._col0)"]
                      |  keys:KEY._col0 (type: int)
                      |  outputColumnNames:["_col0","_col1"]
                      |  Statistics:Num rows: 5 Data size: 465 Basic stats: COMPLETE Column stats: NONE
                      |<-Map 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_29]
+                        Reduce Output Operator [RS_25]
                            key expressions:_col0 (type: int)
                            Map-reduce partition columns:_col0 (type: int)
                            sort order:+
                            Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
                            value expressions:_col1 (type: bigint)
-                           Group By Operator [GBY_28]
+                           Group By Operator [GBY_24]
                               aggregations:["count()"]
                               keys:_col0 (type: int)
                               outputColumnNames:["_col0","_col1"]
                               Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
-                              Merge Join Operator [MERGEJOIN_53]
+                              Merge Join Operator [MERGEJOIN_47]
                               |  condition map:[{"":"Inner Join 0 to 1"}]
                               |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                               |  outputColumnNames:["_col0"]
                               |  Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
                               |  
-                              |<-Select Operator [SEL_21]
+                              |<-Select Operator [SEL_19]
                               |     outputColumnNames:["_col0"]
                               |     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                              |     Filter Operator [FIL_50]
+                              |     Filter Operator [FIL_44]
                               |        predicate:key is not null (type: boolean)
                               |        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                              |        TableScan [TS_19]
+                              |        TableScan [TS_17]
                               |           alias:b
                               |           Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                              |<-Select Operator [SEL_18]
+                              |<-Select Operator [SEL_16]
                                     outputColumnNames:["_col0"]
                                     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                    Filter Operator [FIL_49]
+                                    Filter Operator [FIL_43]
                                        predicate:key is not null (type: boolean)
                                        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                       TableScan [TS_16]
+                                       TableScan [TS_14]
                                           alias:a
                                           Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
 
@@ -467,24 +467,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 3 Data size: 306 Basic stats: COMPLETE Column stats: NONE
@@ -492,7 +492,7 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
+                     |     Filter Operator [FIL_18]
                      |        predicate:(key < 6) (type: boolean)
                      |        Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
@@ -501,7 +501,7 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
+                           Filter Operator [FIL_17]
                               predicate:(key < 6) (type: boolean)
                               Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
@@ -565,24 +565,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 1 Data size: 102 Basic stats: COMPLETE Column stats: NONE
@@ -590,8 +590,8 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
-                     |        predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                     |     Filter Operator [FIL_18]
+                     |        predicate:((key < 8) and (key < 6)) (type: boolean)
                      |        Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
                      |           alias:b
@@ -599,8 +599,8 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
-                              predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                           Filter Operator [FIL_17]
+                              predicate:((key < 8) and (key < 6)) (type: boolean)
                               Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
                                  alias:a
@@ -687,24 +687,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 1 Data size: 102 Basic stats: COMPLETE Column stats: NONE
@@ -712,8 +712,8 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
-                     |        predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                     |     Filter Operator [FIL_18]
+                     |        predicate:((key < 8) and (key < 6)) (type: boolean)
                      |        Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
                      |           alias:a
@@ -721,8 +721,8 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
-                              predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                           Filter Operator [FIL_17]
+                              predicate:((key < 8) and (key < 6)) (type: boolean)
                               Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
                                  alias:a
@@ -799,24 +799,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 3 Data size: 306 Basic stats: COMPLETE Column stats: NONE
@@ -824,7 +824,7 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
+                     |     Filter Operator [FIL_18]
                      |        predicate:(key < 8) (type: boolean)
                      |        Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
@@ -833,7 +833,7 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
+                           Filter Operator [FIL_17]
                               predicate:(key < 8) (type: boolean)
                               Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
@@ -888,63 +888,57 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 3 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_32]
+            Group By Operator [OP_28]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Reducer 2 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_23]
+                     Merge Join Operator [MERGEJOIN_21]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 11 Data size: 1023 Basic stats: COMPLETE Column stats: NONE
                      |<-Map 1 [SIMPLE_EDGE] vectorized
-                     |  Reduce Output Operator [RS_27]
+                     |  Reduce Output Operator [RS_24]
                      |     key expressions:_col0 (type: int)
                      |     Map-reduce partition columns:_col0 (type: int)
                      |     sort order:+
                      |     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_26]
-                     |        predicate:_col0 is not null (type: boolean)
+                     |     Select Operator [OP_23]
+                     |        outputColumnNames:["_col0"]
                      |        Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                     |        Select Operator [OP_25]
-                     |           outputColumnNames:["_col0"]
+                     |        Filter Operator [FIL_22]
+                     |           predicate:(key + 1) is not null (type: boolean)
                      |           Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                     |           Filter Operator [FIL_24]
-                     |              predicate:(key + 1) is not null (type: boolean)
+                     |           TableScan [TS_0]
+                     |              alias:a
                      |              Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                     |              TableScan [TS_0]
-                     |                 alias:a
-                     |                 Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
                      |<-Map 4 [SIMPLE_EDGE] vectorized
-                        Reduce Output Operator [RS_31]
+                        Reduce Output Operator [RS_27]
                            key expressions:_col0 (type: int)
                            Map-reduce partition columns:_col0 (type: int)
                            sort order:+
                            Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_30]
-                              predicate:_col0 is not null (type: boolean)
+                           Select Operator [OP_26]
+                              outputColumnNames:["_col0"]
                               Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                              Select Operator [OP_29]
-                                 outputColumnNames:["_col0"]
+                              Filter Operator [FIL_25]
+                                 predicate:(key + 1) is not null (type: boolean)
                                  Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                 Filter Operator [FIL_28]
-                                    predicate:(key + 1) is not null (type: boolean)
+                                 TableScan [TS_3]
+                                    alias:a
                                     Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                                    TableScan [TS_3]
-                                       alias:a
-                                       Statistics:Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
 
 PREHOOK: query: select count(*) from 
   (select a.key +1 as key, concat(a.value, a.value) as value from tbl1 a) subq1 
@@ -989,24 +983,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 3 Data size: 306 Basic stats: COMPLETE Column stats: NONE
@@ -1014,7 +1008,7 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
+                     |     Filter Operator [FIL_18]
                      |        predicate:(key < 6) (type: boolean)
                      |        Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
@@ -1023,7 +1017,7 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
+                           Filter Operator [FIL_17]
                               predicate:(key < 6) (type: boolean)
                               Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
@@ -1079,24 +1073,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_21]
+         File Output Operator [FS_18]
             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"}
-            Group By Operator [OP_34]
+            Group By Operator [OP_31]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_18]
+               Reduce Output Operator [RS_15]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_17]
+                  Group By Operator [GBY_14]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_31]
+                     Merge Join Operator [MERGEJOIN_28]
                      |  condition map:[{"":"Inner Join 0 to 1"},{"":"Inner Join 0 to 2"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)","2":"_col0 (type: int)"}
                      |  Statistics:Num rows: 6 Data size: 613 Basic stats: COMPLETE Column stats: NONE
@@ -1104,7 +1098,7 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_29]
+                     |     Filter Operator [FIL_26]
                      |        predicate:(key < 6) (type: boolean)
                      |        Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
@@ -1114,7 +1108,7 @@ Stage-0
                      |<-Select Operator [SEL_8]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_30]
+                     |     Filter Operator [FIL_27]
                      |        predicate:(key < 6) (type: boolean)
                      |        Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_6]
@@ -1123,7 +1117,7 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_28]
+                           Filter Operator [FIL_25]
                               predicate:(key < 6) (type: boolean)
                               Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
@@ -1195,24 +1189,24 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2 vectorized
-         File Output Operator [FS_16]
+         File Output Operator [FS_14]
             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"}
-            Group By Operator [OP_23]
+            Group By Operator [OP_21]
             |  aggregations:["count(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_13]
+               Reduce Output Operator [RS_11]
                   sort order:
                   Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
                   value expressions:_col0 (type: bigint)
-                  Group By Operator [GBY_12]
+                  Group By Operator [GBY_10]
                      aggregations:["count()"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_21]
+                     Merge Join Operator [MERGEJOIN_19]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
                      |  Statistics:Num rows: 1 Data size: 102 Basic stats: COMPLETE Column stats: NONE
@@ -1220,8 +1214,8 @@ Stage-0
                      |<-Select Operator [SEL_5]
                      |     outputColumnNames:["_col0"]
                      |     Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                     |     Filter Operator [FIL_20]
-                     |        predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                     |     Filter Operator [FIL_18]
+                     |        predicate:((key < 8) and (key < 6)) (type: boolean)
                      |        Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                      |        TableScan [TS_3]
                      |           alias:b
@@ -1229,8 +1223,8 @@ Stage-0
                      |<-Select Operator [SEL_2]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
-                           Filter Operator [FIL_19]
-                              predicate:(((key < 8) and (key < 6)) and key is not null) (type: boolean)
+                           Filter Operator [FIL_17]
+                              predicate:((key < 8) and (key < 6)) (type: boolean)
                               Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
                               TableScan [TS_0]
                                  alias:a

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_between_columns.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_between_columns.q.out b/ql/src/test/results/clientpositive/tez/vector_between_columns.q.out
index 972d694..7fe20a6 100644
--- a/ql/src/test/results/clientpositive/tez/vector_between_columns.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_between_columns.q.out
@@ -60,7 +60,7 @@ POSTHOOK: Input: default@tint_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@TINT
 tint_txt.rnum	tint_txt.cint
-Warning: Map Join MAPJOIN[13][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: -- We DO NOT expect the following to vectorized because the BETWEEN range expressions
 -- are not constants.  We currently do not support the range expressions being columns.
 explain
@@ -137,7 +137,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[13][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: select tint.rnum, tsint.rnum from tint , tsint where tint.cint between tsint.csint and tsint.csint
 PREHOOK: type: QUERY
 PREHOOK: Input: default@tint

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_binary_join_groupby.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_binary_join_groupby.q.out b/ql/src/test/results/clientpositive/tez/vector_binary_join_groupby.q.out
index 2392fa2..c13ac6c 100644
--- a/ql/src/test/results/clientpositive/tez/vector_binary_join_groupby.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_binary_join_groupby.q.out
@@ -193,7 +193,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(*))
 FROM hundredorc t1 JOIN hundredorc t2 ON t2.bin = t2.bin
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_char_mapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_char_mapjoin1.q.out b/ql/src/test/results/clientpositive/tez/vector_char_mapjoin1.q.out
index 6e266af..6a74408 100644
--- a/ql/src/test/results/clientpositive/tez/vector_char_mapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_char_mapjoin1.q.out
@@ -257,7 +257,7 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col1 (type: char(20))
                         Statistics: Num rows: 3 Data size: 294 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: int), _col1 (type: char(10))
+                        value expressions: _col0 (type: int)
             Execution mode: vectorized
         Map 2 
             Map Operator Tree:
@@ -352,7 +352,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 3 Data size: 294 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (c2 is not null and UDFToString(c2) is not null) (type: boolean)
+                    predicate: c2 is not null (type: boolean)
                     Statistics: Num rows: 3 Data size: 294 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: c1 (type: int), c2 (type: char(10))

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_decimal_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_decimal_mapjoin.q.out b/ql/src/test/results/clientpositive/tez/vector_decimal_mapjoin.q.out
index ec8d0b0..0c76602 100644
--- a/ql/src/test/results/clientpositive/tez/vector_decimal_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_decimal_mapjoin.q.out
@@ -137,7 +137,6 @@ STAGE PLANS:
                         sort order: +
                         Map-reduce partition columns: _col0 (type: decimal(6,2))
                         Statistics: Num rows: 1049 Data size: 117488 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: decimal(4,0))
             Execution mode: vectorized
 
   Stage: Stage-0

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_interval_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_interval_mapjoin.q.out b/ql/src/test/results/clientpositive/tez/vector_interval_mapjoin.q.out
index cc9103d..42ce499 100644
--- a/ql/src/test/results/clientpositive/tez/vector_interval_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_interval_mapjoin.q.out
@@ -177,31 +177,28 @@ STAGE PLANS:
                       expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col1 is not null (type: boolean)
-                        Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
-                        Map Join Operator
-                          condition map:
-                               Inner Join 0 to 1
-                          keys:
-                            0 _col1 (type: interval_day_time), _col0 (type: string)
-                            1 _col1 (type: interval_day_time), _col0 (type: string)
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col1 (type: interval_day_time), _col0 (type: string)
+                          1 _col1 (type: interval_day_time), _col0 (type: string)
+                        outputColumnNames: _col0, _col1, _col2
+                        input vertices:
+                          1 Map 2
+                        Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
+                        HybridGraceHashJoin: true
+                        Select Operator
+                          expressions: _col0 (type: string), _col2 (type: string), _col1 (type: interval_day_time)
                           outputColumnNames: _col0, _col1, _col2
-                          input vertices:
-                            1 Map 2
                           Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
-                          HybridGraceHashJoin: true
-                          Select Operator
-                            expressions: _col0 (type: string), _col2 (type: string), _col1 (type: interval_day_time)
-                            outputColumnNames: _col0, _col1, _col2
+                          File Output Operator
+                            compressed: false
                             Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
-                            File Output Operator
-                              compressed: false
-                              Statistics: Num rows: 1100 Data size: 506290 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
+                            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
             Execution mode: vectorized
         Map 2 
             Map Operator Tree:
@@ -215,14 +212,11 @@ STAGE PLANS:
                       expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col1 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col1 (type: interval_day_time), _col0 (type: string)
+                        sort order: ++
+                        Map-reduce partition columns: _col1 (type: interval_day_time), _col0 (type: string)
                         Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col1 (type: interval_day_time), _col0 (type: string)
-                          sort order: ++
-                          Map-reduce partition columns: _col1 (type: interval_day_time), _col0 (type: string)
-                          Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
             Execution mode: vectorized
 
   Stage: Stage-0

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_join_filters.q.out b/ql/src/test/results/clientpositive/tez/vector_join_filters.q.out
index fb73843..cc8122a 100644
--- a/ql/src/test/results/clientpositive/tez/vector_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_join_filters.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@myinput1_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value))  FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_join_nulls.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_join_nulls.q.out b/ql/src/test/results/clientpositive/tez/vector_join_nulls.q.out
index 2d84f42..3c9ce0a 100644
--- a/ql/src/test/results/clientpositive/tez/vector_join_nulls.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_join_nulls.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@myinput1_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Map 1' is a cross product
+Warning: Map Join MAPJOIN[15][bigTable=?] in task 'Map 1' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_join_part_col_char.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_join_part_col_char.q.out b/ql/src/test/results/clientpositive/tez/vector_join_part_col_char.q.out
index 0b087be..c7ce2b7 100644
--- a/ql/src/test/results/clientpositive/tez/vector_join_part_col_char.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_join_part_col_char.q.out
@@ -111,46 +111,46 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_12]
+         File Output Operator [FS_10]
             compressed:false
             Statistics:Num rows: 2 Data size: 224 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"}
-            Merge Join Operator [MERGEJOIN_23]
+            Merge Join Operator [MERGEJOIN_21]
             |  condition map:[{"":"Inner Join 0 to 1"}]
             |  keys:{"0":"_col2 (type: char(50))","1":"_col2 (type: char(50))"}
             |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
             |  Statistics:Num rows: 2 Data size: 224 Basic stats: COMPLETE Column stats: NONE
             |<-Map 1 [SIMPLE_EDGE] vectorized
-            |  Reduce Output Operator [RS_25]
+            |  Reduce Output Operator [RS_23]
             |     key expressions:_col2 (type: char(50))
             |     Map-reduce partition columns:_col2 (type: char(50))
             |     sort order:+
             |     Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
             |     value expressions:_col0 (type: string), _col1 (type: int)
-            |     Select Operator [OP_24]
+            |     Select Operator [OP_22]
             |        outputColumnNames:["_col0","_col1","_col2"]
             |        Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
             |        TableScan [TS_0]
             |           alias:c1
             |           Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
-            |  Dynamic Partitioning Event Operator [EVENT_22]
+            |  Dynamic Partitioning Event Operator [EVENT_20]
             |     Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
-            |     Group By Operator [OP_27]
+            |     Group By Operator [OP_25]
             |        keys:_col0 (type: char(50))
             |        outputColumnNames:["_col0"]
             |        Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
-            |        Select Operator [OP_26]
+            |        Select Operator [OP_24]
             |           outputColumnNames:["_col0"]
             |           Statistics:Num rows: 2 Data size: 204 Basic stats: COMPLETE Column stats: NONE
-            |            Please refer to the previous Select Operator [OP_24]
+            |            Please refer to the previous Select Operator [OP_22]
             |<-Map 3 [SIMPLE_EDGE] vectorized
-               Reduce Output Operator [RS_29]
+               Reduce Output Operator [RS_27]
                   key expressions:_col2 (type: char(50))
                   Map-reduce partition columns:_col2 (type: char(50))
                   sort order:+
                   Statistics:Num rows: 2 Data size: 203 Basic stats: COMPLETE Column stats: NONE
-                  value expressions:_col0 (type: string), _col1 (type: int), _col2 (type: char(5))
-                  Select Operator [OP_28]
+                  value expressions:_col0 (type: string), _col1 (type: int)
+                  Select Operator [OP_26]
                      outputColumnNames:["_col0","_col1","_col2"]
                      Statistics:Num rows: 2 Data size: 203 Basic stats: COMPLETE Column stats: NONE
                      TableScan [TS_3]


[10/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
index b597ebd..9043fb1 100644
--- a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
+++ b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
@@ -932,14 +932,14 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: int), _col1 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col5
+                  expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
+                  outputColumnNames: _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
                     predicate: (CASE (_col5) WHEN (0) THEN (0) ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
-                      expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
+                      expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
                       outputColumnNames: _col1, _col2, _col3, _col4, _col5
                       Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                       Reduce Output Operator
@@ -1015,14 +1015,14 @@ STAGE PLANS:
                 outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
-                  expressions: _col0 (type: int), _col1 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col5
+                  expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
+                  outputColumnNames: _col1, _col2, _col3, _col4, _col5
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Filter Operator
                     predicate: (CASE (_col5) WHEN (0) THEN (0) ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                     Select Operator
-                      expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
+                      expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
                       outputColumnNames: _col1, _col2, _col3, _col4, _col5
                       Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                       Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/groupby_position.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/groupby_position.q.out b/ql/src/test/results/clientpositive/spark/groupby_position.q.out
index 81e4a1d..415703f 100644
--- a/ql/src/test/results/clientpositive/spark/groupby_position.q.out
+++ b/ql/src/test/results/clientpositive/spark/groupby_position.q.out
@@ -564,7 +564,7 @@ STAGE PLANS:
                   alias: src1
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string), substr(value, 5) (type: string)
@@ -586,7 +586,7 @@ STAGE PLANS:
                   alias: src1
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Group By Operator
                       keys: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/infer_bucket_sort_map_operators.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/infer_bucket_sort_map_operators.q.out b/ql/src/test/results/clientpositive/spark/infer_bucket_sort_map_operators.q.out
index fe124c6..57a6d59 100644
--- a/ql/src/test/results/clientpositive/spark/infer_bucket_sort_map_operators.q.out
+++ b/ql/src/test/results/clientpositive/spark/infer_bucket_sort_map_operators.q.out
@@ -209,7 +209,7 @@ STAGE PLANS:
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                       Filter Operator
-                        predicate: (_col1 is not null and UDFToDouble(_col1) is not null) (type: boolean)
+                        predicate: _col1 is not null (type: boolean)
                         Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
                           key expressions: UDFToDouble(_col1) (type: double)
@@ -223,7 +223,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (value is not null and UDFToDouble(value) is not null) (type: boolean)
+                    predicate: value is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join12.q.out b/ql/src/test/results/clientpositive/spark/join12.q.out
index cca05a9..2ad0a43 100644
--- a/ql/src/test/results/clientpositive/spark/join12.q.out
+++ b/ql/src/test/results/clientpositive/spark/join12.q.out
@@ -41,7 +41,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -58,7 +58,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join13.q.out b/ql/src/test/results/clientpositive/spark/join13.q.out
index 6ed8ca0..5b38f8c 100644
--- a/ql/src/test/results/clientpositive/spark/join13.q.out
+++ b/ql/src/test/results/clientpositive/spark/join13.q.out
@@ -77,7 +77,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((UDFToDouble(key) < 200.0) and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: (UDFToDouble(key) < 200.0) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -98,15 +98,12 @@ STAGE PLANS:
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: (UDFToDouble(_col2) + UDFToDouble(_col0)) is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
+                  sort order: +
+                  Map-reduce partition columns: (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
                   Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
-                    sort order: +
-                    Map-reduce partition columns: (UDFToDouble(_col2) + UDFToDouble(_col0)) (type: double)
-                    Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string), _col2 (type: string)
+                  value expressions: _col1 (type: string), _col2 (type: string)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join16.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join16.q.out b/ql/src/test/results/clientpositive/spark/join16.q.out
index 2c40151..2496ec2 100644
--- a/ql/src/test/results/clientpositive/spark/join16.q.out
+++ b/ql/src/test/results/clientpositive/spark/join16.q.out
@@ -19,7 +19,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) and key is not null) and value is not null) (type: boolean)
+                    predicate: (((UDFToDouble(key) > 10.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(value) < 200.0)) (type: boolean)
                     Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -36,7 +36,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) and value is not null) (type: boolean)
+                    predicate: (((UDFToDouble(value) < 200.0) and (UDFToDouble(key) > 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
                     Statistics: Num rows: 18 Data size: 191 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join2.q.out b/ql/src/test/results/clientpositive/spark/join2.q.out
index 9ee6df0..2c6311b 100644
--- a/ql/src/test/results/clientpositive/spark/join2.q.out
+++ b/ql/src/test/results/clientpositive/spark/join2.q.out
@@ -71,7 +71,7 @@ STAGE PLANS:
                   alias: src1
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -93,15 +93,12 @@ STAGE PLANS:
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: (UDFToDouble(_col0) + UDFToDouble(_col1)) is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
+                  sort order: +
+                  Map-reduce partition columns: (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                    sort order: +
-                    Map-reduce partition columns: (UDFToDouble(_col0) + UDFToDouble(_col1)) (type: double)
-                    Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col0 (type: string)
+                  value expressions: _col0 (type: string)
         Reducer 3 
             Reduce Operator Tree:
               Join Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join_cond_pushdown_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join_cond_pushdown_1.q.out b/ql/src/test/results/clientpositive/spark/join_cond_pushdown_1.q.out
index e22cab5..b75d951 100644
--- a/ql/src/test/results/clientpositive/spark/join_cond_pushdown_1.q.out
+++ b/ql/src/test/results/clientpositive/spark/join_cond_pushdown_1.q.out
@@ -301,7 +301,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part p2 join part p3 on p2.p_partkey = 1 and p3.p_name = p2.p_name
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join_cond_pushdown_3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join_cond_pushdown_3.q.out b/ql/src/test/results/clientpositive/spark/join_cond_pushdown_3.q.out
index ae8cf04..e2886d3 100644
--- a/ql/src/test/results/clientpositive/spark/join_cond_pushdown_3.q.out
+++ b/ql/src/test/results/clientpositive/spark/join_cond_pushdown_3.q.out
@@ -307,7 +307,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain select *
 from part p1 join part p2 join part p3 
 where p2.p_partkey = 1 and p3.p_name = p2.p_name

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/join_reorder.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/join_reorder.q.out b/ql/src/test/results/clientpositive/spark/join_reorder.q.out
index 10cd56c..4933df4 100644
--- a/ql/src/test/results/clientpositive/spark/join_reorder.q.out
+++ b/ql/src/test/results/clientpositive/spark/join_reorder.q.out
@@ -73,7 +73,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), val (type: string)
@@ -91,16 +91,16 @@ STAGE PLANS:
                   alias: c
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and (UDFToDouble(key) + 1.0) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) + 1.0) (type: double)
+                        key expressions: (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
                         sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) + 1.0) (type: double)
+                        Map-reduce partition columns: (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col0 (type: string)
         Reducer 2 
@@ -110,7 +110,7 @@ STAGE PLANS:
                      Inner Join 0 to 1
                 keys:
                   0 UDFToDouble(_col0) (type: double)
-                  1 (UDFToDouble(_col0) + 1.0) (type: double)
+                  1 (UDFToDouble(_col0) + UDFToDouble(1)) (type: double)
                 outputColumnNames: _col0, _col1, _col2
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                 File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/louter_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/louter_join_ppr.q.out b/ql/src/test/results/clientpositive/spark/louter_join_ppr.q.out
index 767855b..c22158c 100644
--- a/ql/src/test/results/clientpositive/spark/louter_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/spark/louter_join_ppr.q.out
@@ -1002,7 +1002,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -1073,7 +1073,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
                     Statistics: Num rows: 12 Data size: 127 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/mapjoin_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/mapjoin_mapjoin.q.out b/ql/src/test/results/clientpositive/spark/mapjoin_mapjoin.q.out
index 3a126f6..26c8958 100644
--- a/ql/src/test/results/clientpositive/spark/mapjoin_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/spark/mapjoin_mapjoin.q.out
@@ -532,7 +532,7 @@ STAGE PLANS:
                   alias: srcpart
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((value > 'val_450') and key is not null) and value is not null) (type: boolean)
+                    predicate: ((value > 'val_450') and key is not null) (type: boolean)
                     Statistics: Num rows: 666 Data size: 7075 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/outer_join_ppr.q.java1.7.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/outer_join_ppr.q.java1.7.out b/ql/src/test/results/clientpositive/spark/outer_join_ppr.q.java1.7.out
index a3c4be7..7ac6bf8 100644
--- a/ql/src/test/results/clientpositive/spark/outer_join_ppr.q.java1.7.out
+++ b/ql/src/test/results/clientpositive/spark/outer_join_ppr.q.java1.7.out
@@ -412,7 +412,7 @@ STAGE PLANS:
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Filter Operator
                   isSamplingPred: false
-                  predicate: ((((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0)) and (UDFToDouble(_col2) > 15.0)) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
+                  predicate: ((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0) and (UDFToDouble(_col2) > 15.0) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
                   Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
                   File Output Operator
                     compressed: false

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_gby_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_gby_join.q.out b/ql/src/test/results/clientpositive/spark/ppd_gby_join.q.out
index 08275f3..bd3dc4d 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_gby_join.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_gby_join.q.out
@@ -40,40 +40,34 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -314,7 +308,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -331,7 +325,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_join.q.out b/ql/src/test/results/clientpositive/spark/ppd_join.q.out
index 2357adc..fb1d563 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_join.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_join.q.out
@@ -37,41 +37,35 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -576,7 +570,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -593,7 +587,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_join2.q.out b/ql/src/test/results/clientpositive/spark/ppd_join2.q.out
index 68cbc5a..5848609 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_join2.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_join2.q.out
@@ -50,56 +50,47 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) and key is not null) (type: boolean)
+                    predicate: (((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Map 5 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -138,15 +129,12 @@ STAGE PLANS:
                     expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string)
                     outputColumnNames: _col0, _col1, _col3
                     Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                    Filter Operator
-                      predicate: _col1 is not null (type: boolean)
+                    Reduce Output Operator
+                      key expressions: _col1 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col1 (type: string)
                       Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
-                        Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: string), _col3 (type: string)
+                      value expressions: _col0 (type: string), _col3 (type: string)
 
   Stage: Stage-0
     Fetch Operator
@@ -1757,7 +1745,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) and key is not null) (type: boolean)
+                    predicate: (((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -1775,7 +1763,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_join3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_join3.q.out b/ql/src/test/results/clientpositive/spark/ppd_join3.q.out
index 573b352..c78d4cb 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_join3.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_join3.q.out
@@ -44,61 +44,52 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) and key is not null) (type: boolean)
+                    predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
         Map 5 
             Map Operator Tree:
                 TableScan
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -137,15 +128,12 @@ STAGE PLANS:
                     expressions: _col0 (type: string), _col2 (type: string)
                     outputColumnNames: _col0, _col2
                     Statistics: Num rows: 60 Data size: 642 Basic stats: COMPLETE Column stats: NONE
-                    Filter Operator
-                      predicate: _col0 is not null (type: boolean)
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 60 Data size: 642 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: string)
-                        Statistics: Num rows: 60 Data size: 642 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col2 (type: string)
+                      value expressions: _col2 (type: string)
 
   Stage: Stage-0
     Fetch Operator
@@ -1796,7 +1784,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) and key is not null) (type: boolean)
+                    predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -1813,7 +1801,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) and key is not null) (type: boolean)
+                    predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -1830,7 +1818,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) and key is not null) (type: boolean)
+                    predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_join5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_join5.q.out b/ql/src/test/results/clientpositive/spark/ppd_join5.q.out
index 377d8ac..8b51969 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_join5.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_join5.q.out
@@ -32,7 +32,7 @@ POSTHOOK: Lineage: t1.id1 SIMPLE []
 POSTHOOK: Lineage: t1.id2 SIMPLE []
 POSTHOOK: Lineage: t2.d SIMPLE []
 POSTHOOK: Lineage: t2.id SIMPLE []
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain
 select a.*,b.d d1,c.d d2 from
   t1 a join t2 b on (a.id1 = b.id)
@@ -148,7 +148,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: explain
 select * from (
 select a.*,b.d d1,c.d d2 from
@@ -271,7 +271,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Work 'Reducer 3' is a cross product
 PREHOOK: query: select * from (
 select a.*,b.d d1,c.d d2 from
   t1 a join t2 b on (a.id1 = b.id)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_join_filter.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_join_filter.q.out b/ql/src/test/results/clientpositive/spark/ppd_join_filter.q.out
index b1a3e49..fd2d590 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_join_filter.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_join_filter.q.out
@@ -145,17 +145,13 @@ STAGE PLANS:
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        isSamplingPred: false
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                          tag: 0
-                          auto parallelism: false
+                        tag: 0
+                        auto parallelism: false
             Path -> Alias:
 #### A masked pattern was here ####
             Path -> Partition:
@@ -332,18 +328,14 @@ STAGE PLANS:
                     expressions: _col0 (type: string), (UDFToDouble(_col1) + 2.0) (type: double), (UDFToDouble(_col1) + 3.0) (type: double)
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                    Filter Operator
-                      isSamplingPred: false
-                      predicate: _col0 is not null (type: boolean)
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: string)
-                        Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                        tag: 1
-                        value expressions: _col1 (type: double), _col2 (type: double)
-                        auto parallelism: false
+                      tag: 1
+                      value expressions: _col1 (type: double), _col2 (type: double)
+                      auto parallelism: false
 
   Stage: Stage-0
     Fetch Operator
@@ -911,17 +903,13 @@ STAGE PLANS:
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        isSamplingPred: false
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                          tag: 0
-                          auto parallelism: false
+                        tag: 0
+                        auto parallelism: false
             Path -> Alias:
 #### A masked pattern was here ####
             Path -> Partition:
@@ -1098,18 +1086,14 @@ STAGE PLANS:
                     expressions: _col0 (type: string), (UDFToDouble(_col1) + 2.0) (type: double), (UDFToDouble(_col1) + 3.0) (type: double)
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                    Filter Operator
-                      isSamplingPred: false
-                      predicate: _col0 is not null (type: boolean)
+                    Reduce Output Operator
+                      key expressions: _col0 (type: string)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: string)
                       Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: string)
-                        Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                        tag: 1
-                        value expressions: _col1 (type: double), _col2 (type: double)
-                        auto parallelism: false
+                      tag: 1
+                      value expressions: _col1 (type: double), _col2 (type: double)
+                      auto parallelism: false
 
   Stage: Stage-0
     Fetch Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_outer_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_outer_join2.q.out b/ql/src/test/results/clientpositive/spark/ppd_outer_join2.q.out
index ea95e18..8695961 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_outer_join2.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_outer_join2.q.out
@@ -37,42 +37,36 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+                    predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -278,7 +272,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+                    predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -296,7 +290,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_outer_join3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_outer_join3.q.out b/ql/src/test/results/clientpositive/spark/ppd_outer_join3.q.out
index c54029b..4a8c58c 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_outer_join3.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_outer_join3.q.out
@@ -37,42 +37,36 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+                    predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -278,7 +272,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+                    predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -296,7 +290,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/ppd_outer_join4.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/ppd_outer_join4.q.out b/ql/src/test/results/clientpositive/spark/ppd_outer_join4.q.out
index 9ac30c7..8d08308 100644
--- a/ql/src/test/results/clientpositive/spark/ppd_outer_join4.q.out
+++ b/ql/src/test/results/clientpositive/spark/ppd_outer_join4.q.out
@@ -43,62 +43,53 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) and key is not null) (type: boolean)
+                    predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
                       outputColumnNames: _col0
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) and key is not null) (type: boolean)
+                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                      Filter Operator
-                        predicate: _col0 is not null (type: boolean)
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
                         Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: string)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: string)
-                          Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                          value expressions: _col1 (type: string)
+                        value expressions: _col1 (type: string)
         Reducer 2 
             Reduce Operator Tree:
               Join Operator
@@ -426,7 +417,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) and key is not null) (type: boolean)
+                    predicate: (((((sqrt(key) <> 13.0) and (key < '25')) and (key > '15')) and (key < '20')) and (key > '10')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -443,7 +434,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) and key is not null) (type: boolean)
+                    predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and (sqrt(key) <> 13.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -461,7 +452,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+                    predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/router_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/router_join_ppr.q.out b/ql/src/test/results/clientpositive/spark/router_join_ppr.q.out
index 0734d71..620e5d2 100644
--- a/ql/src/test/results/clientpositive/spark/router_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/spark/router_join_ppr.q.out
@@ -1388,7 +1388,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
                     Statistics: Num rows: 12 Data size: 127 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -1508,7 +1508,7 @@ STAGE PLANS:
                   GatherStats: false
                   Filter Operator
                     isSamplingPred: false
-                    predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
                     Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/skewjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/skewjoin.q.out b/ql/src/test/results/clientpositive/spark/skewjoin.q.out
index ec5d4cd..b246046 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoin.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoin.q.out
@@ -823,7 +823,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((value is not null and key is not null) and UDFToDouble(substring(value, 5)) is not null) (type: boolean)
+                    predicate: (value is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
@@ -840,16 +840,16 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: ((value is not null and key is not null) and (UDFToDouble(substring(value, 5)) + 1.0) is not null) (type: boolean)
+                    predicate: (value is not null and key is not null) (type: boolean)
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                        key expressions: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                         sort order: ++
-                        Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                        Map-reduce partition columns: _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                         value expressions: _col1 (type: string)
         Reducer 2 
@@ -860,7 +860,7 @@ STAGE PLANS:
                 handleSkewJoin: true
                 keys:
                   0 _col0 (type: string), UDFToDouble(substring(_col1, 5)) (type: double)
-                  1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + 1.0) (type: double)
+                  1 _col0 (type: string), (UDFToDouble(substring(_col1, 5)) + UDFToDouble(1)) (type: double)
                 outputColumnNames: _col2, _col3
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                 Select Operator
@@ -1026,7 +1026,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 100.0) and (UDFToDouble(key) < 80.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)
@@ -1043,7 +1043,7 @@ STAGE PLANS:
                   alias: src
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) and key is not null) (type: boolean)
+                    predicate: ((UDFToDouble(key) < 80.0) and (UDFToDouble(key) < 100.0)) (type: boolean)
                     Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/spark/skewjoinopt18.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/skewjoinopt18.q.out b/ql/src/test/results/clientpositive/spark/skewjoinopt18.q.out
index 1994d2f..457fb05 100644
--- a/ql/src/test/results/clientpositive/spark/skewjoinopt18.q.out
+++ b/ql/src/test/results/clientpositive/spark/skewjoinopt18.q.out
@@ -91,7 +91,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: int), val (type: string)
@@ -109,7 +109,7 @@ STAGE PLANS:
                   alias: b
                   Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+                    predicate: key is not null (type: boolean)
                     Statistics: Num rows: 1 Data size: 30 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), val (type: string)


[04/15] hive git commit: HIVE-12644: Support for offset in HiveSortMergeRule (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
HIVE-12644: Support for offset in HiveSortMergeRule (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)


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

Branch: refs/heads/branch-2.0
Commit: ce5860fe4990179d66e39e0f4ff9d4a48ff48654
Parents: 6273bee
Author: Jesus Camacho Rodriguez <jc...@apache.org>
Authored: Mon Dec 21 02:13:30 2015 +0100
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon Dec 21 02:13:30 2015 +0100

----------------------------------------------------------------------
 .../calcite/rules/HiveSortJoinReduceRule.java   |   3 +-
 .../calcite/rules/HiveSortMergeRule.java        |  40 +-
 .../clientpositive/limit_join_transpose.q       | 104 +++
 .../clientpositive/limit_join_transpose.q.out   | 889 +++++++++++++++++++
 4 files changed, 1029 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ce5860fe/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
index 180c647..0af60e8 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortJoinReduceRule.java
@@ -94,7 +94,8 @@ public class HiveSortJoinReduceRule extends RelOptRule {
     }
 
     // Finally, if we do not reduce the input size, we bail out
-    if (RexLiteral.intValue(sortLimit.fetch)
+    final int offset = sortLimit.offset == null ? 0 : RexLiteral.intValue(sortLimit.offset);
+    if (offset + RexLiteral.intValue(sortLimit.fetch)
             >= RelMetadataQuery.getRowCount(reducedInput)) {
       return false;
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/ce5860fe/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortMergeRule.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortMergeRule.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortMergeRule.java
index efde665..506231f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortMergeRule.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSortMergeRule.java
@@ -17,8 +17,11 @@
  */
 package org.apache.hadoop.hive.ql.optimizer.calcite.rules;
 
+import java.math.BigDecimal;
+
 import org.apache.calcite.plan.RelOptRule;
 import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rex.RexBuilder;
 import org.apache.calcite.rex.RexLiteral;
 import org.apache.calcite.rex.RexNode;
 import org.apache.hadoop.hive.ql.optimizer.calcite.HiveCalciteUtil;
@@ -65,7 +68,7 @@ public class HiveSortMergeRule extends RelOptRule {
     // If the bottom operator is not synthetic and it does not contain a limit,
     // we will bail out; we do not want to end up with limits all over the tree
     if (topSortLimit.isRuleCreated() && !bottomSortLimit.isRuleCreated() &&
-            bottomSortLimit.fetch == null) {
+            !HiveCalciteUtil.limitRelNode(bottomSortLimit)) {
       return false;
     }
 
@@ -77,17 +80,42 @@ public class HiveSortMergeRule extends RelOptRule {
     final HiveSortLimit topSortLimit = call.rel(0);
     final HiveSortLimit bottomSortLimit = call.rel(1);
 
-    // Lowest limit
+    final RexNode newOffset;
     final RexNode newLimit;
-    if (bottomSortLimit.fetch != null && RexLiteral.intValue(topSortLimit.fetch)
-            >= RexLiteral.intValue(bottomSortLimit.fetch)) {
-      newLimit = bottomSortLimit.fetch;
+    if (HiveCalciteUtil.limitRelNode(bottomSortLimit)) {
+      final RexBuilder rexBuilder = topSortLimit.getCluster().getRexBuilder();
+      int topOffset = topSortLimit.offset == null ? 0 : RexLiteral.intValue(topSortLimit.offset);
+      int topLimit = RexLiteral.intValue(topSortLimit.fetch);
+      int bottomOffset = bottomSortLimit.offset == null ? 0 : RexLiteral.intValue(bottomSortLimit.offset);
+      int bottomLimit = RexLiteral.intValue(bottomSortLimit.fetch);
+      
+      // Three different cases
+      if (topOffset + topLimit <= bottomLimit) {
+      	// 1. Fully contained
+      	// topOffset + topLimit <= bottomLimit
+        newOffset = bottomOffset + topOffset == 0 ? null :
+          rexBuilder.makeExactLiteral(BigDecimal.valueOf(bottomOffset + topOffset));
+        newLimit = topSortLimit.fetch;
+      } else if (topOffset < bottomLimit) {
+        // 2. Partially contained
+        // topOffset + topLimit > bottomLimit && topOffset < bottomLimit
+        newOffset = bottomOffset + topOffset == 0 ? null :
+          rexBuilder.makeExactLiteral(BigDecimal.valueOf(bottomOffset + topOffset));
+        newLimit = rexBuilder.makeExactLiteral(BigDecimal.valueOf(bottomLimit - topOffset));
+      } else {
+        // 3. Outside
+        // we need to create a new limit 0
+        newOffset = null;
+        newLimit = rexBuilder.makeExactLiteral(BigDecimal.valueOf(0));
+      }
     } else {
+      // Bottom operator does not contain offset/fetch
+      newOffset = topSortLimit.offset;
       newLimit = topSortLimit.fetch;
     }
 
     final HiveSortLimit newSort = bottomSortLimit.copy(bottomSortLimit.getTraitSet(),
-            bottomSortLimit.getInput(), bottomSortLimit.collation, null, newLimit);
+            bottomSortLimit.getInput(), bottomSortLimit.collation, newOffset, newLimit);
 
     call.transformTo(newSort);
   }

http://git-wip-us.apache.org/repos/asf/hive/blob/ce5860fe/ql/src/test/queries/clientpositive/limit_join_transpose.q
----------------------------------------------------------------------
diff --git a/ql/src/test/queries/clientpositive/limit_join_transpose.q b/ql/src/test/queries/clientpositive/limit_join_transpose.q
index da34806..087839d 100644
--- a/ql/src/test/queries/clientpositive/limit_join_transpose.q
+++ b/ql/src/test/queries/clientpositive/limit_join_transpose.q
@@ -60,6 +60,7 @@ from src src1 right outer join (
 on src1.key = src2.key
 limit 1;
 
+
 set hive.optimize.limittranspose.reductionpercentage=1f;
 set hive.optimize.limittranspose.reductiontuples=0;
 
@@ -115,3 +116,106 @@ from src src1 right outer join (
   on src2.value = src3.value) src2
 on src1.key = src2.key
 limit 0;
+
+
+set hive.mapred.mode=nonstrict;
+set hive.optimize.limittranspose=false;
+
+explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+
+set hive.optimize.limittranspose=true;
+set hive.optimize.limittranspose.reductionpercentage=0.0001f;
+set hive.optimize.limittranspose.reductiontuples=10;
+
+explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+
+set hive.optimize.limittranspose.reductionpercentage=0.1f;
+set hive.optimize.limittranspose.reductiontuples=10;
+
+explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+
+set hive.optimize.limittranspose.reductionpercentage=1f;
+set hive.optimize.limittranspose.reductiontuples=0;
+
+explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1;
+
+explain
+select *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1;
+
+select *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1;

http://git-wip-us.apache.org/repos/asf/hive/blob/ce5860fe/ql/src/test/results/clientpositive/limit_join_transpose.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/limit_join_transpose.q.out b/ql/src/test/results/clientpositive/limit_join_transpose.q.out
index 058ddd4..759aebb 100644
--- a/ql/src/test/results/clientpositive/limit_join_transpose.q.out
+++ b/ql/src/test/results/clientpositive/limit_join_transpose.q.out
@@ -922,3 +922,892 @@ limit 0
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
+PREHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+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: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0	0	val_0
+PREHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+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: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0	0	val_0
+PREHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 1
+                Offset of rows: 1
+                Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.1
+                  value expressions: _col0 (type: string), _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col0 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col1 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 left outer join src src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1
+  Stage-3 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-3
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 1
+                Offset of rows: 1
+                Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.1
+                  value expressions: _col0 (type: string), _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col1 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col0 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col1 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col1 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col1 (type: string)
+            1 _col1 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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-3
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col2 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col2 (type: string)
+              Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col2 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+          Select Operator
+            expressions: _col4 (type: string), _col5 (type: string), _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+            Statistics: Num rows: 605 Data size: 6427 Basic stats: COMPLETE Column stats: NONE
+            Limit
+              Number of rows: 1
+              Offset of rows: 1
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              File Output Operator
+                compressed: false
+                Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-3 depends on stages: Stage-2
+  Stage-4 depends on stages: Stage-3
+  Stage-1 depends on stages: Stage-4
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Limit
+                Number of rows: 1
+                Offset of rows: 1
+                Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  sort order: 
+                  Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                  TopN Hash Memory Usage: 0.1
+                  value expressions: _col0 (type: string), _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-3
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col1 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col0 (type: string)
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col1 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col1 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col0 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          keys:
+            0 _col1 (type: string)
+            1 _col1 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-4
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              sort order: 
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 0.1
+              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: string), VALUE._col3 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col2 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col2 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col2 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 right outer join (
+  select *
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+PREHOOK: query: explain
+select *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-5 is a root stage
+  Stage-3 depends on stages: Stage-5
+  Stage-4 depends on stages: Stage-3
+  Stage-1 depends on stages: Stage-4
+  Stage-2 depends on stages: Stage-1
+  Stage-0 depends on stages: Stage-2
+
+STAGE PLANS:
+  Stage: Stage-5
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                TopN Hash Memory Usage: 0.1
+                value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-3
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: value (type: string)
+              outputColumnNames: _col0
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+          TableScan
+            Reduce Output Operator
+              key expressions: _col1 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col1 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col0 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col1 (type: string)
+          outputColumnNames: _col1, _col2
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Select Operator
+            expressions: _col1 (type: string), _col2 (type: string)
+            outputColumnNames: _col0, _col1
+            Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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-4
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 0.1
+              value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string)
+          outputColumnNames: _col0, _col1
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE 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-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src1
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Reduce Output Operator
+                key expressions: _col0 (type: string)
+                sort order: +
+                Map-reduce partition columns: _col0 (type: string)
+                Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+                value expressions: _col1 (type: string)
+          TableScan
+            Reduce Output Operator
+              key expressions: _col0 (type: string)
+              sort order: +
+              Map-reduce partition columns: _col0 (type: string)
+              Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+              value expressions: _col1 (type: string)
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Right Outer Join0 to 1
+          keys:
+            0 _col0 (type: string)
+            1 _col0 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE 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-2
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            Reduce Output Operator
+              key expressions: _col2 (type: string)
+              sort order: +
+              Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+              TopN Hash Memory Usage: 0.1
+              value expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string)
+      Reduce Operator Tree:
+        Select Operator
+          expressions: VALUE._col0 (type: string), VALUE._col1 (type: string), KEY.reducesinkkey0 (type: string), VALUE._col2 (type: string)
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
+          Limit
+            Number of rows: 1
+            Offset of rows: 1
+            Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              Statistics: Num rows: 1 Data size: 10 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 *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select *
+from src src1 right outer join (
+  select src2.key, src2.value
+  from src src2 left outer join src src3
+  on src2.value = src3.value) src2
+on src1.key = src2.key
+order by src2.key
+limit 1 offset 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0	0	val_0


[05/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vector_varchar_mapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vector_varchar_mapjoin1.q.out b/ql/src/test/results/clientpositive/tez/vector_varchar_mapjoin1.q.out
index 30600e5..64af51b 100644
--- a/ql/src/test/results/clientpositive/tez/vector_varchar_mapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/tez/vector_varchar_mapjoin1.q.out
@@ -340,7 +340,7 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 3 Data size: 273 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (c2 is not null and UDFToString(c2) is not null) (type: boolean)
+                    predicate: c2 is not null (type: boolean)
                     Statistics: Num rows: 3 Data size: 273 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: c1 (type: int), c2 (type: varchar(10))

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/vectorized_dynamic_partition_pruning.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/vectorized_dynamic_partition_pruning.q.out b/ql/src/test/results/clientpositive/tez/vectorized_dynamic_partition_pruning.q.out
index 4f6cb91..3cb52be 100644
--- a/ql/src/test/results/clientpositive/tez/vectorized_dynamic_partition_pruning.q.out
+++ b/ql/src/test/results/clientpositive/tez/vectorized_dynamic_partition_pruning.q.out
@@ -1303,28 +1303,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1430,20 +1427,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
@@ -1484,7 +1478,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1557,28 +1551,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1669,20 +1660,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and (UDFToDouble(hr) * 2.0) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
@@ -1708,7 +1696,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1794,28 +1782,25 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
+                      sort order: +
+                      Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        sort order: +
-                        Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1848,7 +1833,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
+                  0 UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                   1 UDFToString(_col0) (type: string)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -2066,7 +2051,7 @@ POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
 #### A masked pattern was here ####
 1000
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- non-equi join
 EXPLAIN select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
@@ -2162,7 +2147,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -4205,42 +4190,39 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 UDFToDouble(_col0) (type: double)
+                        1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -4328,34 +4310,31 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 (UDFToDouble(_col0) * 2.0) (type: double)
-                          1 _col0 (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                        1 _col0 (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
@@ -5386,42 +5365,38 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart_orc
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: ds (type: string), hr (type: int)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: ds (type: string), hr (type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col0 (type: string), UDFToDouble(_col1) (type: double)
-                          1 _col0 (type: string), UDFToDouble(_col2) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 _col0 (type: string), UDFToDouble(_col1) (type: double)
+                        1 _col0 (type: string), UDFToDouble(_col2) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_date_hour
-                  filterExpr: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                   Statistics: Num rows: 4 Data size: 1440 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                     Statistics: Num rows: 2 Data size: 720 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ds (type: string), hr (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_auto_smb_mapjoin_14.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_auto_smb_mapjoin_14.q.out b/ql/src/test/results/clientpositive/vector_auto_smb_mapjoin_14.q.out
index c5eedb5..abb2acc 100644
--- a/ql/src/test/results/clientpositive/vector_auto_smb_mapjoin_14.q.out
+++ b/ql/src/test/results/clientpositive/vector_auto_smb_mapjoin_14.q.out
@@ -586,7 +586,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -707,7 +707,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -912,14 +912,11 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: int)
-                    Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: a
             Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
@@ -930,14 +927,11 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: int)
-                    Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -1227,7 +1221,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 930 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_between_columns.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_between_columns.q.out b/ql/src/test/results/clientpositive/vector_between_columns.q.out
index 4837aba..397673c 100644
--- a/ql/src/test/results/clientpositive/vector_between_columns.q.out
+++ b/ql/src/test/results/clientpositive/vector_between_columns.q.out
@@ -60,7 +60,7 @@ POSTHOOK: Input: default@tint_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@TINT
 tint_txt.rnum	tint_txt.cint
-Warning: Map Join MAPJOIN[13][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: -- We DO NOT expect the following to vectorized because the BETWEEN range expressions
 -- are not constants.  We currently do not support the range expressions being columns.
 explain
@@ -139,7 +139,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[13][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: select tint.rnum, tsint.rnum from tint , tsint where tint.cint between tsint.csint and tsint.csint
 PREHOOK: type: QUERY
 PREHOOK: Input: default@tint

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out b/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
index 1febdbe..682e902 100644
--- a/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
+++ b/ql/src/test/results/clientpositive/vector_binary_join_groupby.q.out
@@ -190,7 +190,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[20][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[19][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(*))
 FROM hundredorc t1 JOIN hundredorc t2 ON t2.bin = t2.bin
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_char_mapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_char_mapjoin1.q.out b/ql/src/test/results/clientpositive/vector_char_mapjoin1.q.out
index 0b89bec..7ca3790 100644
--- a/ql/src/test/results/clientpositive/vector_char_mapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/vector_char_mapjoin1.q.out
@@ -362,7 +362,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 3 Data size: 294 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (c2 is not null and UDFToString(c2) is not null) (type: boolean)
+              predicate: c2 is not null (type: boolean)
               Statistics: Num rows: 3 Data size: 294 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c2 (type: char(10))

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out b/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
index c410086..7cd7eb0 100644
--- a/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/vector_interval_mapjoin.q.out
@@ -178,13 +178,10 @@ STAGE PLANS:
                 expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col1 is not null (type: boolean)
-                  Statistics: Num rows: 1000 Data size: 458448 Basic stats: COMPLETE Column stats: NONE
-                  HashTable Sink Operator
-                    keys:
-                      0 _col1 (type: interval_day_time), _col0 (type: string)
-                      1 _col1 (type: interval_day_time), _col0 (type: string)
+                HashTable Sink Operator
+                  keys:
+                    0 _col1 (type: interval_day_time), _col0 (type: string)
+                    1 _col1 (type: interval_day_time), _col0 (type: string)
 
   Stage: Stage-3
     Map Reduce
@@ -199,28 +196,25 @@ STAGE PLANS:
                 expressions: s (type: string), (dt - CAST( ts AS DATE)) (type: interval_day_time)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col1 is not null (type: boolean)
-                  Statistics: Num rows: 1000 Data size: 460264 Basic stats: COMPLETE Column stats: NONE
-                  Map Join Operator
-                    condition map:
-                         Inner Join 0 to 1
-                    keys:
-                      0 _col1 (type: interval_day_time), _col0 (type: string)
-                      1 _col1 (type: interval_day_time), _col0 (type: string)
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col1 (type: interval_day_time), _col0 (type: string)
+                    1 _col1 (type: interval_day_time), _col0 (type: string)
+                  outputColumnNames: _col0, _col1, _col2
+                  Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: _col0 (type: string), _col2 (type: string), _col1 (type: interval_day_time)
                     outputColumnNames: _col0, _col1, _col2
                     Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: _col0 (type: string), _col2 (type: string), _col1 (type: interval_day_time)
-                      outputColumnNames: _col0, _col1, _col2
+                    File Output Operator
+                      compressed: false
                       Statistics: Num rows: 1100 Data size: 506290 Basic stats: COMPLETE Column stats: NONE
-                      File Output Operator
-                        compressed: false
-                        Statistics: Num rows: 1100 Data size: 506290 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
+                      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
       Execution mode: vectorized
       Local Work:
         Map Reduce Local Work

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_join_filters.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_join_filters.q.out b/ql/src/test/results/clientpositive/vector_join_filters.q.out
index f33c7e0..61e5b2a 100644
--- a/ql/src/test/results/clientpositive/vector_join_filters.q.out
+++ b/ql/src/test/results/clientpositive/vector_join_filters.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@myinput1_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value))  FROM myinput1 a JOIN myinput1 b on a.key > 40 AND a.value > 50 AND a.key = a.value AND b.key > 40 AND b.value > 50 AND b.key = b.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_join_nulls.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_join_nulls.q.out b/ql/src/test/results/clientpositive/vector_join_nulls.q.out
index 1ff5a0c..7b59cc4 100644
--- a/ql/src/test/results/clientpositive/vector_join_nulls.q.out
+++ b/ql/src/test/results/clientpositive/vector_join_nulls.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@myinput1_txt
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@myinput1
-Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: SELECT sum(hash(a.key,a.value,b.key,b.value)) FROM myinput1 a JOIN myinput1 b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@myinput1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/vector_varchar_mapjoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/vector_varchar_mapjoin1.q.out b/ql/src/test/results/clientpositive/vector_varchar_mapjoin1.q.out
index 33dbf9e..e816367 100644
--- a/ql/src/test/results/clientpositive/vector_varchar_mapjoin1.q.out
+++ b/ql/src/test/results/clientpositive/vector_varchar_mapjoin1.q.out
@@ -350,7 +350,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 3 Data size: 273 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (c2 is not null and UDFToString(c2) is not null) (type: boolean)
+              predicate: c2 is not null (type: boolean)
               Statistics: Num rows: 3 Data size: 273 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c2 (type: varchar(10))


[08/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainuser_1.q.out b/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
index c081309..78c68c3 100644
--- a/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainuser_1.q.out
@@ -512,128 +512,128 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 7
-         File Output Operator [FS_50]
+         File Output Operator [FS_42]
             compressed:false
             Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_49]
+            Select Operator [SEL_41]
             |  outputColumnNames:["_col0","_col1","_col2"]
             |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             |<-Reducer 6 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_48]
+               Reduce Output Operator [RS_40]
                   key expressions:(UDFToLong(_col0) + _col1) (type: bigint), _col1 (type: bigint)
                   sort order:-+
                   Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                   value expressions:_col0 (type: int), _col2 (type: bigint)
-                  Select Operator [SEL_46]
+                  Select Operator [SEL_38]
                      outputColumnNames:["_col0","_col1","_col2"]
                      Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                     Group By Operator [GBY_45]
+                     Group By Operator [GBY_37]
                      |  aggregations:["count(VALUE._col0)"]
                      |  keys:KEY._col0 (type: bigint), KEY._col1 (type: int)
                      |  outputColumnNames:["_col0","_col1","_col2"]
                      |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                      |<-Reducer 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_44]
+                        Reduce Output Operator [RS_36]
                            key expressions:_col0 (type: bigint), _col1 (type: int)
                            Map-reduce partition columns:_col0 (type: bigint), _col1 (type: int)
                            sort order:++
                            Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                            value expressions:_col2 (type: bigint)
-                           Group By Operator [GBY_43]
+                           Group By Operator [GBY_35]
                               aggregations:["count()"]
                               keys:_col2 (type: bigint), _col6 (type: int)
                               outputColumnNames:["_col0","_col1","_col2"]
                               Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                              Select Operator [SEL_42]
+                              Select Operator [SEL_34]
                                  outputColumnNames:["_col2","_col6"]
                                  Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                                 Filter Operator [FIL_56]
+                                 Filter Operator [FIL_33]
                                     predicate:((_col1 > 0) or (_col6 >= 0)) (type: boolean)
                                     Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                                    Merge Join Operator [MERGEJOIN_62]
+                                    Merge Join Operator [MERGEJOIN_52]
                                     |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                     |  outputColumnNames:["_col1","_col2","_col6"]
                                     |  Statistics:Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                                     |<-Map 11 [SIMPLE_EDGE]
-                                    |  Reduce Output Operator [RS_39]
+                                    |  Reduce Output Operator [RS_31]
                                     |     key expressions:_col0 (type: string)
                                     |     Map-reduce partition columns:_col0 (type: string)
                                     |     sort order:+
                                     |     Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                                     |     value expressions:_col1 (type: int)
-                                    |     Select Operator [SEL_35]
+                                    |     Select Operator [SEL_29]
                                     |        outputColumnNames:["_col0","_col1"]
                                     |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |        Filter Operator [FIL_60]
+                                    |        Filter Operator [FIL_50]
                                     |           predicate:key is not null (type: boolean)
                                     |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |           TableScan [TS_33]
+                                    |           TableScan [TS_27]
                                     |              alias:cbo_t3
                                     |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                                     |<-Reducer 4 [SIMPLE_EDGE]
-                                       Reduce Output Operator [RS_37]
+                                       Reduce Output Operator [RS_30]
                                           key expressions:_col0 (type: string)
                                           Map-reduce partition columns:_col0 (type: string)
                                           sort order:+
                                           Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                           value expressions:_col1 (type: int), _col2 (type: bigint)
-                                          Select Operator [SEL_32]
+                                          Select Operator [SEL_26]
                                              outputColumnNames:["_col0","_col1","_col2"]
                                              Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                             Filter Operator [FIL_57]
+                                             Filter Operator [FIL_25]
                                                 predicate:((_col1 + _col4) >= 0) (type: boolean)
                                                 Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                Merge Join Operator [MERGEJOIN_61]
+                                                Merge Join Operator [MERGEJOIN_51]
                                                 |  condition map:[{"":"Inner Join 0 to 1"}]
                                                 |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                                 |  outputColumnNames:["_col0","_col1","_col2","_col4"]
                                                 |  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |<-Reducer 10 [SIMPLE_EDGE]
-                                                |  Reduce Output Operator [RS_29]
+                                                |  Reduce Output Operator [RS_23]
                                                 |     key expressions:_col0 (type: string)
                                                 |     Map-reduce partition columns:_col0 (type: string)
                                                 |     sort order:+
                                                 |     Statistics:Num rows: 1 Data size: 89 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |     value expressions:_col1 (type: int)
-                                                |     Select Operator [SEL_22]
+                                                |     Select Operator [SEL_20]
                                                 |     |  outputColumnNames:["_col0","_col1"]
                                                 |     |  Statistics:Num rows: 1 Data size: 89 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |     |<-Reducer 9 [SIMPLE_EDGE]
-                                                |        Reduce Output Operator [RS_21]
+                                                |        Reduce Output Operator [RS_19]
                                                 |           key expressions:_col3 (type: double), _col2 (type: bigint)
                                                 |           sort order:-+
                                                 |           Statistics:Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |           value expressions:_col0 (type: string), _col1 (type: int)
-                                                |           Select Operator [SEL_19]
+                                                |           Select Operator [SEL_17]
                                                 |              outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                 |              Statistics:Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
-                                                |              Group By Operator [GBY_18]
+                                                |              Group By Operator [GBY_16]
                                                 |              |  aggregations:["sum(VALUE._col0)"]
                                                 |              |  keys:KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: float)
                                                 |              |  outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                 |              |  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |              |<-Map 8 [SIMPLE_EDGE]
-                                                |                 Reduce Output Operator [RS_17]
+                                                |                 Reduce Output Operator [RS_15]
                                                 |                    key expressions:_col0 (type: string), _col1 (type: int), _col2 (type: float)
                                                 |                    Map-reduce partition columns:_col0 (type: string), _col1 (type: int), _col2 (type: float)
                                                 |                    sort order:+++
                                                 |                    Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |                    value expressions:_col3 (type: bigint)
-                                                |                    Group By Operator [GBY_16]
+                                                |                    Group By Operator [GBY_14]
                                                 |                       aggregations:["sum(c_int)"]
                                                 |                       keys:key (type: string), c_int (type: int), c_float (type: float)
                                                 |                       outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                 |                       Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                |                       Filter Operator [FIL_59]
+                                                |                       Filter Operator [FIL_49]
                                                 |                          predicate:((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
                                                 |                          Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: COMPLETE
-                                                |                          TableScan [TS_13]
+                                                |                          TableScan [TS_11]
                                                 |                             alias:cbo_t2
                                                 |                             Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |<-Reducer 3 [SIMPLE_EDGE]
-                                                   Reduce Output Operator [RS_27]
+                                                   Reduce Output Operator [RS_22]
                                                       key expressions:_col0 (type: string)
                                                       Map-reduce partition columns:_col0 (type: string)
                                                       sort order:+
@@ -668,7 +668,7 @@ Stage-0
                                                                         keys:key (type: string), c_int (type: int), c_float (type: float)
                                                                         outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                                         Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                                        Filter Operator [FIL_58]
+                                                                        Filter Operator [FIL_48]
                                                                            predicate:((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
                                                                            Statistics:Num rows: 3 Data size: 279 Basic stats: COMPLETE Column stats: COMPLETE
                                                                            TableScan [TS_0]
@@ -695,86 +695,86 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 7
-         File Output Operator [FS_43]
+         File Output Operator [FS_39]
             compressed:false
             Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_42]
+            Select Operator [SEL_38]
             |  outputColumnNames:["_col0","_col1","_col2"]
             |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             |<-Reducer 6 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_41]
+               Reduce Output Operator [RS_37]
                   key expressions:(UDFToLong(_col0) % _col1) (type: bigint), _col0 (type: int)
                   sort order:+-
                   Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                   value expressions:_col1 (type: bigint), _col2 (type: bigint)
-                  Select Operator [SEL_39]
+                  Select Operator [SEL_35]
                      outputColumnNames:["_col0","_col1","_col2"]
                      Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                     Group By Operator [GBY_38]
+                     Group By Operator [GBY_34]
                      |  aggregations:["count(VALUE._col0)"]
                      |  keys:KEY._col0 (type: bigint), KEY._col1 (type: int)
                      |  outputColumnNames:["_col0","_col1","_col2"]
                      |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                      |<-Reducer 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_37]
+                        Reduce Output Operator [RS_33]
                            key expressions:_col0 (type: bigint), _col1 (type: int)
                            Map-reduce partition columns:_col0 (type: bigint), _col1 (type: int)
                            sort order:++
                            Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                            value expressions:_col2 (type: bigint)
-                           Group By Operator [GBY_36]
+                           Group By Operator [GBY_32]
                               aggregations:["count()"]
                               keys:_col2 (type: bigint), _col6 (type: int)
                               outputColumnNames:["_col0","_col1","_col2"]
                               Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                              Select Operator [SEL_35]
+                              Select Operator [SEL_31]
                                  outputColumnNames:["_col2","_col6"]
                                  Statistics:Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: COMPLETE
-                                 Filter Operator [FIL_48]
-                                    predicate:((((UDFToLong(_col6) + _col2) >= 0) and ((_col1 > 0) or (_col6 >= 0))) and ((_col6 >= 1) or (_col2 >= 1))) (type: boolean)
+                                 Filter Operator [FIL_30]
+                                    predicate:(((_col1 > 0) or (_col6 >= 0)) and ((_col6 >= 1) or (_col2 >= 1)) and ((UDFToLong(_col6) + _col2) >= 0)) (type: boolean)
                                     Statistics:Num rows: 1 Data size: 16 Basic stats: COMPLETE Column stats: COMPLETE
-                                    Merge Join Operator [MERGEJOIN_54]
+                                    Merge Join Operator [MERGEJOIN_48]
                                     |  condition map:[{"":"Inner Join 0 to 1"}]
                                     |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                     |  outputColumnNames:["_col1","_col2","_col6"]
                                     |  Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
                                     |<-Map 10 [SIMPLE_EDGE]
-                                    |  Reduce Output Operator [RS_32]
+                                    |  Reduce Output Operator [RS_28]
                                     |     key expressions:_col0 (type: string)
                                     |     Map-reduce partition columns:_col0 (type: string)
                                     |     sort order:+
                                     |     Statistics:Num rows: 5 Data size: 356 Basic stats: COMPLETE Column stats: COMPLETE
                                     |     value expressions:_col1 (type: int)
-                                    |     Select Operator [SEL_28]
+                                    |     Select Operator [SEL_26]
                                     |        outputColumnNames:["_col0","_col1"]
                                     |        Statistics:Num rows: 5 Data size: 356 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |        Filter Operator [FIL_52]
+                                    |        Filter Operator [FIL_46]
                                     |           predicate:((c_int > 0) and key is not null) (type: boolean)
                                     |           Statistics:Num rows: 5 Data size: 356 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |           TableScan [TS_26]
+                                    |           TableScan [TS_24]
                                     |              alias:cbo_t3
                                     |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                                     |<-Reducer 4 [SIMPLE_EDGE]
-                                       Reduce Output Operator [RS_30]
+                                       Reduce Output Operator [RS_27]
                                           key expressions:_col0 (type: string)
                                           Map-reduce partition columns:_col0 (type: string)
                                           sort order:+
                                           Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                           value expressions:_col1 (type: int), _col2 (type: bigint)
-                                          Select Operator [SEL_25]
+                                          Select Operator [SEL_23]
                                              outputColumnNames:["_col0","_col1","_col2"]
                                              Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                             Filter Operator [FIL_49]
+                                             Filter Operator [FIL_22]
                                                 predicate:((_col1 + _col4) >= 0) (type: boolean)
                                                 Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                Merge Join Operator [MERGEJOIN_53]
+                                                Merge Join Operator [MERGEJOIN_47]
                                                 |  condition map:[{"":"Left Outer Join0 to 1"}]
                                                 |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                                 |  outputColumnNames:["_col0","_col1","_col2","_col4"]
                                                 |  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |<-Reducer 3 [SIMPLE_EDGE]
-                                                |  Reduce Output Operator [RS_21]
+                                                |  Reduce Output Operator [RS_19]
                                                 |     key expressions:_col0 (type: string)
                                                 |     Map-reduce partition columns:_col0 (type: string)
                                                 |     sort order:+
@@ -809,40 +809,40 @@ Stage-0
                                                 |                       keys:key (type: string), c_int (type: int), c_float (type: float)
                                                 |                       outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                 |                       Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                |                       Filter Operator [FIL_50]
+                                                |                       Filter Operator [FIL_44]
                                                 |                          predicate:(((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) and key is not null) (type: boolean)
                                                 |                          Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |                          TableScan [TS_0]
                                                 |                             alias:cbo_t1
                                                 |                             Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                                                 |<-Reducer 9 [SIMPLE_EDGE]
-                                                   Reduce Output Operator [RS_22]
+                                                   Reduce Output Operator [RS_20]
                                                       key expressions:_col0 (type: string)
                                                       Map-reduce partition columns:_col0 (type: string)
                                                       sort order:+
                                                       Statistics:Num rows: 1 Data size: 89 Basic stats: COMPLETE Column stats: COMPLETE
                                                       value expressions:_col1 (type: int)
-                                                      Select Operator [SEL_19]
+                                                      Select Operator [SEL_17]
                                                          outputColumnNames:["_col0","_col1"]
                                                          Statistics:Num rows: 1 Data size: 89 Basic stats: COMPLETE Column stats: COMPLETE
-                                                         Group By Operator [GBY_18]
+                                                         Group By Operator [GBY_16]
                                                          |  keys:KEY._col0 (type: string), KEY._col1 (type: int), KEY._col2 (type: float)
                                                          |  outputColumnNames:["_col0","_col1","_col2"]
                                                          |  Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                                          |<-Map 8 [SIMPLE_EDGE]
-                                                            Reduce Output Operator [RS_17]
+                                                            Reduce Output Operator [RS_15]
                                                                key expressions:_col0 (type: string), _col1 (type: int), _col2 (type: float)
                                                                Map-reduce partition columns:_col0 (type: string), _col1 (type: int), _col2 (type: float)
                                                                sort order:+++
                                                                Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
-                                                               Group By Operator [GBY_16]
+                                                               Group By Operator [GBY_14]
                                                                   keys:key (type: string), c_int (type: int), c_float (type: float)
                                                                   outputColumnNames:["_col0","_col1","_col2"]
                                                                   Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
-                                                                  Filter Operator [FIL_51]
-                                                                     predicate:(((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) and key is not null) (type: boolean)
+                                                                  Filter Operator [FIL_45]
+                                                                     predicate:((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) (type: boolean)
                                                                      Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
-                                                                     TableScan [TS_13]
+                                                                     TableScan [TS_11]
                                                                         alias:cbo_t2
                                                                         Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
 
@@ -891,10 +891,10 @@ Stage-0
                         Select Operator [SEL_26]
                            outputColumnNames:["_col2","_col6"]
                            Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                           Filter Operator [FIL_34]
+                           Filter Operator [FIL_25]
                               predicate:(((_col1 + _col4) >= 2) and ((_col1 > 0) or (_col6 >= 0))) (type: boolean)
                               Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                              Merge Join Operator [MERGEJOIN_37]
+                              Merge Join Operator [MERGEJOIN_36]
                               |  condition map:[{"":"Right Outer Join0 to 1"},{"":"Right Outer Join0 to 2"}]
                               |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                               |  outputColumnNames:["_col1","_col2","_col4","_col6"]
@@ -948,7 +948,7 @@ Stage-0
                               |                       keys:key (type: string), c_int (type: int), c_float (type: float)
                               |                       outputColumnNames:["_col0","_col1","_col2","_col3"]
                               |                       Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                              |                       Filter Operator [FIL_35]
+                              |                       Filter Operator [FIL_34]
                               |                          predicate:((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) (type: boolean)
                               |                          Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                               |                          TableScan [TS_0]
@@ -978,7 +978,7 @@ Stage-0
                                                 keys:key (type: string), c_int (type: int), c_float (type: float)
                                                 outputColumnNames:["_col0","_col1","_col2"]
                                                 Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
-                                                Filter Operator [FIL_36]
+                                                Filter Operator [FIL_35]
                                                    predicate:((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) (type: boolean)
                                                    Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                                    TableScan [TS_11]
@@ -1041,10 +1041,10 @@ Stage-0
                               Select Operator [SEL_30]
                                  outputColumnNames:["_col2","_col6"]
                                  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                                 Filter Operator [FIL_39]
-                                    predicate:(((((_col1 + _col4) >= 0) and ((UDFToLong(_col6) + _col2) >= 0)) and ((_col1 > 0) or (_col6 >= 0))) and ((_col6 >= 1) or (_col2 >= 1))) (type: boolean)
+                                 Filter Operator [FIL_29]
+                                    predicate:(((_col1 + _col4) >= 0) and ((_col1 > 0) or (_col6 >= 0)) and ((_col6 >= 1) or (_col2 >= 1)) and ((UDFToLong(_col6) + _col2) >= 0)) (type: boolean)
                                     Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                                    Merge Join Operator [MERGEJOIN_43]
+                                    Merge Join Operator [MERGEJOIN_42]
                                     |  condition map:[{"":"Outer Join 0 to 1"},{"":"Right Outer Join0 to 2"}]
                                     |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                                     |  outputColumnNames:["_col1","_col2","_col4","_col6"]
@@ -1059,7 +1059,7 @@ Stage-0
                                     |     Select Operator [SEL_24]
                                     |        outputColumnNames:["_col0","_col1"]
                                     |        Statistics:Num rows: 6 Data size: 445 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |        Filter Operator [FIL_42]
+                                    |        Filter Operator [FIL_41]
                                     |           predicate:(c_int > 0) (type: boolean)
                                     |           Statistics:Num rows: 6 Data size: 445 Basic stats: COMPLETE Column stats: COMPLETE
                                     |           TableScan [TS_22]
@@ -1101,7 +1101,7 @@ Stage-0
                                     |                       keys:key (type: string), c_int (type: int), c_float (type: float)
                                     |                       outputColumnNames:["_col0","_col1","_col2","_col3"]
                                     |                       Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                    |                       Filter Operator [FIL_40]
+                                    |                       Filter Operator [FIL_39]
                                     |                          predicate:((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) (type: boolean)
                                     |                          Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                     |                          TableScan [TS_0]
@@ -1143,7 +1143,7 @@ Stage-0
                                                             keys:key (type: string), c_int (type: int), c_float (type: float)
                                                             outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                             Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                            Filter Operator [FIL_41]
+                                                            Filter Operator [FIL_40]
                                                                predicate:((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) (type: boolean)
                                                                Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                                                TableScan [TS_11]
@@ -1168,77 +1168,77 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 5
-         File Output Operator [FS_37]
+         File Output Operator [FS_33]
             compressed:false
             Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_36]
+            Select Operator [SEL_32]
                outputColumnNames:["_col0","_col1","_col2"]
                Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-               Group By Operator [GBY_35]
+               Group By Operator [GBY_31]
                |  aggregations:["count(VALUE._col0)"]
                |  keys:KEY._col0 (type: bigint), KEY._col1 (type: int)
                |  outputColumnNames:["_col0","_col1","_col2"]
                |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Reducer 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_34]
+                  Reduce Output Operator [RS_30]
                      key expressions:_col0 (type: bigint), _col1 (type: int)
                      Map-reduce partition columns:_col0 (type: bigint), _col1 (type: int)
                      sort order:++
                      Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                      value expressions:_col2 (type: bigint)
-                     Group By Operator [GBY_33]
+                     Group By Operator [GBY_29]
                         aggregations:["count()"]
                         keys:_col2 (type: bigint), _col6 (type: int)
                         outputColumnNames:["_col0","_col1","_col2"]
                         Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                        Select Operator [SEL_32]
+                        Select Operator [SEL_28]
                            outputColumnNames:["_col2","_col6"]
                            Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                           Filter Operator [FIL_43]
+                           Filter Operator [FIL_27]
                               predicate:((_col1 > 0) or (_col6 >= 0)) (type: boolean)
                               Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                              Merge Join Operator [MERGEJOIN_49]
+                              Merge Join Operator [MERGEJOIN_43]
                               |  condition map:[{"":"Inner Join 0 to 1"}]
                               |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                               |  outputColumnNames:["_col1","_col2","_col6"]
                               |  Statistics:Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                               |<-Map 8 [SIMPLE_EDGE]
-                              |  Reduce Output Operator [RS_29]
+                              |  Reduce Output Operator [RS_25]
                               |     key expressions:_col0 (type: string)
                               |     Map-reduce partition columns:_col0 (type: string)
                               |     sort order:+
                               |     Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                               |     value expressions:_col1 (type: int)
-                              |     Select Operator [SEL_25]
+                              |     Select Operator [SEL_23]
                               |        outputColumnNames:["_col0","_col1"]
                               |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                              |        Filter Operator [FIL_47]
+                              |        Filter Operator [FIL_41]
                               |           predicate:key is not null (type: boolean)
                               |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                              |           TableScan [TS_23]
+                              |           TableScan [TS_21]
                               |              alias:cbo_t3
                               |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                               |<-Reducer 3 [SIMPLE_EDGE]
-                                 Reduce Output Operator [RS_27]
+                                 Reduce Output Operator [RS_24]
                                     key expressions:_col0 (type: string)
                                     Map-reduce partition columns:_col0 (type: string)
                                     sort order:+
                                     Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                     value expressions:_col1 (type: int), _col2 (type: bigint)
-                                    Select Operator [SEL_22]
+                                    Select Operator [SEL_20]
                                        outputColumnNames:["_col0","_col1","_col2"]
                                        Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                       Filter Operator [FIL_44]
+                                       Filter Operator [FIL_19]
                                           predicate:((_col1 + _col4) >= 0) (type: boolean)
                                           Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                          Merge Join Operator [MERGEJOIN_48]
+                                          Merge Join Operator [MERGEJOIN_42]
                                           |  condition map:[{"":"Inner Join 0 to 1"}]
                                           |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                           |  outputColumnNames:["_col0","_col1","_col2","_col4"]
                                           |  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                           |<-Reducer 2 [SIMPLE_EDGE]
-                                          |  Reduce Output Operator [RS_17]
+                                          |  Reduce Output Operator [RS_16]
                                           |     key expressions:_col0 (type: string)
                                           |     Map-reduce partition columns:_col0 (type: string)
                                           |     sort order:+
@@ -1264,14 +1264,14 @@ Stage-0
                                           |                 keys:key (type: string), c_int (type: int), c_float (type: float)
                                           |                 outputColumnNames:["_col0","_col1","_col2","_col3"]
                                           |                 Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                          |                 Filter Operator [FIL_45]
+                                          |                 Filter Operator [FIL_39]
                                           |                    predicate:(((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) and key is not null) (type: boolean)
                                           |                    Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                           |                    TableScan [TS_0]
                                           |                       alias:cbo_t1
                                           |                       Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                                           |<-Reducer 7 [SIMPLE_EDGE]
-                                             Reduce Output Operator [RS_19]
+                                             Reduce Output Operator [RS_17]
                                                 key expressions:_col0 (type: string)
                                                 Map-reduce partition columns:_col0 (type: string)
                                                 sort order:+
@@ -1294,7 +1294,7 @@ Stage-0
                                                             keys:key (type: string), c_int (type: int), c_float (type: float)
                                                             outputColumnNames:["_col0","_col1","_col2"]
                                                             Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
-                                                            Filter Operator [FIL_46]
+                                                            Filter Operator [FIL_40]
                                                                predicate:(((((((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) and (c_float > 0.0)) and ((c_int >= 1) or (c_float >= 1.0))) and ((UDFToFloat(c_int) + c_float) >= 0.0)) and key is not null) (type: boolean)
                                                                Statistics:Num rows: 1 Data size: 93 Basic stats: COMPLETE Column stats: COMPLETE
                                                                TableScan [TS_8]
@@ -1619,17 +1619,17 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_12]
+         File Output Operator [FS_10]
             compressed:false
             Statistics:Num rows: 18 Data size: 1530 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Merge Join Operator [MERGEJOIN_17]
+            Merge Join Operator [MERGEJOIN_15]
             |  condition map:[{"":"Inner Join 0 to 1"}]
             |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 18 Data size: 1530 Basic stats: COMPLETE Column stats: COMPLETE
             |<-Map 1 [SIMPLE_EDGE]
-            |  Reduce Output Operator [RS_7]
+            |  Reduce Output Operator [RS_6]
             |     key expressions:_col0 (type: string)
             |     Map-reduce partition columns:_col0 (type: string)
             |     sort order:+
@@ -1637,14 +1637,14 @@ Stage-0
             |     Select Operator [SEL_2]
             |        outputColumnNames:["_col0"]
             |        Statistics:Num rows: 6 Data size: 425 Basic stats: COMPLETE Column stats: COMPLETE
-            |        Filter Operator [FIL_15]
+            |        Filter Operator [FIL_13]
             |           predicate:(UDFToDouble(key) >= 1.0) (type: boolean)
             |           Statistics:Num rows: 6 Data size: 425 Basic stats: COMPLETE Column stats: COMPLETE
             |           TableScan [TS_0]
             |              alias:cbo_t1
             |              Statistics:Num rows: 20 Data size: 1530 Basic stats: COMPLETE Column stats: COMPLETE
             |<-Map 3 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_9]
+               Reduce Output Operator [RS_7]
                   key expressions:_col0 (type: string)
                   Map-reduce partition columns:_col0 (type: string)
                   sort order:+
@@ -1652,7 +1652,7 @@ Stage-0
                   Select Operator [SEL_5]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 6 Data size: 425 Basic stats: COMPLETE Column stats: COMPLETE
-                     Filter Operator [FIL_16]
+                     Filter Operator [FIL_14]
                         predicate:(UDFToDouble(key) >= 1.0) (type: boolean)
                         Statistics:Num rows: 6 Data size: 425 Basic stats: COMPLETE Column stats: COMPLETE
                         TableScan [TS_3]
@@ -1779,20 +1779,20 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_17]
+         File Output Operator [FS_14]
             compressed:false
             Statistics:Num rows: 291 Data size: 29391 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_16]
+            Select Operator [SEL_13]
                outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
                Statistics:Num rows: 291 Data size: 29391 Basic stats: COMPLETE Column stats: COMPLETE
-               Merge Join Operator [MERGEJOIN_27]
+               Merge Join Operator [MERGEJOIN_24]
                |  condition map:[{"":"Inner Join 0 to 1"},{"":"Inner Join 0 to 2"}]
                |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                |  outputColumnNames:["_col1","_col2","_col4","_col5","_col6"]
                |  Statistics:Num rows: 291 Data size: 29391 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 1 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_10]
+               |  Reduce Output Operator [RS_9]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -1801,14 +1801,14 @@ Stage-0
                |     Select Operator [SEL_2]
                |        outputColumnNames:["_col0","_col1","_col2"]
                |        Statistics:Num rows: 18 Data size: 1488 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_24]
+               |        Filter Operator [FIL_21]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 18 Data size: 1488 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_0]
                |              alias:cbo_t1
                |              Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 3 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_12]
+               |  Reduce Output Operator [RS_10]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -1817,14 +1817,14 @@ Stage-0
                |     Select Operator [SEL_5]
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_25]
+               |        Filter Operator [FIL_22]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_3]
                |              alias:cbo_t3
                |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_14]
+                  Reduce Output Operator [RS_11]
                      key expressions:_col0 (type: string)
                      Map-reduce partition columns:_col0 (type: string)
                      sort order:+
@@ -1833,7 +1833,7 @@ Stage-0
                      Select Operator [SEL_8]
                         outputColumnNames:["_col0","_col1"]
                         Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                        Filter Operator [FIL_26]
+                        Filter Operator [FIL_23]
                            predicate:key is not null (type: boolean)
                            Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                            TableScan [TS_6]
@@ -1854,20 +1854,20 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_17]
+         File Output Operator [FS_14]
             compressed:false
             Statistics:Num rows: 291 Data size: 51798 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_16]
+            Select Operator [SEL_13]
                outputColumnNames:["_col0","_col1","_col2","_col3"]
                Statistics:Num rows: 291 Data size: 51798 Basic stats: COMPLETE Column stats: COMPLETE
-               Merge Join Operator [MERGEJOIN_27]
+               Merge Join Operator [MERGEJOIN_24]
                |  condition map:[{"":"Inner Join 0 to 1"},{"":"Inner Join 0 to 2"}]
                |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                |  outputColumnNames:["_col0","_col1","_col3","_col4"]
                |  Statistics:Num rows: 291 Data size: 51798 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 1 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_10]
+               |  Reduce Output Operator [RS_9]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -1876,14 +1876,14 @@ Stage-0
                |     Select Operator [SEL_2]
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_24]
+               |        Filter Operator [FIL_21]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_0]
                |              alias:cbo_t1
                |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 3 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_12]
+               |  Reduce Output Operator [RS_10]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -1891,14 +1891,14 @@ Stage-0
                |     Select Operator [SEL_5]
                |        outputColumnNames:["_col0"]
                |        Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_25]
+               |        Filter Operator [FIL_22]
                |           predicate:key is not null (type: boolean)
                |           Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_3]
                |              alias:cbo_t3
                |              Statistics:Num rows: 20 Data size: 1530 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_14]
+                  Reduce Output Operator [RS_11]
                      key expressions:_col0 (type: string)
                      Map-reduce partition columns:_col0 (type: string)
                      sort order:+
@@ -1907,7 +1907,7 @@ Stage-0
                      Select Operator [SEL_8]
                         outputColumnNames:["_col0","_col1"]
                         Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                        Filter Operator [FIL_26]
+                        Filter Operator [FIL_23]
                            predicate:key is not null (type: boolean)
                            Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                            TableScan [TS_6]
@@ -1929,23 +1929,23 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 3
-         File Output Operator [FS_21]
+         File Output Operator [FS_19]
             compressed:false
-            Statistics:Num rows: 14 Data size: 1414 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics:Num rows: 6 Data size: 606 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_20]
+            Select Operator [SEL_18]
                outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
-               Statistics:Num rows: 14 Data size: 1414 Basic stats: COMPLETE Column stats: COMPLETE
-               Filter Operator [FIL_26]
+               Statistics:Num rows: 6 Data size: 606 Basic stats: COMPLETE Column stats: COMPLETE
+               Filter Operator [FIL_17]
                   predicate:((_col1 > 0) or (_col6 >= 0)) (type: boolean)
-                  Statistics:Num rows: 14 Data size: 1414 Basic stats: COMPLETE Column stats: COMPLETE
-                  Merge Join Operator [MERGEJOIN_33]
+                  Statistics:Num rows: 6 Data size: 606 Basic stats: COMPLETE Column stats: COMPLETE
+                  Merge Join Operator [MERGEJOIN_28]
                   |  condition map:[{"":"Inner Join 0 to 1"}]
                   |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                   |  outputColumnNames:["_col1","_col2","_col3","_col4","_col6"]
-                  |  Statistics:Num rows: 21 Data size: 2121 Basic stats: COMPLETE Column stats: COMPLETE
+                  |  Statistics:Num rows: 10 Data size: 1010 Basic stats: COMPLETE Column stats: COMPLETE
                   |<-Map 5 [SIMPLE_EDGE]
-                  |  Reduce Output Operator [RS_17]
+                  |  Reduce Output Operator [RS_15]
                   |     key expressions:_col0 (type: string)
                   |     Map-reduce partition columns:_col0 (type: string)
                   |     sort order:+
@@ -1954,27 +1954,27 @@ Stage-0
                   |     Select Operator [SEL_13]
                   |        outputColumnNames:["_col0","_col1"]
                   |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                  |        Filter Operator [FIL_31]
+                  |        Filter Operator [FIL_26]
                   |           predicate:key is not null (type: boolean)
                   |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                   |           TableScan [TS_11]
                   |              alias:cbo_t3
                   |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                   |<-Reducer 2 [SIMPLE_EDGE]
-                     Reduce Output Operator [RS_15]
+                     Reduce Output Operator [RS_14]
                         key expressions:_col0 (type: string)
                         Map-reduce partition columns:_col0 (type: string)
                         sort order:+
-                        Statistics:Num rows: 6 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
+                        Statistics:Num rows: 3 Data size: 546 Basic stats: COMPLETE Column stats: COMPLETE
                         value expressions:_col1 (type: int), _col2 (type: float), _col3 (type: string), _col4 (type: int)
-                        Filter Operator [FIL_28]
+                        Filter Operator [FIL_9]
                            predicate:(((_col1 + _col4) = 2) and ((_col4 + 1) = 2)) (type: boolean)
-                           Statistics:Num rows: 6 Data size: 1092 Basic stats: COMPLETE Column stats: COMPLETE
-                           Merge Join Operator [MERGEJOIN_32]
+                           Statistics:Num rows: 3 Data size: 546 Basic stats: COMPLETE Column stats: COMPLETE
+                           Merge Join Operator [MERGEJOIN_27]
                            |  condition map:[{"":"Left Outer Join0 to 1"}]
                            |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                            |  outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
-                           |  Statistics:Num rows: 25 Data size: 4550 Basic stats: COMPLETE Column stats: COMPLETE
+                           |  Statistics:Num rows: 15 Data size: 2730 Basic stats: COMPLETE Column stats: COMPLETE
                            |<-Map 1 [SIMPLE_EDGE]
                            |  Reduce Output Operator [RS_6]
                            |     key expressions:_col0 (type: string)
@@ -1985,7 +1985,7 @@ Stage-0
                            |     Select Operator [SEL_2]
                            |        outputColumnNames:["_col0","_col1","_col2"]
                            |        Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
-                           |        Filter Operator [FIL_29]
+                           |        Filter Operator [FIL_24]
                            |           predicate:((((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
                            |           Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
                            |           TableScan [TS_0]
@@ -1996,14 +1996,14 @@ Stage-0
                                  key expressions:_col0 (type: string)
                                  Map-reduce partition columns:_col0 (type: string)
                                  sort order:+
-                                 Statistics:Num rows: 5 Data size: 356 Basic stats: COMPLETE Column stats: COMPLETE
+                                 Statistics:Num rows: 6 Data size: 445 Basic stats: COMPLETE Column stats: COMPLETE
                                  value expressions:_col1 (type: int)
                                  Select Operator [SEL_5]
                                     outputColumnNames:["_col0","_col1"]
-                                    Statistics:Num rows: 5 Data size: 356 Basic stats: COMPLETE Column stats: COMPLETE
-                                    Filter Operator [FIL_30]
-                                       predicate:((((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
-                                       Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
+                                    Statistics:Num rows: 6 Data size: 445 Basic stats: COMPLETE Column stats: COMPLETE
+                                    Filter Operator [FIL_25]
+                                       predicate:(((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
+                                       Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
                                        TableScan [TS_3]
                                           alias:cbo_t2
                                           Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
@@ -2024,15 +2024,15 @@ Stage-0
          Reducer 2
          File Output Operator [FS_14]
             compressed:false
-            Statistics:Num rows: 12 Data size: 1212 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics:Num rows: 8 Data size: 808 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
             Select Operator [SEL_13]
                outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
-               Statistics:Num rows: 12 Data size: 1212 Basic stats: COMPLETE Column stats: COMPLETE
-               Filter Operator [FIL_18]
-                  predicate:((((_col1 + _col4) = 2) and ((_col1 > 0) or (_col6 >= 0))) and ((_col4 + 1) = 2)) (type: boolean)
-                  Statistics:Num rows: 12 Data size: 1212 Basic stats: COMPLETE Column stats: COMPLETE
-                  Merge Join Operator [MERGEJOIN_21]
+               Statistics:Num rows: 8 Data size: 808 Basic stats: COMPLETE Column stats: COMPLETE
+               Filter Operator [FIL_12]
+                  predicate:(((_col1 + _col4) = 2) and ((_col1 > 0) or (_col6 >= 0)) and ((_col4 + 1) = 2) and ((_col1 > 0) or (_col6 >= 0))) (type: boolean)
+                  Statistics:Num rows: 8 Data size: 808 Basic stats: COMPLETE Column stats: COMPLETE
+                  Merge Join Operator [MERGEJOIN_19]
                   |  condition map:[{"":"Right Outer Join0 to 1"},{"":"Right Outer Join0 to 2"}]
                   |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                   |  outputColumnNames:["_col1","_col2","_col3","_col4","_col6"]
@@ -2047,7 +2047,7 @@ Stage-0
                   |     Select Operator [SEL_2]
                   |        outputColumnNames:["_col0","_col1","_col2"]
                   |        Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
-                  |        Filter Operator [FIL_19]
+                  |        Filter Operator [FIL_17]
                   |           predicate:(((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
                   |           Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
                   |           TableScan [TS_0]
@@ -2063,7 +2063,7 @@ Stage-0
                   |     Select Operator [SEL_5]
                   |        outputColumnNames:["_col0","_col1"]
                   |        Statistics:Num rows: 6 Data size: 445 Basic stats: COMPLETE Column stats: COMPLETE
-                  |        Filter Operator [FIL_20]
+                  |        Filter Operator [FIL_18]
                   |           predicate:(((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
                   |           Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
                   |           TableScan [TS_3]
@@ -2361,95 +2361,95 @@ Stage-0
       limit:5
       Stage-1
          Reducer 7
-         File Output Operator [FS_53]
+         File Output Operator [FS_49]
             compressed:false
             Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Limit [LIM_52]
+            Limit [LIM_48]
                Number of rows:5
                Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-               Select Operator [SEL_51]
+               Select Operator [SEL_47]
                |  outputColumnNames:["_col0","_col1","_col2"]
                |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Reducer 6 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_50]
+                  Reduce Output Operator [RS_46]
                      key expressions:(UDFToLong(_col0) + _col1) (type: bigint), _col1 (type: bigint)
                      sort order:-+
                      Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                      value expressions:_col0 (type: int), _col2 (type: bigint)
-                     Select Operator [SEL_48]
+                     Select Operator [SEL_44]
                         outputColumnNames:["_col0","_col1","_col2"]
                         Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                        Group By Operator [GBY_47]
+                        Group By Operator [GBY_43]
                         |  aggregations:["count(VALUE._col0)"]
                         |  keys:KEY._col0 (type: bigint), KEY._col1 (type: int)
                         |  outputColumnNames:["_col0","_col1","_col2"]
                         |  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                         |<-Reducer 5 [SIMPLE_EDGE]
-                           Reduce Output Operator [RS_46]
+                           Reduce Output Operator [RS_42]
                               key expressions:_col0 (type: bigint), _col1 (type: int)
                               Map-reduce partition columns:_col0 (type: bigint), _col1 (type: int)
                               sort order:++
                               Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
                               value expressions:_col2 (type: bigint)
-                              Group By Operator [GBY_45]
+                              Group By Operator [GBY_41]
                                  aggregations:["count()"]
                                  keys:_col2 (type: bigint), _col6 (type: int)
                                  outputColumnNames:["_col0","_col1","_col2"]
                                  Statistics:Num rows: 1 Data size: 20 Basic stats: COMPLETE Column stats: COMPLETE
-                                 Select Operator [SEL_44]
+                                 Select Operator [SEL_40]
                                     outputColumnNames:["_col2","_col6"]
                                     Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                                    Filter Operator [FIL_59]
+                                    Filter Operator [FIL_39]
                                        predicate:((_col1 > 0) or (_col6 >= 0)) (type: boolean)
                                        Statistics:Num rows: 2 Data size: 32 Basic stats: COMPLETE Column stats: COMPLETE
-                                       Merge Join Operator [MERGEJOIN_67]
+                                       Merge Join Operator [MERGEJOIN_61]
                                        |  condition map:[{"":"Inner Join 0 to 1"}]
                                        |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                        |  outputColumnNames:["_col1","_col2","_col6"]
                                        |  Statistics:Num rows: 3 Data size: 48 Basic stats: COMPLETE Column stats: COMPLETE
                                        |<-Map 11 [SIMPLE_EDGE]
-                                       |  Reduce Output Operator [RS_41]
+                                       |  Reduce Output Operator [RS_37]
                                        |     key expressions:_col0 (type: string)
                                        |     Map-reduce partition columns:_col0 (type: string)
                                        |     sort order:+
                                        |     Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
                                        |     value expressions:_col1 (type: int)
-                                       |     Select Operator [SEL_37]
+                                       |     Select Operator [SEL_35]
                                        |        outputColumnNames:["_col0","_col1"]
                                        |        Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                                       |        Filter Operator [FIL_65]
+                                       |        Filter Operator [FIL_59]
                                        |           predicate:key is not null (type: boolean)
                                        |           Statistics:Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                                       |           TableScan [TS_35]
+                                       |           TableScan [TS_33]
                                        |              alias:cbo_t3
                                        |              Statistics:Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
                                        |<-Reducer 4 [SIMPLE_EDGE]
-                                          Reduce Output Operator [RS_39]
+                                          Reduce Output Operator [RS_36]
                                              key expressions:_col0 (type: string)
                                              Map-reduce partition columns:_col0 (type: string)
                                              sort order:+
                                              Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                              value expressions:_col1 (type: int), _col2 (type: bigint)
-                                             Select Operator [SEL_34]
+                                             Select Operator [SEL_32]
                                                 outputColumnNames:["_col0","_col1","_col2"]
                                                 Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                Filter Operator [FIL_60]
+                                                Filter Operator [FIL_31]
                                                    predicate:((_col1 + _col4) >= 0) (type: boolean)
                                                    Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                   Merge Join Operator [MERGEJOIN_66]
+                                                   Merge Join Operator [MERGEJOIN_60]
                                                    |  condition map:[{"":"Inner Join 0 to 1"}]
                                                    |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                                                    |  outputColumnNames:["_col0","_col1","_col2","_col4"]
                                                    |  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
                                                    |<-Reducer 10 [SIMPLE_EDGE]
-                                                   |  Reduce Output Operator [RS_31]
+                                                   |  Reduce Output Operator [RS_29]
                                                    |     key expressions:_col0 (type: string)
                                                    |     Map-reduce partition columns:_col0 (type: string)
                                                    |     sort order:+
                                                    |     Statistics:Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                                                    |     value expressions:_col1 (type: int)
-                                                   |     Filter Operator [FIL_63]
+                                                   |     Filter Operator [FIL_26]
                                                    |        predicate:_col0 is not null (type: boolean)
                                                    |        Statistics:Num rows: 1 Data size: 105 Basic stats: COMPLETE Column stats: COMPLETE
                                                    |        Limit [LIM_24]
@@ -2484,20 +2484,20 @@ Stage-0
                                                    |                             keys:key (type: string), c_int (type: int), c_float (type: float)
                                                    |                             outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                    |                             Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                   |                             Filter Operator [FIL_64]
+                                                   |                             Filter Operator [FIL_58]
                                                    |                                predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
                                                    |                                Statistics:Num rows: 4 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
                                                    |                                TableScan [TS_14]
                                                    |                                   alias:cbo_t2
                                                    |                                   Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                                                    |<-Reducer 3 [SIMPLE_EDGE]
-                                                      Reduce Output Operator [RS_29]
+                                                      Reduce Output Operator [RS_28]
                                                          key expressions:_col0 (type: string)
                                                          Map-reduce partition columns:_col0 (type: string)
                                                          sort order:+
                                                          Statistics:Num rows: 1 Data size: 97 Basic stats: COMPLETE Column stats: COMPLETE
                                                          value expressions:_col1 (type: int), _col2 (type: bigint)
-                                                         Filter Operator [FIL_61]
+                                                         Filter Operator [FIL_12]
                                                             predicate:_col0 is not null (type: boolean)
                                                             Statistics:Num rows: 1 Data size: 97 Basic stats: COMPLETE Column stats: COMPLETE
                                                             Limit [LIM_10]
@@ -2532,7 +2532,7 @@ Stage-0
                                                                                  keys:key (type: string), c_int (type: int), c_float (type: float)
                                                                                  outputColumnNames:["_col0","_col1","_col2","_col3"]
                                                                                  Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
-                                                                                 Filter Operator [FIL_62]
+                                                                                 Filter Operator [FIL_56]
                                                                                     predicate:(((c_int + 1) >= 0) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
                                                                                     Statistics:Num rows: 4 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
                                                                                     TableScan [TS_0]
@@ -2553,20 +2553,20 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_14]
+         File Output Operator [FS_12]
             compressed:false
             Statistics:Num rows: 7 Data size: 28 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_13]
+            Select Operator [SEL_11]
                outputColumnNames:["_col0"]
                Statistics:Num rows: 7 Data size: 28 Basic stats: COMPLETE Column stats: COMPLETE
-               Merge Join Operator [MERGEJOIN_19]
+               Merge Join Operator [MERGEJOIN_17]
                |  condition map:[{"":"Left Semi Join 0 to 1"}]
                |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)"}
                |  outputColumnNames:["_col1"]
                |  Statistics:Num rows: 7 Data size: 28 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 1 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_9]
+               |  Reduce Output Operator [RS_8]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -2575,14 +2575,14 @@ Stage-0
                |     Select Operator [SEL_2]
                |        outputColumnNames:["_col0","_col1"]
                |        Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_17]
+               |        Filter Operator [FIL_15]
                |           predicate:((((c_int + 1) = 2) and key is not null) and ((c_int > 0) or (c_float >= 0.0))) (type: boolean)
                |           Statistics:Num rows: 6 Data size: 465 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_0]
                |              alias:cbo_t1
                |              Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 3 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_11]
+                  Reduce Output Operator [RS_9]
                      key expressions:_col0 (type: string)
                      Map-reduce partition columns:_col0 (type: string)
                      sort order:+
@@ -2594,7 +2594,7 @@ Stage-0
                         Select Operator [SEL_5]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
-                           Filter Operator [FIL_18]
+                           Filter Operator [FIL_16]
                               predicate:key is not null (type: boolean)
                               Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
                               TableScan [TS_3]
@@ -2615,20 +2615,20 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 2
-         File Output Operator [FS_21]
+         File Output Operator [FS_18]
             compressed:false
             Statistics:Num rows: 12 Data size: 1116 Basic stats: COMPLETE Column stats: COMPLETE
             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"}
-            Select Operator [SEL_20]
+            Select Operator [SEL_17]
                outputColumnNames:["_col0","_col1","_col2"]
                Statistics:Num rows: 12 Data size: 1116 Basic stats: COMPLETE Column stats: COMPLETE
-               Merge Join Operator [MERGEJOIN_31]
+               Merge Join Operator [MERGEJOIN_28]
                |  condition map:[{"":"Left Semi Join 0 to 1"},{"":"Left Semi Join 0 to 2"}]
                |  keys:{"0":"_col0 (type: string)","1":"_col0 (type: string)","2":"_col0 (type: string)"}
                |  outputColumnNames:["_col0","_col1","_col2"]
                |  Statistics:Num rows: 12 Data size: 1116 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 1 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_14]
+               |  Reduce Output Operator [RS_13]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -2637,14 +2637,14 @@ Stage-0
                |     Select Operator [SEL_2]
                |        outputColumnNames:["_col0","_col1","_col2"]
                |        Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
-               |        Filter Operator [FIL_28]
+               |        Filter Operator [FIL_25]
                |           predicate:((((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
                |           Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
                |           TableScan [TS_0]
                |              alias:cbo_t1
                |              Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 3 [SIMPLE_EDGE]
-               |  Reduce Output Operator [RS_16]
+               |  Reduce Output Operator [RS_14]
                |     key expressions:_col0 (type: string)
                |     Map-reduce partition columns:_col0 (type: string)
                |     sort order:+
@@ -2656,14 +2656,14 @@ Stage-0
                |        Select Operator [SEL_5]
                |           outputColumnNames:["_col0"]
                |           Statistics:Num rows: 5 Data size: 340 Basic stats: COMPLETE Column stats: COMPLETE
-               |           Filter Operator [FIL_29]
+               |           Filter Operator [FIL_26]
                |              predicate:((((c_int + 1) = 2) and ((c_int > 0) or (c_float >= 0.0))) and key is not null) (type: boolean)
                |              Statistics:Num rows: 5 Data size: 372 Basic stats: COMPLETE Column stats: COMPLETE
                |              TableScan [TS_3]
                |                 alias:cbo_t2
                |                 Statistics:Num rows: 20 Data size: 1674 Basic stats: COMPLETE Column stats: COMPLETE
                |<-Map 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_18]
+                  Reduce Output Operator [RS_15]
                      key expressions:_col0 (type: string)
                      Map-reduce partition columns:_col0 (type: string)
                      sort order:+
@@ -2675,7 +2675,7 @@ Stage-0
                         Select Operator [SEL_8]
                            outputColumnNames:["_col0"]
                            Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
-                           Filter Operator [FIL_30]
+                           Filter Operator [FIL_27]
                               predicate:key is not null (type: boolean)
                               Statistics:Num rows: 18 Data size: 1360 Basic stats: COMPLETE Column stats: COMPLETE
                               TableScan [TS_6]
@@ -2702,153 +2702,150 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 6
-         File Output Operator [FS_47]
+         File Output Operator [FS_41]
             compressed:false
             Statistics:Num rows: 1 Data size: 101 Basic stats: COMPLETE Column stats: COMPLETE
             table:{"input format:":"org.apache.hadoop.mapred.TextInputFormat","output format:":"org.apache.hadoop.hi

<TRUNCATED>

[12/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/llap/vectorized_dynamic_partition_pruning.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/vectorized_dynamic_partition_pruning.q.out b/ql/src/test/results/clientpositive/llap/vectorized_dynamic_partition_pruning.q.out
index 5ceefe1..2464076 100644
--- a/ql/src/test/results/clientpositive/llap/vectorized_dynamic_partition_pruning.q.out
+++ b/ql/src/test/results/clientpositive/llap/vectorized_dynamic_partition_pruning.q.out
@@ -1322,29 +1322,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1451,20 +1448,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
@@ -1507,7 +1501,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1580,29 +1574,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToDouble(_col0) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: UDFToDouble(_col0) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToDouble(_col0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: UDFToDouble(_col0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1694,20 +1685,17 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (hr is not null and (UDFToDouble(hr) * 2.0) is not null) (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                      sort order: +
+                      Map-reduce partition columns: (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: (UDFToDouble(_col0) * 2.0) (type: double)
-                        sort order: +
-                        Map-reduce partition columns: (UDFToDouble(_col0) * 2.0) (type: double)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
@@ -1735,7 +1723,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 (UDFToDouble(_col0) * 2.0) (type: double)
+                  0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
                   1 _col0 (type: double)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -1821,29 +1809,26 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToString((UDFToDouble(hr) * 2.0)) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
+                    Reduce Output Operator
+                      key expressions: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
+                      sort order: +
+                      Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        sort order: +
-                        Map-reduce partition columns: UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
-                        Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Execution mode: llap
         Map 4 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToString(hr) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -1877,7 +1862,7 @@ STAGE PLANS:
                 condition map:
                      Inner Join 0 to 1
                 keys:
-                  0 UDFToString((UDFToDouble(_col0) * 2.0)) (type: string)
+                  0 UDFToString((UDFToDouble(_col0) * UDFToDouble(2))) (type: string)
                   1 UDFToString(_col0) (type: string)
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 Group By Operator
@@ -2098,7 +2083,7 @@ POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=11
 POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12
 #### A masked pattern was here ####
 1000
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: -- non-equi join
 EXPLAIN select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
@@ -2196,7 +2181,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join MERGEJOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
+Warning: Shuffle Join MERGEJOIN[17][tables = [$hdt$_0, $hdt$_1]] in Stage 'Reducer 2' is a cross product
 PREHOOK: query: select count(*) from srcpart, srcpart_date_hour where (srcpart_date_hour.`date` = '2008-04-08' and srcpart_date_hour.hour = 11) and (srcpart.ds = srcpart_date_hour.ds or srcpart.hr = srcpart_date_hour.hr)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -4269,43 +4254,40 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 UDFToDouble(_col0) (type: double)
-                          1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 UDFToDouble(_col0) (type: double)
+                        1 UDFToDouble(UDFToInteger((_col0 / 2.0))) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_double_hour
-                  filterExpr: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                  filterExpr: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                   Statistics: Num rows: 2 Data size: 188 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((UDFToDouble(hour) = 11.0) and hr is not null) and UDFToDouble(UDFToInteger((hr / 2.0))) is not null) (type: boolean)
+                    predicate: ((UDFToDouble(hour) = 11.0) and hr is not null) (type: boolean)
                     Statistics: Num rows: 1 Data size: 94 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: hr (type: double)
@@ -4393,34 +4375,31 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart
-                  filterExpr: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  filterExpr: hr is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: (UDFToDouble(hr) * 2.0) is not null (type: boolean)
+                  Select Operator
+                    expressions: hr (type: string)
+                    outputColumnNames: _col0
                     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: hr (type: string)
-                      outputColumnNames: _col0
-                      Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 (UDFToDouble(_col0) * 2.0) (type: double)
-                          1 _col0 (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 (UDFToDouble(_col0) * UDFToDouble(2)) (type: double)
+                        1 _col0 (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
@@ -5461,43 +5440,39 @@ STAGE PLANS:
             Map Operator Tree:
                 TableScan
                   alias: srcpart_orc
-                  filterExpr: UDFToDouble(hr) is not null (type: boolean)
                   Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: UDFToDouble(hr) is not null (type: boolean)
+                  Select Operator
+                    expressions: ds (type: string), hr (type: int)
+                    outputColumnNames: _col0, _col1
                     Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                    Select Operator
-                      expressions: ds (type: string), hr (type: int)
-                      outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 2000 Data size: 188000 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col0 (type: string), UDFToDouble(_col1) (type: double)
-                          1 _col0 (type: string), UDFToDouble(_col2) (type: double)
-                        input vertices:
-                          1 Map 3
-                        Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Group By Operator
-                          aggregations: count()
-                          mode: hash
-                          outputColumnNames: _col0
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                      keys:
+                        0 _col0 (type: string), UDFToDouble(_col1) (type: double)
+                        1 _col0 (type: string), UDFToDouble(_col2) (type: double)
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 2200 Data size: 206800 Basic stats: COMPLETE Column stats: NONE
+                      HybridGraceHashJoin: true
+                      Group By Operator
+                        aggregations: count()
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          sort order: 
                           Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                          Reduce Output Operator
-                            sort order: 
-                            Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                            value expressions: _col0 (type: bigint)
+                          value expressions: _col0 (type: bigint)
             Execution mode: llap
         Map 3 
             Map Operator Tree:
                 TableScan
                   alias: srcpart_date_hour
-                  filterExpr: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                  filterExpr: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                   Statistics: Num rows: 4 Data size: 1440 Basic stats: COMPLETE Column stats: NONE
                   Filter Operator
-                    predicate: (((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) and UDFToDouble(hr) is not null) (type: boolean)
+                    predicate: ((((UDFToDouble(hour) = 11.0) and ((date = '2008-04-08') or (date = '2008-04-09'))) and hr is not null) and ds is not null) (type: boolean)
                     Statistics: Num rows: 2 Data size: 720 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: ds (type: string), hr (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/louter_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/louter_join_ppr.q.out b/ql/src/test/results/clientpositive/louter_join_ppr.q.out
index 84dce67..1f685ae 100644
--- a/ql/src/test/results/clientpositive/louter_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/louter_join_ppr.q.out
@@ -973,7 +973,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 15.0)) and (UDFToDouble(key) < 25.0)) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -993,7 +993,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) and key is not null) (type: boolean)
+              predicate: ((((UDFToDouble(key) > 15.0) and (UDFToDouble(key) < 25.0)) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key) > 10.0)) (type: boolean)
               Statistics: Num rows: 12 Data size: 127 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/mapjoin_mapjoin.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/mapjoin_mapjoin.q.out b/ql/src/test/results/clientpositive/mapjoin_mapjoin.q.out
index 14c6f18..416634b 100644
--- a/ql/src/test/results/clientpositive/mapjoin_mapjoin.q.out
+++ b/ql/src/test/results/clientpositive/mapjoin_mapjoin.q.out
@@ -512,7 +512,7 @@ STAGE PLANS:
             alias: srcpart
             Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((value > 'val_450') and key is not null) and value is not null) (type: boolean)
+              predicate: ((value > 'val_450') and key is not null) (type: boolean)
               Statistics: Num rows: 666 Data size: 7075 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/multiMapJoin1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/multiMapJoin1.q.out b/ql/src/test/results/clientpositive/multiMapJoin1.q.out
index 02b2707..e2efec0 100644
--- a/ql/src/test/results/clientpositive/multiMapJoin1.q.out
+++ b/ql/src/test/results/clientpositive/multiMapJoin1.q.out
@@ -878,8 +878,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     File Output Operator
                       compressed: false
@@ -1323,7 +1323,7 @@ STAGE PLANS:
               sort order: +
               Map-reduce partition columns: _col3 (type: string)
               Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: string)
+              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string)
           TableScan
             alias: smalltbl2
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
@@ -1405,8 +1405,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     File Output Operator
                       compressed: false
@@ -1461,8 +1461,8 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3
           Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
           Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-            outputColumnNames: _col0, _col1, _col2, _col3, _col4
+            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
             Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
@@ -1744,8 +1744,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     Map Join Operator
                       condition map:
@@ -2038,8 +2038,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     Map Join Operator
                       condition map:
@@ -2390,8 +2390,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     File Output Operator
                       compressed: false
@@ -2835,7 +2835,7 @@ STAGE PLANS:
               sort order: +
               Map-reduce partition columns: _col3 (type: string)
               Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
-              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col4 (type: string)
+              value expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string)
           TableScan
             alias: smalltbl2
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
@@ -2917,8 +2917,8 @@ STAGE PLANS:
                   outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                   Select Operator
-                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-                    outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                    expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3
                     Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
                     File Output Operator
                       compressed: false
@@ -2973,8 +2973,8 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3
           Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
           Select Operator
-            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string), _col2 (type: string)
-            outputColumnNames: _col0, _col1, _col2, _col3, _col4
+            expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col2 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
             Statistics: Num rows: 5500 Data size: 79398 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/nonblock_op_deduplicate.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/nonblock_op_deduplicate.q.out b/ql/src/test/results/clientpositive/nonblock_op_deduplicate.q.out
index 9a24ad8..83be55d 100644
--- a/ql/src/test/results/clientpositive/nonblock_op_deduplicate.q.out
+++ b/ql/src/test/results/clientpositive/nonblock_op_deduplicate.q.out
@@ -188,7 +188,7 @@ POSTHOOK: Input: default@src1
 406	val_406	25
 66	val_66	25
 98	val_98	25
-Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: -- Then, we convert the join to MapJoin.
 EXPLAIN
 SELECT tmp4.key as key, tmp4.value as value, tmp4.count as count
@@ -296,7 +296,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[16][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: SELECT tmp4.key as key, tmp4.value as value, tmp4.count as count
 FROM (SELECT tmp2.key as key, tmp2.value as value, tmp3.count as count
       FROM (SELECT *

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/orc_llap.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/orc_llap.q.out b/ql/src/test/results/clientpositive/orc_llap.q.out
index f67fcc6..7ab3d14 100644
--- a/ql/src/test/results/clientpositive/orc_llap.q.out
+++ b/ql/src/test/results/clientpositive/orc_llap.q.out
@@ -121,7 +121,7 @@ POSTHOOK: Output: default@orc_llap_small
 POSTHOOK: Lineage: orc_llap_small.cint SIMPLE [(alltypesorc)alltypesorc.FieldSchema(name:cint, type:int, comment:null), ]
 POSTHOOK: Lineage: orc_llap_small.csmallint SIMPLE [(alltypesorc)alltypesorc.FieldSchema(name:csmallint, type:smallint, comment:null), ]
 POSTHOOK: Lineage: orc_llap_small.ctinyint SIMPLE [(alltypesorc)alltypesorc.FieldSchema(name:ctinyint, type:tinyint, comment:null), ]
-Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: -- Cross join with no projection - do it on small table
 explain
 select count(1) from orc_llap_small y join orc_llap_small x
@@ -202,7 +202,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[18][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[17][bigTable=?] in task 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: select count(1) from orc_llap_small y join orc_llap_small x
 PREHOOK: type: QUERY
 PREHOOK: Input: default@orc_llap_small
@@ -636,7 +636,7 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@llap_temp_table
 #### A masked pattern was here ####
 -735462183586256
-Warning: Map Join MAPJOIN[12][bigTable=?] in task 'Stage-4:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-4:MAPRED' is a cross product
 PREHOOK: query: -- multi-stripe test
 insert into table orc_llap
 select ctinyint + i, csmallint + i, cint + i, cbigint + i, cfloat + i, cdouble + i, cstring1, cstring2, ctimestamp1, ctimestamp2, cboolean1, cboolean2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/outer_join_ppr.q.java1.7.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/outer_join_ppr.q.java1.7.out b/ql/src/test/results/clientpositive/outer_join_ppr.q.java1.7.out
index b257221..66d1fb3 100644
--- a/ql/src/test/results/clientpositive/outer_join_ppr.q.java1.7.out
+++ b/ql/src/test/results/clientpositive/outer_join_ppr.q.java1.7.out
@@ -400,7 +400,7 @@ STAGE PLANS:
           Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: ((((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0)) and (UDFToDouble(_col2) > 15.0)) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
+            predicate: ((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0) and (UDFToDouble(_col2) > 15.0) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
             Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/partition_boolexpr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/partition_boolexpr.q.out b/ql/src/test/results/clientpositive/partition_boolexpr.q.out
index 05fe761..f574f89 100644
--- a/ql/src/test/results/clientpositive/partition_boolexpr.q.out
+++ b/ql/src/test/results/clientpositive/partition_boolexpr.q.out
@@ -87,19 +87,21 @@ STAGE PLANS:
       Map Operator Tree:
           TableScan
             alias: srcpart
-            Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-            Filter Operator
-              predicate: false (type: boolean)
-              Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Group By Operator
-                aggregations: count(1)
-                mode: hash
-                outputColumnNames: _col0
-                Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  sort order: 
+            Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: false (type: boolean)
+                Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: NONE
+                Group By Operator
+                  aggregations: count(1)
+                  mode: hash
+                  outputColumnNames: _col0
                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                  value expressions: _col0 (type: bigint)
+                  Reduce Output Operator
+                    sort order: 
+                    Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                    value expressions: _col0 (type: bigint)
       Reduce Operator Tree:
         Group By Operator
           aggregations: count(VALUE._col0)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_gby_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_gby_join.q.out b/ql/src/test/results/clientpositive/ppd_gby_join.q.out
index 09dfb82..205e0b5 100644
--- a/ql/src/test/results/clientpositive/ppd_gby_join.q.out
+++ b/ql/src/test/results/clientpositive/ppd_gby_join.q.out
@@ -35,38 +35,32 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -311,7 +305,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -326,7 +320,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join.q.out b/ql/src/test/results/clientpositive/ppd_join.q.out
index f284237..c3123d2 100644
--- a/ql/src/test/results/clientpositive/ppd_join.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join.q.out
@@ -32,39 +32,33 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -563,7 +557,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: ((((((key > '1') and (key > '20')) and ((value < 'val_50') or (key > '2'))) and (key < '400')) and (key > '2')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 4 Data size: 42 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -578,7 +572,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key > '2') and (key <> '4')) and (key > '1')) and (key > '20')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join2.q.out b/ql/src/test/results/clientpositive/ppd_join2.q.out
index fe2ad46..c503652 100644
--- a/ql/src/test/results/clientpositive/ppd_join2.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join2.q.out
@@ -39,40 +39,34 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) and key is not null) (type: boolean)
+              predicate: (((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
           TableScan
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -89,15 +83,12 @@ STAGE PLANS:
               expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string)
               outputColumnNames: _col0, _col1, _col3
               Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: _col1 is not null (type: boolean)
-                Statistics: Num rows: 182 Data size: 1939 Basic stats: COMPLETE 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
+              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-1
     Map Reduce
@@ -112,14 +103,11 @@ STAGE PLANS:
                 expressions: value (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
           TableScan
             Reduce Output Operator
               key expressions: _col1 (type: string)
@@ -1735,7 +1723,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) and key is not null) (type: boolean)
+              predicate: (((((((key <> '302') and (key <> '311')) and ((value <> 'val_50') or (key > '1'))) and (key < '400')) and (key <> '305')) and (key <> '14')) and value is not null) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -1751,7 +1739,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key <> '305') and (key <> '14')) and (key <> '302')) and (key <> '311')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 166 Data size: 1763 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_join3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join3.q.out b/ql/src/test/results/clientpositive/ppd_join3.q.out
index 64744aa..0000db1 100644
--- a/ql/src/test/results/clientpositive/ppd_join3.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join3.q.out
@@ -39,39 +39,33 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) and key is not null) (type: boolean)
+              predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -88,15 +82,12 @@ STAGE PLANS:
               expressions: _col0 (type: string), _col2 (type: string)
               outputColumnNames: _col0, _col2
               Statistics: Num rows: 60 Data size: 642 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                predicate: _col0 is not null (type: boolean)
-                Statistics: Num rows: 60 Data size: 642 Basic stats: COMPLETE 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
+              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-1
     Map Reduce
@@ -105,20 +96,17 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
           TableScan
             Reduce Output Operator
               key expressions: _col0 (type: string)
@@ -1791,7 +1779,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) and key is not null) (type: boolean)
+              predicate: ((((((((key <> '11') and (key > '0')) and ((value <> 'val_500') or (key > '1'))) and (key < '400')) and (key <> '12')) and (key <> '4')) and (key <> '13')) and (key <> '1')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -1806,7 +1794,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) and key is not null) (type: boolean)
+              predicate: (((((key <> '12') and (key <> '4')) and (key <> '11')) and (key > '0')) and (key < '400')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -1848,7 +1836,7 @@ STAGE PLANS:
             alias: src
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) and key is not null) (type: boolean)
+              predicate: (((((((key <> '13') and (key <> '1')) and (key <> '11')) and (key > '0')) and (key < '400')) and (key <> '12')) and (key <> '4')) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_join5.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join5.q.out b/ql/src/test/results/clientpositive/ppd_join5.q.out
index 02ea658..b68229e 100644
--- a/ql/src/test/results/clientpositive/ppd_join5.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join5.q.out
@@ -32,7 +32,7 @@ POSTHOOK: Lineage: t1.id1 SIMPLE []
 POSTHOOK: Lineage: t1.id2 SIMPLE []
 POSTHOOK: Lineage: t2.d SIMPLE []
 POSTHOOK: Lineage: t2.id SIMPLE []
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain
 select a.*,b.d d1,c.d d2 from
   t1 a join t2 b on (a.id1 = b.id)
@@ -148,7 +148,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain
 select * from (
 select a.*,b.d d1,c.d d2 from
@@ -271,7 +271,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[17][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[15][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: select * from (
 select a.*,b.d d1,c.d d2 from
   t1 a join t2 b on (a.id1 = b.id)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_join_filter.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_join_filter.q.out b/ql/src/test/results/clientpositive/ppd_join_filter.q.out
index f5662c7..e3b19d4 100644
--- a/ql/src/test/results/clientpositive/ppd_join_filter.q.out
+++ b/ql/src/test/results/clientpositive/ppd_join_filter.q.out
@@ -215,27 +215,23 @@ STAGE PLANS:
               expressions: _col0 (type: string), (UDFToDouble(_col1) + 2.0) (type: double), (UDFToDouble(_col1) + 3.0) (type: double)
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                isSamplingPred: false
-                predicate: _col0 is not null (type: boolean)
-                Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                File Output Operator
-                  compressed: false
-                  GlobalTableId: 0
-#### A masked pattern was here ####
-                  NumFilesPerFileSink: 1
-                  table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      properties:
-                        columns _col0,_col1,_col2
-                        columns.types string,double,double
-                        escape.delim \
-                        serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  TotalFiles: 1
-                  GatherStats: false
-                  MultiFileSpray: false
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+#### A masked pattern was here ####
+                NumFilesPerFileSink: 1
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                    properties:
+                      columns _col0,_col1,_col2
+                      columns.types string,double,double
+                      escape.delim \
+                      serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                    serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                TotalFiles: 1
+                GatherStats: false
+                MultiFileSpray: false
 
   Stage: Stage-1
     Map Reduce
@@ -252,17 +248,13 @@ STAGE PLANS:
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  isSamplingPred: false
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                    tag: 0
-                    auto parallelism: false
+                  tag: 0
+                  auto parallelism: false
           TableScan
             GatherStats: false
             Reduce Output Operator
@@ -1051,27 +1043,23 @@ STAGE PLANS:
               expressions: _col0 (type: string), (UDFToDouble(_col1) + 2.0) (type: double), (UDFToDouble(_col1) + 3.0) (type: double)
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-              Filter Operator
-                isSamplingPred: false
-                predicate: _col0 is not null (type: boolean)
-                Statistics: Num rows: 83 Data size: 881 Basic stats: COMPLETE Column stats: NONE
-                File Output Operator
-                  compressed: false
-                  GlobalTableId: 0
-#### A masked pattern was here ####
-                  NumFilesPerFileSink: 1
-                  table:
-                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                      properties:
-                        columns _col0,_col1,_col2
-                        columns.types string,double,double
-                        escape.delim \
-                        serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                      serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                  TotalFiles: 1
-                  GatherStats: false
-                  MultiFileSpray: false
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+#### A masked pattern was here ####
+                NumFilesPerFileSink: 1
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                    properties:
+                      columns _col0,_col1,_col2
+                      columns.types string,double,double
+                      escape.delim \
+                      serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                    serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                TotalFiles: 1
+                GatherStats: false
+                MultiFileSpray: false
 
   Stage: Stage-1
     Map Reduce
@@ -1088,17 +1076,13 @@ STAGE PLANS:
                 expressions: key (type: string)
                 outputColumnNames: _col0
                 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  isSamplingPred: false
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                    tag: 0
-                    auto parallelism: false
+                  tag: 0
+                  auto parallelism: false
           TableScan
             GatherStats: false
             Reduce Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_outer_join2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_outer_join2.q.out b/ql/src/test/results/clientpositive/ppd_outer_join2.q.out
index c7ade80..82e4ef5 100644
--- a/ql/src/test/results/clientpositive/ppd_outer_join2.q.out
+++ b/ql/src/test/results/clientpositive/ppd_outer_join2.q.out
@@ -32,40 +32,34 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+              predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -265,7 +259,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+              predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -281,7 +275,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/ppd_outer_join3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_outer_join3.q.out b/ql/src/test/results/clientpositive/ppd_outer_join3.q.out
index 5de6823..de82fe0 100644
--- a/ql/src/test/results/clientpositive/ppd_outer_join3.q.out
+++ b/ql/src/test/results/clientpositive/ppd_outer_join3.q.out
@@ -32,40 +32,34 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+              predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
           TableScan
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
                 outputColumnNames: _col0, _col1
                 Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: string)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: string)
                   Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: string)
-                    Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col1 (type: string)
+                  value expressions: _col1 (type: string)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -265,7 +259,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) and key is not null) (type: boolean)
+              predicate: ((((key > '10') and (key < '20')) and (key > '15')) and (key < '25')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -281,7 +275,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) and key is not null) (type: boolean)
+              predicate: ((((key > '15') and (key < '25')) and (key > '10')) and (key < '20')) (type: boolean)
               Statistics: Num rows: 6 Data size: 63 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)


[14/15] hive git commit: HIVE-11865: Disable Hive PPD optimizer when CBO has optimized the plan (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Posted by jc...@apache.org.
http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_smb_mapjoin_14.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_smb_mapjoin_14.q.out b/ql/src/test/results/clientpositive/auto_smb_mapjoin_14.q.out
index 096f5d4..75940c6 100644
--- a/ql/src/test/results/clientpositive/auto_smb_mapjoin_14.q.out
+++ b/ql/src/test/results/clientpositive/auto_smb_mapjoin_14.q.out
@@ -581,7 +581,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -701,7 +701,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -904,14 +904,11 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: int)
-                    Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
           TableScan
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
@@ -922,14 +919,11 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
                   Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Map-reduce partition columns: _col0 (type: int)
-                    Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -1217,7 +1211,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_sortmerge_join_12.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_12.q.out b/ql/src/test/results/clientpositive/auto_sortmerge_join_12.q.out
index 30853c4..69ae0bf 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_12.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_12.q.out
@@ -138,7 +138,7 @@ POSTHOOK: query: load data local inpath '../../data/files/smallsrcsortbucket3out
 POSTHOOK: type: LOAD
 #### A masked pattern was here ####
 POSTHOOK: Output: default@bucket_medium@ds=2008-04-08
-Warning: Map Join MAPJOIN[36][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[32][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 POSTHOOK: query: explain extended select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
@@ -697,7 +697,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[36][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[32][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: select count(*) FROM bucket_small a JOIN bucket_medium b ON a.key = b.key JOIN bucket_big c ON c.key = b.key JOIN bucket_medium d ON c.key = b.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@bucket_big

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_sortmerge_join_6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_6.q.out b/ql/src/test/results/clientpositive/auto_sortmerge_join_6.q.out
index 3e8dbcf..cb87f76 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_6.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_6.q.out
@@ -430,7 +430,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -451,7 +451,7 @@ STAGE PLANS:
             alias: c
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -821,7 +821,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -842,7 +842,7 @@ STAGE PLANS:
             alias: c
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out b/ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out
index e6c2832..1123d34 100644
--- a/ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out
+++ b/ql/src/test/results/clientpositive/auto_sortmerge_join_9.q.out
@@ -757,7 +757,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -877,7 +877,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -1085,13 +1085,10 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
-                  Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                  HashTable Sink Operator
-                    keys:
-                      0 _col0 (type: int)
-                      1 _col0 (type: int)
+                HashTable Sink Operator
+                  keys:
+                    0 _col0 (type: int)
+                    1 _col0 (type: int)
 
   Stage: Stage-2
     Map Reduce
@@ -1106,25 +1103,22 @@ STAGE PLANS:
                 expressions: (key + 1) (type: int)
                 outputColumnNames: _col0
                 Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                Filter Operator
-                  predicate: _col0 is not null (type: boolean)
-                  Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
-                  Map Join Operator
-                    condition map:
-                         Inner Join 0 to 1
-                    keys:
-                      0 _col0 (type: int)
-                      1 _col0 (type: int)
-                    Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
-                    Group By Operator
-                      aggregations: count()
-                      mode: hash
-                      outputColumnNames: _col0
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col0 (type: int)
+                    1 _col0 (type: int)
+                  Statistics: Num rows: 11 Data size: 77 Basic stats: COMPLETE Column stats: NONE
+                  Group By Operator
+                    aggregations: count()
+                    mode: hash
+                    outputColumnNames: _col0
+                    Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      sort order: 
                       Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        sort order: 
-                        Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: NONE
-                        value expressions: _col0 (type: bigint)
+                      value expressions: _col0 (type: bigint)
       Local Work:
         Map Reduce Local Work
       Reduce Operator Tree:
@@ -1468,7 +1462,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3112,7 +3106,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3130,7 +3124,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3175,7 +3169,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3193,7 +3187,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3233,7 +3227,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3366,7 +3360,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3384,7 +3378,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3429,7 +3423,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3447,7 +3441,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -3487,7 +3481,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -4635,7 +4629,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -4653,7 +4647,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -4698,7 +4692,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -4716,7 +4710,7 @@ STAGE PLANS:
             alias: b
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)
@@ -4756,7 +4750,7 @@ STAGE PLANS:
             alias: a
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and (key < 6)) and key is not null) (type: boolean)
+              predicate: ((key < 8) and (key < 6)) (type: boolean)
               Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/bucketsortoptimize_insert_7.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/bucketsortoptimize_insert_7.q.out b/ql/src/test/results/clientpositive/bucketsortoptimize_insert_7.q.out
index 326e4d6..fa73acf 100644
--- a/ql/src/test/results/clientpositive/bucketsortoptimize_insert_7.q.out
+++ b/ql/src/test/results/clientpositive/bucketsortoptimize_insert_7.q.out
@@ -359,7 +359,7 @@ STAGE PLANS:
             alias: test_table1
             Statistics: Num rows: 10 Data size: 70 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((key < 8) and ((key = 0) or (key = 5))) and key is not null) (type: boolean)
+              predicate: ((key < 8) and ((key = 0) or (key = 5))) (type: boolean)
               Statistics: Num rows: 2 Data size: 14 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cbo_rp_cross_product_check_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_cross_product_check_2.q.out b/ql/src/test/results/clientpositive/cbo_rp_cross_product_check_2.q.out
index 62b611b..13d8a50 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_cross_product_check_2.q.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_cross_product_check_2.q.out
@@ -327,8 +327,8 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[23][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
-Warning: Map Join MAPJOIN[24][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[22][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[23][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cbo_rp_join0.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_join0.q.out b/ql/src/test/results/clientpositive/cbo_rp_join0.q.out
index 3c6bb73..64bc50d 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_join0.q.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_join0.q.out
@@ -714,19 +714,16 @@ STAGE PLANS:
           TableScan
             alias: cbo_t4:cbo_t1
             Statistics: Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
-            Filter Operator
-              predicate: key is not null (type: boolean)
-              Statistics: Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-              Select Operator
-                expressions: key (type: string), c_int (type: int)
-                outputColumnNames: key, c_int
-                Statistics: Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: key (type: string)
-                  sort order: +
-                  Map-reduce partition columns: key (type: string)
-                  Statistics: Num rows: 18 Data size: 1424 Basic stats: COMPLETE Column stats: COMPLETE
-                  value expressions: c_int (type: int)
+            Select Operator
+              expressions: key (type: string), c_int (type: int)
+              outputColumnNames: key, c_int
+              Statistics: Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
+              Reduce Output Operator
+                key expressions: key (type: string)
+                sort order: +
+                Map-reduce partition columns: key (type: string)
+                Statistics: Num rows: 20 Data size: 1602 Basic stats: COMPLETE Column stats: COMPLETE
+                value expressions: c_int (type: int)
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -739,14 +736,14 @@ STAGE PLANS:
             2 key (type: string)
             3 key (type: string)
           outputColumnNames: key, c_int, key0, c_int0, key1, c_int2
-          Statistics: Num rows: 1458 Data size: 389286 Basic stats: COMPLETE Column stats: COMPLETE
+          Statistics: Num rows: 1620 Data size: 432540 Basic stats: COMPLETE Column stats: COMPLETE
           Select Operator
             expressions: key (type: string), c_int (type: int), key0 (type: string), c_int0 (type: int), key1 (type: string), c_int2 (type: int)
             outputColumnNames: key, c_int, p, q, x, b
-            Statistics: Num rows: 1458 Data size: 389286 Basic stats: COMPLETE Column stats: COMPLETE
+            Statistics: Num rows: 1620 Data size: 432540 Basic stats: COMPLETE Column stats: COMPLETE
             File Output Operator
               compressed: false
-              Statistics: Num rows: 1458 Data size: 389286 Basic stats: COMPLETE Column stats: COMPLETE
+              Statistics: Num rows: 1620 Data size: 432540 Basic stats: COMPLETE Column stats: COMPLETE
               table:
                   input format: org.apache.hadoop.mapred.TextInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_join1.q.out b/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
index e770028..da286e9 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_join1.q.out
@@ -31,12 +31,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (key = 40) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (_col0 = 40) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 
@@ -45,12 +45,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (key = 40) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (_col0 = 40) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 
@@ -136,12 +136,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: ((key = 40) and (value = 40)) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), 40 (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: ((_col1 = 40) and (_col0 = 40)) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 
@@ -150,12 +150,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (key = 40) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (_col0 = 40) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 
@@ -240,12 +240,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (key = 40) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (_col0 = 40) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int)
@@ -256,12 +256,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (key = 40) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: 40 (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (_col0 = 40) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   key expressions: _col0 (type: int)
@@ -348,12 +348,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (((key > 40) and (value > 50)) and (key = value)) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: key (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (((_col0 = _col1) and (_col1 > 50)) and (_col0 > 40)) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 
@@ -362,12 +362,12 @@ STAGE PLANS:
           TableScan
             alias: a
             Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
-            Filter Operator
-              predicate: (((key > 40) and (value > 50)) and (key = value)) (type: boolean)
-              Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
-              Select Operator
-                expressions: key (type: int), value (type: int)
-                outputColumnNames: _col0, _col1
+            Select Operator
+              expressions: key (type: int), value (type: int)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 2 Data size: 22 Basic stats: COMPLETE Column stats: NONE
+              Filter Operator
+                predicate: (((_col0 = _col1) and (_col1 > 50)) and (_col0 > 40)) (type: boolean)
                 Statistics: Num rows: 1 Data size: 11 Basic stats: COMPLETE Column stats: NONE
                 Reduce Output Operator
                   sort order: 

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cbo_rp_lineage2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_lineage2.q.out b/ql/src/test/results/clientpositive/cbo_rp_lineage2.q.out
index b14caa8..79f76bf 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_lineage2.q.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_lineage2.q.out
@@ -10,7 +10,7 @@ PREHOOK: query: select * from src1 where key is not null and value is not null l
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
-{"version":"1.0","engine":"mr","database":"default","hash":"b5b224847b2333e790a2c229434a04c8","queryText":"select * from src1 where key is not null and value is not null limit 3","edges":[],"vertices":[]}
+{"version":"1.0","engine":"mr","database":"default","hash":"b5b224847b2333e790a2c229434a04c8","queryText":"select * from src1 where key is not null and value is not null limit 3","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2,3],"targets":[0,1],"expression":"(src1.key is not null and src1.value is not null)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
 238	val_238
 	
 311	val_311
@@ -485,7 +485,7 @@ PREHOOK: query: select * from src1 where length(key) > 2
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
-{"version":"1.0","engine":"mr","database":"default","hash":"4028c94d222d5dd221f651d414386972","queryText":"select * from src1 where length(key) > 2","edges":[],"vertices":[]}
+{"version":"1.0","engine":"mr","database":"default","hash":"4028c94d222d5dd221f651d414386972","queryText":"select * from src1 where length(key) > 2","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2],"targets":[0,1],"expression":"(length(src1.key) > 2)","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
 238	val_238
 311	val_311
 255	val_255
@@ -503,7 +503,7 @@ PREHOOK: query: select * from src1 where length(key) > 2 and value > 'a'
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
-{"version":"1.0","engine":"mr","database":"default","hash":"5727531f7743cfcd60d634d8c835515f","queryText":"select * from src1 where length(key) > 2 and value > 'a'","edges":[],"vertices":[]}
+{"version":"1.0","engine":"mr","database":"default","hash":"5727531f7743cfcd60d634d8c835515f","queryText":"select * from src1 where length(key) > 2 and value > 'a'","edges":[{"sources":[2],"targets":[0],"edgeType":"PROJECTION"},{"sources":[3],"targets":[1],"edgeType":"PROJECTION"},{"sources":[2,3],"targets":[0,1],"expression":"((length(src1.key) > 2) and (src1.value > 'a'))","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"src1.key"},{"id":1,"vertexType":"COLUMN","vertexId":"src1.value"},{"id":2,"vertexType":"COLUMN","vertexId":"default.src1.key"},{"id":3,"vertexType":"COLUMN","vertexId":"default.src1.value"}]}
 238	val_238
 311	val_311
 255	val_255
@@ -593,7 +593,7 @@ PREHOOK: Input: default@dept
 PREHOOK: Input: default@emp
 PREHOOK: Input: default@project
 PREHOOK: Output: default@tgt
-{"version":"1.0","engine":"mr","database":"default","hash":"f59797e0422d2e51515063374dfac361","queryText":"INSERT INTO TABLE tgt\nSELECT emd.dept_name, emd.name, emd.emp_id, emd.mgr_id, p.project_id, p.project_name\nFROM (\n  SELECT d.dept_name, em.name, em.emp_id, em.mgr_id, em.dept_id\n  FROM (\n    SELECT e.name, e.dept_id, e.emp_id emp_id, m.emp_id mgr_id\n    FROM emp e JOIN emp m ON e.emp_id = m.emp_id\n    ) em\n  JOIN dept d ON d.dept_id = em.dept_id\n  ) emd JOIN project p ON emd.dept_id = p.project_id","edges":[{"sources":[6],"targets":[0],"edgeType":"PROJECTION"},{"sources":[7],"targets":[1],"edgeType":"PROJECTION"},{"sources":[8],"targets":[2,3],"edgeType":"PROJECTION"},{"sources":[9],"targets":[4],"edgeType":"PROJECTION"},{"sources":[10],"targets":[5],"edgeType":"PROJECTION"},{"sources":[8,11],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.emp_id is not null and emd:em:e.dept_id is not null)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"
 (emd:em:e.emp_id = emd:em:m.emp_id)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"emd:em:m.emp_id is not null","edgeType":"PREDICATE"},{"sources":[11,12,9],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.dept_id = emd:d.dept_id AND emd:em:e.dept_id = p.project_id)","edgeType":"PREDICATE"},{"sources":[12],"targets":[0,1,2,3,4,5],"expression":"emd:d.dept_id is not null","edgeType":"PREDICATE"},{"sources":[9],"targets":[0,1,2,3,4,5],"expression":"p.project_id is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.tgt.dept_name"},{"id":1,"vertexType":"COLUMN","vertexId":"default.tgt.name"},{"id":2,"vertexType":"COLUMN","vertexId":"default.tgt.emp_id"},{"id":3,"vertexType":"COLUMN","vertexId":"default.tgt.mgr_id"},{"id":4,"vertexType":"COLUMN","vertexId":"default.tgt.proj_id"},{"id":5,"vertexType":"COLUMN","vertexId":"default.tgt.proj_name"},{"id":6,"vertexType":"COLUMN","vertexId":"default.dept.dept_name"},{"id
 ":7,"vertexType":"COLUMN","vertexId":"default.emp.name"},{"id":8,"vertexType":"COLUMN","vertexId":"default.emp.emp_id"},{"id":9,"vertexType":"COLUMN","vertexId":"default.project.project_id"},{"id":10,"vertexType":"COLUMN","vertexId":"default.project.project_name"},{"id":11,"vertexType":"COLUMN","vertexId":"default.emp.dept_id"},{"id":12,"vertexType":"COLUMN","vertexId":"default.dept.dept_id"}]}
+{"version":"1.0","engine":"mr","database":"default","hash":"f59797e0422d2e51515063374dfac361","queryText":"INSERT INTO TABLE tgt\nSELECT emd.dept_name, emd.name, emd.emp_id, emd.mgr_id, p.project_id, p.project_name\nFROM (\n  SELECT d.dept_name, em.name, em.emp_id, em.mgr_id, em.dept_id\n  FROM (\n    SELECT e.name, e.dept_id, e.emp_id emp_id, m.emp_id mgr_id\n    FROM emp e JOIN emp m ON e.emp_id = m.emp_id\n    ) em\n  JOIN dept d ON d.dept_id = em.dept_id\n  ) emd JOIN project p ON emd.dept_id = p.project_id","edges":[{"sources":[6],"targets":[0],"edgeType":"PROJECTION"},{"sources":[7],"targets":[1],"edgeType":"PROJECTION"},{"sources":[8],"targets":[2,3],"edgeType":"PROJECTION"},{"sources":[9],"targets":[4],"edgeType":"PROJECTION"},{"sources":[10],"targets":[5],"edgeType":"PROJECTION"},{"sources":[8,11],"targets":[0,1,2,3,4,5],"expression":"(e.emp_id is not null and e.dept_id is not null)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.emp_
 id = emd:em:m.emp_id)","edgeType":"PREDICATE"},{"sources":[8],"targets":[0,1,2,3,4,5],"expression":"m.emp_id is not null","edgeType":"PREDICATE"},{"sources":[11,12,9],"targets":[0,1,2,3,4,5],"expression":"(emd:em:e.dept_id = emd:d.dept_id AND emd:em:e.dept_id = p.project_id)","edgeType":"PREDICATE"},{"sources":[12],"targets":[0,1,2,3,4,5],"expression":"d.dept_id is not null","edgeType":"PREDICATE"},{"sources":[9],"targets":[0,1,2,3,4,5],"expression":"p.project_id is not null","edgeType":"PREDICATE"}],"vertices":[{"id":0,"vertexType":"COLUMN","vertexId":"default.tgt.dept_name"},{"id":1,"vertexType":"COLUMN","vertexId":"default.tgt.name"},{"id":2,"vertexType":"COLUMN","vertexId":"default.tgt.emp_id"},{"id":3,"vertexType":"COLUMN","vertexId":"default.tgt.mgr_id"},{"id":4,"vertexType":"COLUMN","vertexId":"default.tgt.proj_id"},{"id":5,"vertexType":"COLUMN","vertexId":"default.tgt.proj_name"},{"id":6,"vertexType":"COLUMN","vertexId":"default.dept.dept_name"},{"id":7,"vertexType":"COLUMN"
 ,"vertexId":"default.emp.name"},{"id":8,"vertexType":"COLUMN","vertexId":"default.emp.emp_id"},{"id":9,"vertexType":"COLUMN","vertexId":"default.project.project_id"},{"id":10,"vertexType":"COLUMN","vertexId":"default.project.project_name"},{"id":11,"vertexType":"COLUMN","vertexId":"default.emp.dept_id"},{"id":12,"vertexType":"COLUMN","vertexId":"default.dept.dept_id"}]}
 PREHOOK: query: drop table if exists dest_l2
 PREHOOK: type: DROPTABLE
 PREHOOK: query: create table dest_l2 (id int, c1 tinyint, c2 int, c3 bigint) stored as textfile

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cbo_rp_outer_join_ppr.q.java1.7.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cbo_rp_outer_join_ppr.q.java1.7.out b/ql/src/test/results/clientpositive/cbo_rp_outer_join_ppr.q.java1.7.out
index 2630537..6be2546 100644
--- a/ql/src/test/results/clientpositive/cbo_rp_outer_join_ppr.q.java1.7.out
+++ b/ql/src/test/results/clientpositive/cbo_rp_outer_join_ppr.q.java1.7.out
@@ -398,13 +398,13 @@ STAGE PLANS:
             1 key (type: string)
           outputColumnNames: key, value, key0, value0
           Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            isSamplingPred: false
-            predicate: ((((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) and (UDFToDouble(key0) > 15.0)) and (UDFToDouble(key0) < 25.0)) (type: boolean)
-            Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: key (type: string), value (type: string), key0 (type: string), value0 (type: string)
-              outputColumnNames: key, value, key0, value0
+          Select Operator
+            expressions: key (type: string), value (type: string), key0 (type: string), value0 (type: string)
+            outputColumnNames: key, value, key0, value0
+            Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              isSamplingPred: false
+              predicate: ((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0) and (UDFToDouble(key0) > 15.0) and (UDFToDouble(key0) < 25.0)) (type: boolean)
               Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
               File Output Operator
                 compressed: false
@@ -780,13 +780,13 @@ STAGE PLANS:
             1 key (type: string)
           outputColumnNames: key, value, key0, value0
           Statistics: Num rows: 122 Data size: 1296 Basic stats: COMPLETE Column stats: NONE
-          Filter Operator
-            isSamplingPred: false
-            predicate: ((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) (type: boolean)
-            Statistics: Num rows: 13 Data size: 138 Basic stats: COMPLETE Column stats: NONE
-            Select Operator
-              expressions: key (type: string), value (type: string), key0 (type: string), value0 (type: string)
-              outputColumnNames: key, value, key0, value0
+          Select Operator
+            expressions: key (type: string), value (type: string), key0 (type: string), value0 (type: string)
+            outputColumnNames: key, value, key0, value0
+            Statistics: Num rows: 122 Data size: 1296 Basic stats: COMPLETE Column stats: NONE
+            Filter Operator
+              isSamplingPred: false
+              predicate: ((UDFToDouble(key) > 10.0) and (UDFToDouble(key) < 20.0)) (type: boolean)
               Statistics: Num rows: 13 Data size: 138 Basic stats: COMPLETE Column stats: NONE
               File Output Operator
                 compressed: false

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/correlationoptimizer10.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/correlationoptimizer10.q.out b/ql/src/test/results/clientpositive/correlationoptimizer10.q.out
index 860452e..6bac698 100644
--- a/ql/src/test/results/clientpositive/correlationoptimizer10.q.out
+++ b/ql/src/test/results/clientpositive/correlationoptimizer10.q.out
@@ -420,7 +420,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -435,7 +435,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 20.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 20.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -474,7 +474,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) (type: boolean)
               Statistics: Num rows: 2 Data size: 15 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -581,7 +581,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) (type: boolean)
               Statistics: Num rows: 2 Data size: 15 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -597,7 +597,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) < 200.0) and (UDFToDouble(key) > 20.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -612,7 +612,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 20.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 20.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -748,7 +748,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -763,7 +763,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -802,7 +802,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -921,7 +921,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -937,7 +937,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)
@@ -952,7 +952,7 @@ STAGE PLANS:
             alias: xx
             Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) and key is not null) (type: boolean)
+              predicate: ((UDFToDouble(key) > 180.0) and (UDFToDouble(key) < 200.0)) (type: boolean)
               Statistics: Num rows: 55 Data size: 584 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/correlationoptimizer13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/correlationoptimizer13.q.out b/ql/src/test/results/clientpositive/correlationoptimizer13.q.out
index 82304d8..61b7bcb 100644
--- a/ql/src/test/results/clientpositive/correlationoptimizer13.q.out
+++ b/ql/src/test/results/clientpositive/correlationoptimizer13.q.out
@@ -61,7 +61,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c1 < 120) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: ((c1 < 120) and c3 is not null) (type: boolean)
               Statistics: Num rows: 342 Data size: 7639 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c3 (type: string), c1 (type: int)
@@ -162,7 +162,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((c2 > 100) and (c1 < 120)) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: (((c2 > 100) and (c1 < 120)) and c3 is not null) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c3 (type: string), c1 (type: int)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/correlationoptimizer9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/correlationoptimizer9.q.out b/ql/src/test/results/clientpositive/correlationoptimizer9.q.out
index d32003d..104a97a 100644
--- a/ql/src/test/results/clientpositive/correlationoptimizer9.q.out
+++ b/ql/src/test/results/clientpositive/correlationoptimizer9.q.out
@@ -54,7 +54,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c1 < 120) and (c1 > 100)) and c1 is not null) (type: boolean)
+              predicate: ((c1 < 120) and (c1 > 100)) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int)
@@ -131,7 +131,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c2 > 100) and (c2 < 120)) and c2 is not null) (type: boolean)
+              predicate: ((c2 > 100) and (c2 < 120)) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c2 (type: int)
@@ -226,7 +226,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c1 < 120) and (c1 > 100)) and c1 is not null) (type: boolean)
+              predicate: ((c1 < 120) and (c1 > 100)) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int)
@@ -248,7 +248,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c2 > 100) and (c2 < 120)) and c2 is not null) (type: boolean)
+              predicate: ((c2 > 100) and (c2 < 120)) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c2 (type: int)
@@ -387,7 +387,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c1 < 120) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: ((c1 < 120) and c3 is not null) (type: boolean)
               Statistics: Num rows: 342 Data size: 7639 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c3 (type: string)
@@ -464,7 +464,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((c2 > 100) and (c1 < 120)) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: (((c2 > 100) and (c1 < 120)) and c3 is not null) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c3 (type: string)
@@ -557,7 +557,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (((c1 < 120) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: ((c1 < 120) and c3 is not null) (type: boolean)
               Statistics: Num rows: 342 Data size: 7639 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c3 (type: string)
@@ -579,7 +579,7 @@ STAGE PLANS:
             alias: x
             Statistics: Num rows: 1028 Data size: 22964 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: ((((c2 > 100) and (c1 < 120)) and c3 is not null) and c1 is not null) (type: boolean)
+              predicate: (((c2 > 100) and (c1 < 120)) and c3 is not null) (type: boolean)
               Statistics: Num rows: 114 Data size: 2546 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: c1 (type: int), c3 (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cross_join.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cross_join.q.out b/ql/src/test/results/clientpositive/cross_join.q.out
index f36496e..0438336 100644
--- a/ql/src/test/results/clientpositive/cross_join.q.out
+++ b/ql/src/test/results/clientpositive/cross_join.q.out
@@ -179,7 +179,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain select src.key from src join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src join src src2
@@ -242,7 +242,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain select src.key from src cross join src src2
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select src.key from src cross join src src2

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cross_product_check_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cross_product_check_1.q.out b/ql/src/test/results/clientpositive/cross_product_check_1.q.out
index e7d6900..d9143c8 100644
--- a/ql/src/test/results/clientpositive/cross_product_check_1.q.out
+++ b/ql/src/test/results/clientpositive/cross_product_check_1.q.out
@@ -86,7 +86,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[16][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[14][tables = [$hdt$_0, $hdt$_1, $hdt$_2]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -190,7 +190,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[21][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[19][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-1:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key
@@ -446,7 +446,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Shuffle Join JOIN[25][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[23][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A  group by key) ss join
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/cross_product_check_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/cross_product_check_2.q.out b/ql/src/test/results/clientpositive/cross_product_check_2.q.out
index df438c9..4e2b93e 100644
--- a/ql/src/test/results/clientpositive/cross_product_check_2.q.out
+++ b/ql/src/test/results/clientpositive/cross_product_check_2.q.out
@@ -28,7 +28,7 @@ POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default
 POSTHOOK: Output: default@B
-Warning: Map Join MAPJOIN[11][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[10][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join B
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join B
@@ -93,7 +93,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[24][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[21][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
 PREHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from B d1 join B d2 on d1.key = d2.key join A
@@ -187,7 +187,7 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[31][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[28][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join 
          (select d1.key 
           from B d1 join B d2 on d1.key = d2.key 
@@ -323,8 +323,8 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[28][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
-Warning: Map Join MAPJOIN[29][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[26][bigTable=?] in task 'Stage-5:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[27][bigTable=?] in task 'Stage-3:MAPRED' is a cross product
 PREHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
 PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from A join (select d1.key from B d1 join B d2 where 1 = 1 group by d1.key) od1
@@ -446,9 +446,9 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-Warning: Map Join MAPJOIN[50][bigTable=?] in task 'Stage-7:MAPRED' is a cross product
-Warning: Map Join MAPJOIN[43][bigTable=?] in task 'Stage-6:MAPRED' is a cross product
-Warning: Shuffle Join JOIN[25][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[47][bigTable=?] in task 'Stage-7:MAPRED' is a cross product
+Warning: Map Join MAPJOIN[40][bigTable=?] in task 'Stage-6:MAPRED' is a cross product
+Warning: Shuffle Join JOIN[23][tables = [$hdt$_0, $hdt$_1]] in Stage 'Stage-2:MAPRED' is a cross product
 PREHOOK: query: explain select * from 
 (select A.key from A group by key) ss join 
 (select d1.key from B d1 join B d2 on d1.key = d2.key where 1 = 1 group by d1.key) od1

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/dynamic_rdd_cache.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/dynamic_rdd_cache.q.out b/ql/src/test/results/clientpositive/dynamic_rdd_cache.q.out
index b85d387..3153c7e 100644
--- a/ql/src/test/results/clientpositive/dynamic_rdd_cache.q.out
+++ b/ql/src/test/results/clientpositive/dynamic_rdd_cache.q.out
@@ -1080,14 +1080,14 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
-            outputColumnNames: _col0, _col1, _col3, _col4, _col5
+            expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
+            outputColumnNames: _col1, _col2, _col3, _col4, _col5
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
               predicate: (CASE (_col5) WHEN (0) THEN (0) ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
-                expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
+                expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
                 outputColumnNames: _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 File Output Operator
@@ -1317,14 +1317,14 @@ STAGE PLANS:
           outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
           Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
           Select Operator
-            expressions: _col0 (type: int), _col1 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
-            outputColumnNames: _col0, _col1, _col3, _col4, _col5
+            expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col4 (type: double), _col5 (type: double)
+            outputColumnNames: _col1, _col2, _col3, _col4, _col5
             Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
             Filter Operator
               predicate: (CASE (_col5) WHEN (0) THEN (0) ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
               Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
               Select Operator
-                expressions: _col1 (type: int), _col0 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
+                expressions: _col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 (type: double), CASE (_col5) WHEN (0) THEN (null) ELSE ((_col4 / _col5)) END (type: double)
                 outputColumnNames: _col1, _col2, _col3, _col4, _col5
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 File Output Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/encrypted/encryption_join_unencrypted_tbl.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/encrypted/encryption_join_unencrypted_tbl.q.out b/ql/src/test/results/clientpositive/encrypted/encryption_join_unencrypted_tbl.q.out
index 8903860..36a7503 100644
--- a/ql/src/test/results/clientpositive/encrypted/encryption_join_unencrypted_tbl.q.out
+++ b/ql/src/test/results/clientpositive/encrypted/encryption_join_unencrypted_tbl.q.out
@@ -586,7 +586,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), value (type: string)
@@ -606,7 +606,7 @@ STAGE PLANS:
             GatherStats: false
             Filter Operator
               isSamplingPred: false
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: int), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/explain_logical.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/explain_logical.q.out b/ql/src/test/results/clientpositive/explain_logical.q.out
index d302918..8124b7a 100644
--- a/ql/src/test/results/clientpositive/explain_logical.q.out
+++ b/ql/src/test/results/clientpositive/explain_logical.q.out
@@ -361,19 +361,19 @@ $hdt$_0:s1
   TableScan (TS_0)
     alias: s1
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_13)
+    Filter Operator (FIL_11)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_2)
         expressions: key (type: string)
         outputColumnNames: _col0
         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_7)
+        Reduce Output Operator (RS_6)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-          Join Operator (JOIN_10)
+          Join Operator (JOIN_8)
             condition map:
                  Inner Join 0 to 1
             keys:
@@ -381,11 +381,11 @@ $hdt$_0:s1
               1 _col0 (type: string)
             outputColumnNames: _col0, _col2
             Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-            Select Operator (SEL_11)
+            Select Operator (SEL_9)
               expressions: _col0 (type: string), _col2 (type: string)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator (FS_12)
+              File Output Operator (FS_10)
                 compressed: false
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 table:
@@ -396,20 +396,20 @@ $hdt$_1:s2
   TableScan (TS_3)
     alias: s2
     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_14)
+    Filter Operator (FIL_12)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_5)
         expressions: key (type: string), value (type: string)
         outputColumnNames: _col0, _col1
         Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_9)
+        Reduce Output Operator (RS_7)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
           value expressions: _col1 (type: string)
-          Join Operator (JOIN_10)
+          Join Operator (JOIN_8)
             condition map:
                  Inner Join 0 to 1
             keys:
@@ -507,19 +507,19 @@ $hdt$_0:srcpart
   TableScan (TS_0)
     alias: srcpart
     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_13)
+    Filter Operator (FIL_11)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_2)
         expressions: key (type: string)
         outputColumnNames: _col0
         Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_7)
+        Reduce Output Operator (RS_6)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-          Join Operator (JOIN_10)
+          Join Operator (JOIN_8)
             condition map:
                  Inner Join 0 to 1
             keys:
@@ -527,11 +527,11 @@ $hdt$_0:srcpart
               1 _col0 (type: string)
             outputColumnNames: _col0, _col2
             Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-            Select Operator (SEL_11)
+            Select Operator (SEL_9)
               expressions: _col0 (type: string), _col2 (type: string)
               outputColumnNames: _col0, _col1
               Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator (FS_12)
+              File Output Operator (FS_10)
                 compressed: false
                 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
                 table:
@@ -542,20 +542,20 @@ $hdt$_1:src2
   TableScan (TS_3)
     alias: src2
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_14)
+    Filter Operator (FIL_12)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_5)
         expressions: key (type: string), value (type: string)
         outputColumnNames: _col0, _col1
         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_9)
+        Reduce Output Operator (RS_7)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
           value expressions: _col1 (type: string)
-          Join Operator (JOIN_10)
+          Join Operator (JOIN_8)
             condition map:
                  Inner Join 0 to 1
             keys:
@@ -589,20 +589,20 @@ $hdt$_0:srcpart
   TableScan (TS_0)
     alias: srcpart
     Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_18)
+    Filter Operator (FIL_15)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_2)
         expressions: key (type: string), value (type: string)
         outputColumnNames: _col0, _col1
         Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_10)
+        Reduce Output Operator (RS_9)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE
           value expressions: _col1 (type: string)
-          Join Operator (JOIN_15)
+          Join Operator (JOIN_12)
             condition map:
                  Inner Join 0 to 1
                  Inner Join 0 to 2
@@ -612,11 +612,11 @@ $hdt$_0:srcpart
               2 _col0 (type: string)
             outputColumnNames: _col1, _col2, _col4
             Statistics: Num rows: 4400 Data size: 46745 Basic stats: COMPLETE Column stats: NONE
-            Select Operator (SEL_16)
+            Select Operator (SEL_13)
               expressions: _col2 (type: string), _col1 (type: string), _col4 (type: string)
               outputColumnNames: _col0, _col1, _col2
               Statistics: Num rows: 4400 Data size: 46745 Basic stats: COMPLETE Column stats: NONE
-              File Output Operator (FS_17)
+              File Output Operator (FS_14)
                 compressed: false
                 Statistics: Num rows: 4400 Data size: 46745 Basic stats: COMPLETE Column stats: NONE
                 table:
@@ -627,19 +627,19 @@ $hdt$_1:src
   TableScan (TS_3)
     alias: src
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_19)
+    Filter Operator (FIL_16)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_5)
         expressions: key (type: string)
         outputColumnNames: _col0
         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_12)
+        Reduce Output Operator (RS_10)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-          Join Operator (JOIN_15)
+          Join Operator (JOIN_12)
             condition map:
                  Inner Join 0 to 1
                  Inner Join 0 to 2
@@ -653,20 +653,20 @@ $hdt$_2:src
   TableScan (TS_6)
     alias: src
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_20)
+    Filter Operator (FIL_17)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_8)
         expressions: key (type: string), value (type: string)
         outputColumnNames: _col0, _col1
         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_14)
+        Reduce Output Operator (RS_11)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
           value expressions: _col1 (type: string)
-          Join Operator (JOIN_15)
+          Join Operator (JOIN_12)
             condition map:
                  Inner Join 0 to 1
                  Inner Join 0 to 2
@@ -804,7 +804,7 @@ $hdt$_0:src
   TableScan (TS_0)
     alias: src
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_19)
+    Filter Operator (FIL_17)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Group By Operator (GBY_3)
@@ -825,13 +825,13 @@ $hdt$_0:src
             mode: mergepartial
             outputColumnNames: _col0, _col1
             Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
-            Reduce Output Operator (RS_11)
+            Reduce Output Operator (RS_10)
               key expressions: _col0 (type: string)
               sort order: +
               Map-reduce partition columns: _col0 (type: string)
               Statistics: Num rows: 250 Data size: 2656 Basic stats: COMPLETE Column stats: NONE
               value expressions: _col1 (type: bigint)
-              Join Operator (JOIN_14)
+              Join Operator (JOIN_12)
                 condition map:
                      Inner Join 0 to 1
                 keys:
@@ -839,20 +839,20 @@ $hdt$_0:src
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1, _col3
                 Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                Select Operator (SEL_15)
+                Select Operator (SEL_13)
                   expressions: _col0 (type: string), _col1 (type: bigint), _col3 (type: string)
                   outputColumnNames: _col0, _col1, _col2
                   Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator (RS_16)
+                  Reduce Output Operator (RS_14)
                     key expressions: _col0 (type: string)
                     sort order: +
                     Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                     value expressions: _col1 (type: bigint), _col2 (type: string)
-                    Select Operator (SEL_17)
+                    Select Operator (SEL_15)
                       expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: string)
                       outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
-                      File Output Operator (FS_18)
+                      File Output Operator (FS_16)
                         compressed: false
                         Statistics: Num rows: 550 Data size: 5843 Basic stats: COMPLETE Column stats: NONE
                         table:
@@ -863,20 +863,20 @@ $hdt$_1:src
   TableScan (TS_7)
     alias: src
     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-    Filter Operator (FIL_20)
+    Filter Operator (FIL_18)
       predicate: key is not null (type: boolean)
       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
       Select Operator (SEL_9)
         expressions: key (type: string), value (type: string)
         outputColumnNames: _col0, _col1
         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-        Reduce Output Operator (RS_13)
+        Reduce Output Operator (RS_11)
           key expressions: _col0 (type: string)
           sort order: +
           Map-reduce partition columns: _col0 (type: string)
           Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
           value expressions: _col1 (type: string)
-          Join Operator (JOIN_14)
+          Join Operator (JOIN_12)
             condition map:
                  Inner Join 0 to 1
             keys:

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/filter_cond_pushdown.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/filter_cond_pushdown.q.out b/ql/src/test/results/clientpositive/filter_cond_pushdown.q.out
index b1cfb25..5e0edbc 100644
--- a/ql/src/test/results/clientpositive/filter_cond_pushdown.q.out
+++ b/ql/src/test/results/clientpositive/filter_cond_pushdown.q.out
@@ -283,7 +283,7 @@ STAGE PLANS:
             alias: t2
             Statistics: Num rows: 20 Data size: 262 Basic stats: COMPLETE Column stats: NONE
             Filter Operator
-              predicate: (key is not null and UDFToDouble(key) is not null) (type: boolean)
+              predicate: key is not null (type: boolean)
               Statistics: Num rows: 20 Data size: 262 Basic stats: COMPLETE Column stats: NONE
               Select Operator
                 expressions: key (type: string), c_int (type: int), c_float (type: float)

http://git-wip-us.apache.org/repos/asf/hive/blob/827ff37f/ql/src/test/results/clientpositive/fouter_join_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/fouter_join_ppr.q.out b/ql/src/test/results/clientpositive/fouter_join_ppr.q.out
index 56c5176..f701122 100644
--- a/ql/src/test/results/clientpositive/fouter_join_ppr.q.out
+++ b/ql/src/test/results/clientpositive/fouter_join_ppr.q.out
@@ -398,7 +398,7 @@ STAGE PLANS:
           Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: ((((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0)) and (UDFToDouble(_col2) > 15.0)) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
+            predicate: ((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0) and (UDFToDouble(_col2) > 15.0) and (UDFToDouble(_col2) < 25.0)) (type: boolean)
             Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
             File Output Operator
               compressed: false
@@ -867,7 +867,7 @@ STAGE PLANS:
           Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE
           Filter Operator
             isSamplingPred: false
-            predicate: ((((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0)) and (UDFToDouble(_col3) > 15.0)) and (UDFToDouble(_col3) < 25.0)) (type: boolean)
+            predicate: ((UDFToDouble(_col0) > 10.0) and (UDFToDouble(_col0) < 20.0) and (UDFToDouble(_col3) > 15.0) and (UDFToDouble(_col3) < 25.0)) (type: boolean)
             Statistics: Num rows: 27 Data size: 286 Basic stats: COMPLETE Column stats: NONE
             Select Operator
               expressions: _col0 (type: string), _col1 (type: string), _col3 (type: string), _col4 (type: string)