http://git-wip-us.apache.org/repos/asf/hive/blob/bddf5a7a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out 
b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
index 21fd10c..53839a3 100644
--- a/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
+++ b/ql/src/test/results/clientpositive/llap/explainuser_1.q.out
@@ -1803,71 +1803,50 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
-Reducer 4 <- Map 3 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
-Reducer 7 <- Map 6 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 4 <- Map 3 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 2 llap
-      File Output Operator [FS_29]
-        Select Operator [SEL_28] (rows=1 width=178)
+      File Output Operator [FS_19]
+        Select Operator [SEL_18] (rows=1 width=178)
           Output:["_col0","_col1"]
-          Filter Operator [FIL_27] (rows=1 width=182)
+          Filter Operator [FIL_17] (rows=1 width=182)
             predicate:_col3 is null
-            Merge Join Operator [MERGEJOIN_37] (rows=500 width=182)
-              Conds:RS_24._col1=RS_25._col0(Left 
Outer),Output:["_col0","_col1","_col3"]
+            Merge Join Operator [MERGEJOIN_22] (rows=500 width=182)
+              Conds:RS_14._col1=RS_15._col0(Left 
Outer),Output:["_col0","_col1","_col3"]
             <-Map 1 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_24]
+              SHUFFLE [RS_14]
                 PartitionCols:_col1
                 Select Operator [SEL_1] (rows=500 width=178)
                   Output:["_col0","_col1"]
                   TableScan [TS_0] (rows=500 width=178)
                     
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-            <-Reducer 5 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_25]
+            <-Reducer 4 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_15]
                 PartitionCols:_col0
-                Select Operator [SEL_23] (rows=56 width=95)
+                Select Operator [SEL_13] (rows=36 width=95)
                   Output:["_col0","_col1"]
-                  Group By Operator [GBY_22] (rows=56 width=91)
+                  Group By Operator [GBY_12] (rows=36 width=91)
                     Output:["_col0"],keys:_col1
-                    Select Operator [SEL_18] (rows=83 width=178)
+                    Select Operator [SEL_8] (rows=41 width=178)
                       Output:["_col1"]
-                      Group By Operator [GBY_17] (rows=83 width=178)
+                      Group By Operator [GBY_7] (rows=41 width=178)
                         Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                      <-Reducer 4 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_16]
+                      <-Map 3 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_6]
                           PartitionCols:_col0
-                          Group By Operator [GBY_15] (rows=83 width=178)
-                            Output:["_col0","_col1"],keys:_col2, _col0
-                            Select Operator [SEL_14] (rows=166 width=178)
-                              Output:["_col2","_col0"]
-                              Merge Join Operator [MERGEJOIN_36] (rows=166 
width=178)
-                                
Conds:RS_11._col1=RS_12._col0(Inner),Output:["_col0","_col2"]
-                              <-Map 3 [SIMPLE_EDGE] llap
-                                SHUFFLE [RS_11]
-                                  PartitionCols:_col1
-                                  Select Operator [SEL_4] (rows=166 width=178)
-                                    Output:["_col0","_col1"]
-                                    Filter Operator [FIL_34] (rows=166 
width=178)
-                                      predicate:(value > 'val_2')
-                                      TableScan [TS_2] (rows=500 width=178)
-                                        
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                              <-Reducer 7 [SIMPLE_EDGE] llap
-                                SHUFFLE [RS_12]
-                                  PartitionCols:_col0
-                                  Group By Operator [GBY_9] (rows=214 width=91)
-                                    Output:["_col0"],keys:KEY._col0
-                                  <-Map 6 [SIMPLE_EDGE] llap
-                                    SHUFFLE [RS_8]
-                                      PartitionCols:_col0
-                                      Group By Operator [GBY_7] (rows=214 
width=91)
-                                        Output:["_col0"],keys:value
-                                        TableScan [TS_5] (rows=500 width=91)
-                                          
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
+                          Group By Operator [GBY_5] (rows=41 width=178)
+                            Output:["_col0","_col1"],keys:value, key
+                            Select Operator [SEL_4] (rows=83 width=178)
+                              Output:["value","key"]
+                              Filter Operator [FIL_21] (rows=83 width=178)
+                                predicate:((value = value) and (value > 
'val_2'))
+                                TableScan [TS_2] (rows=500 width=178)
+                                  
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
 
 PREHOOK: query: explain select * 
 from src_cbo b 
@@ -1891,25 +1870,23 @@ Plan optimized by CBO.
 
 Vertex dependency in root stage
 Reducer 2 <- Map 1 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 5 <- Map 4 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
-Reducer 8 <- Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 5 <- Map 4 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 3 llap
-      File Output Operator [FS_33]
-        Select Operator [SEL_32] (rows=1 width=178)
+      File Output Operator [FS_18]
+        Select Operator [SEL_17] (rows=1 width=178)
           Output:["_col0","_col1"]
-          Filter Operator [FIL_31] (rows=1 width=182)
+          Filter Operator [FIL_16] (rows=1 width=182)
             predicate:_col4 is null
-            Merge Join Operator [MERGEJOIN_41] (rows=250 width=182)
-              Conds:RS_28._col0, _col1=RS_29._col0, _col1(Left 
Outer),Output:["_col0","_col1","_col4"]
+            Merge Join Operator [MERGEJOIN_21] (rows=250 width=182)
+              Conds:RS_13._col0, _col1=RS_14._col0, _col1(Left 
Outer),Output:["_col0","_col1","_col4"]
             <-Reducer 2 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_28]
+              SHUFFLE [RS_13]
                 PartitionCols:_col0, _col1
                 Group By Operator [GBY_4] (rows=250 width=178)
                   Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
@@ -1922,43 +1899,22 @@ Stage-0
                         Output:["key","value"]
                         TableScan [TS_0] (rows=500 width=178)
                           
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-            <-Reducer 6 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_29]
+            <-Reducer 5 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_14]
                 PartitionCols:_col0, _col1
-                Select Operator [SEL_27] (rows=1 width=182)
+                Select Operator [SEL_12] (rows=20 width=182)
                   Output:["_col0","_col1","_col2"]
-                  Group By Operator [GBY_26] (rows=1 width=178)
+                  Group By Operator [GBY_11] (rows=20 width=178)
                     Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                  <-Reducer 5 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_25]
+                  <-Map 4 [SIMPLE_EDGE] llap
+                    SHUFFLE [RS_10]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_24] (rows=1 width=178)
-                        Output:["_col0","_col1"],keys:_col2, _col3
-                        Merge Join Operator [MERGEJOIN_40] (rows=1 width=178)
-                          Conds:RS_20._col0, _col1=RS_21._col0, 
_col1(Inner),Output:["_col2","_col3"]
-                        <-Map 4 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_20]
-                            PartitionCols:_col0, _col1
-                            Select Operator [SEL_8] (rows=166 width=178)
-                              Output:["_col0","_col1"]
-                              Filter Operator [FIL_38] (rows=166 width=178)
-                                predicate:(value > 'val_12')
-                                TableScan [TS_6] (rows=500 width=178)
-                                  
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                        <-Reducer 8 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_21]
-                            PartitionCols:_col0, _col1
-                            Group By Operator [GBY_18] (rows=250 width=178)
-                              Output:["_col0","_col1"],keys:_col0, _col1
-                              Group By Operator [GBY_13] (rows=250 width=178)
-                                Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
-                              <-Map 7 [SIMPLE_EDGE] llap
-                                SHUFFLE [RS_12]
-                                  PartitionCols:_col0, _col1
-                                  Group By Operator [GBY_11] (rows=250 
width=178)
-                                    Output:["_col0","_col1"],keys:key, value
-                                    TableScan [TS_9] (rows=500 width=178)
-                                      
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                      Group By Operator [GBY_9] (rows=20 width=178)
+                        Output:["_col0","_col1"],keys:key, value
+                        Filter Operator [FIL_20] (rows=41 width=178)
+                          predicate:((value = value) and (key = key) and 
(value > 'val_12'))
+                          TableScan [TS_6] (rows=500 width=178)
+                            
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
 
 PREHOOK: query: create view cv1 as 
 select * 
@@ -1991,55 +1947,34 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 4 <- Map 3 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 6 <- Map 5 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 2 llap
-      File Output Operator [FS_21]
-        Merge Join Operator [MERGEJOIN_31] (rows=1 width=178)
-          Conds:RS_17._col0, _col1=RS_18._col0, _col1(Left 
Semi),Output:["_col0","_col1"]
+      File Output Operator [FS_11]
+        Merge Join Operator [MERGEJOIN_16] (rows=1 width=178)
+          Conds:RS_7._col0, _col1=RS_8._col0, _col1(Left 
Semi),Output:["_col0","_col1"]
         <-Map 1 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_17]
+          SHUFFLE [RS_7]
             PartitionCols:_col0, _col1
             Select Operator [SEL_1] (rows=500 width=178)
               Output:["_col0","_col1"]
               TableScan [TS_0] (rows=500 width=178)
                 
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"],properties:{"insideView":"TRUE"}
-        <-Reducer 4 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_18]
+        <-Map 3 [SIMPLE_EDGE] llap
+          SHUFFLE [RS_8]
             PartitionCols:_col0, _col1
-            Group By Operator [GBY_16] (rows=1 width=178)
+            Group By Operator [GBY_6] (rows=20 width=178)
               Output:["_col0","_col1"],keys:_col0, _col1
-              Select Operator [SEL_14] (rows=1 width=178)
+              Select Operator [SEL_4] (rows=41 width=178)
                 Output:["_col0","_col1"]
-                Merge Join Operator [MERGEJOIN_30] (rows=1 width=178)
-                  Conds:RS_11._col0, _col1=RS_12._col0, 
_col1(Inner),Output:["_col2","_col3"]
-                <-Map 3 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_11]
-                    PartitionCols:_col0, _col1
-                    Select Operator [SEL_4] (rows=166 width=178)
-                      Output:["_col0","_col1"]
-                      Filter Operator [FIL_28] (rows=166 width=178)
-                        predicate:(value > 'val_9')
-                        TableScan [TS_2] (rows=500 width=178)
-                          
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                <-Reducer 6 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_12]
-                    PartitionCols:_col0, _col1
-                    Group By Operator [GBY_9] (rows=250 width=178)
-                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                    <-Map 5 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_8]
-                        PartitionCols:_col0, _col1
-                        Group By Operator [GBY_7] (rows=250 width=178)
-                          Output:["_col0","_col1"],keys:key, value
-                          TableScan [TS_5] (rows=500 width=178)
-                            
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"],properties:{"insideView":"TRUE"}
+                Filter Operator [FIL_15] (rows=41 width=178)
+                  predicate:((value = value) and (key = key) and (value > 
'val_9'))
+                  TableScan [TS_2] (rows=500 width=178)
+                    
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
 
 PREHOOK: query: explain select * 
 from (select * 
@@ -2062,55 +1997,34 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 4 <- Map 3 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 6 <- Map 5 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 2 llap
-      File Output Operator [FS_21]
-        Merge Join Operator [MERGEJOIN_31] (rows=1 width=178)
-          Conds:RS_17._col0, _col1=RS_18._col0, _col1(Left 
Semi),Output:["_col0","_col1"]
+      File Output Operator [FS_11]
+        Merge Join Operator [MERGEJOIN_16] (rows=1 width=178)
+          Conds:RS_7._col0, _col1=RS_8._col0, _col1(Left 
Semi),Output:["_col0","_col1"]
         <-Map 1 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_17]
+          SHUFFLE [RS_7]
             PartitionCols:_col0, _col1
             Select Operator [SEL_1] (rows=500 width=178)
               Output:["_col0","_col1"]
               TableScan [TS_0] (rows=500 width=178)
                 
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-        <-Reducer 4 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_18]
+        <-Map 3 [SIMPLE_EDGE] llap
+          SHUFFLE [RS_8]
             PartitionCols:_col0, _col1
-            Group By Operator [GBY_16] (rows=1 width=178)
+            Group By Operator [GBY_6] (rows=20 width=178)
               Output:["_col0","_col1"],keys:_col0, _col1
-              Select Operator [SEL_14] (rows=1 width=178)
+              Select Operator [SEL_4] (rows=41 width=178)
                 Output:["_col0","_col1"]
-                Merge Join Operator [MERGEJOIN_30] (rows=1 width=178)
-                  Conds:RS_11._col0, _col1=RS_12._col0, 
_col1(Inner),Output:["_col2","_col3"]
-                <-Map 3 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_11]
-                    PartitionCols:_col0, _col1
-                    Select Operator [SEL_4] (rows=166 width=178)
-                      Output:["_col0","_col1"]
-                      Filter Operator [FIL_28] (rows=166 width=178)
-                        predicate:(value > 'val_9')
-                        TableScan [TS_2] (rows=500 width=178)
-                          
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                <-Reducer 6 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_12]
-                    PartitionCols:_col0, _col1
-                    Group By Operator [GBY_9] (rows=250 width=178)
-                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                    <-Map 5 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_8]
-                        PartitionCols:_col0, _col1
-                        Group By Operator [GBY_7] (rows=250 width=178)
-                          Output:["_col0","_col1"],keys:key, value
-                          TableScan [TS_5] (rows=500 width=178)
-                            
default@src_cbo,b,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                Filter Operator [FIL_15] (rows=41 width=178)
+                  predicate:((value = value) and (key = key) and (value > 
'val_9'))
+                  TableScan [TS_2] (rows=500 width=178)
+                    
default@src_cbo,a,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
 
 PREHOOK: query: explain select * 
 from src_cbo 
@@ -2167,40 +2081,47 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Map 12 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
 Reducer 2 <- Map 1 (SIMPLE_EDGE)
 Reducer 3 <- Map 5 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 3 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
-Reducer 7 <- Map 6 (SIMPLE_EDGE), Reducer 11 (SIMPLE_EDGE)
-Reducer 9 <- Map 8 (SIMPLE_EDGE)
+Reducer 4 <- Map 6 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 4 llap
-      File Output Operator [FS_44]
-        Select Operator [SEL_43] (rows=5 width=8)
+      File Output Operator [FS_22]
+        Select Operator [SEL_21] (rows=5 width=8)
           Output:["_col0","_col1"]
-          Merge Join Operator [MERGEJOIN_65] (rows=5 width=8)
-            Conds:RS_40._col1, _col4=RS_41._col0, _col1(Left 
Semi),Output:["_col0","_col3"]
+          Merge Join Operator [MERGEJOIN_32] (rows=5 width=8)
+            Conds:RS_18._col1, _col4=RS_19._col0, _col1(Left 
Semi),Output:["_col0","_col3"]
+          <-Map 6 [SIMPLE_EDGE] llap
+            SHUFFLE [RS_19]
+              PartitionCols:_col0, _col1
+              Group By Operator [GBY_17] (rows=2 width=8)
+                Output:["_col0","_col1"],keys:_col0, _col1
+                Select Operator [SEL_12] (rows=7 width=8)
+                  Output:["_col0","_col1"]
+                  Filter Operator [FIL_30] (rows=7 width=96)
+                    predicate:((l_shipmode = 'AIR') and (l_linenumber = 
l_linenumber))
+                    TableScan [TS_10] (rows=100 width=96)
+                      
default@lineitem,lineitem,Tbl:COMPLETE,Col:COMPLETE,Output:["l_orderkey","l_linenumber","l_shipmode"]
           <-Reducer 3 [SIMPLE_EDGE] llap
-            SHUFFLE [RS_40]
+            SHUFFLE [RS_18]
               PartitionCols:_col1, _col4
-              Merge Join Operator [MERGEJOIN_62] (rows=5 width=16)
-                
Conds:RS_35._col0=RS_36._col1(Inner),Output:["_col0","_col1","_col3","_col4"]
+              Merge Join Operator [MERGEJOIN_31] (rows=5 width=16)
+                
Conds:RS_13._col0=RS_14._col1(Inner),Output:["_col0","_col1","_col3","_col4"]
               <-Map 5 [SIMPLE_EDGE] llap
-                SHUFFLE [RS_36]
+                SHUFFLE [RS_14]
                   PartitionCols:_col1
                   Select Operator [SEL_9] (rows=17 width=16)
                     Output:["_col0","_col1","_col2","_col3"]
-                    Filter Operator [FIL_58] (rows=17 width=16)
+                    Filter Operator [FIL_29] (rows=17 width=16)
                       predicate:((l_linenumber = 1) and l_partkey is not null)
                       TableScan [TS_7] (rows=100 width=16)
                         
default@lineitem,li,Tbl:COMPLETE,Col:COMPLETE,Output:["l_orderkey","l_partkey","l_suppkey","l_linenumber"]
               <-Reducer 2 [SIMPLE_EDGE] llap
-                SHUFFLE [RS_35]
+                SHUFFLE [RS_13]
                   PartitionCols:_col0
                   Group By Operator [GBY_5] (rows=50 width=4)
                     Output:["_col0"],keys:KEY._col0
@@ -2209,63 +2130,10 @@ Stage-0
                       PartitionCols:_col0
                       Group By Operator [GBY_3] (rows=50 width=4)
                         Output:["_col0"],keys:l_partkey
-                        Filter Operator [FIL_57] (rows=100 width=4)
+                        Filter Operator [FIL_28] (rows=100 width=4)
                           predicate:l_partkey is not null
                           TableScan [TS_0] (rows=100 width=4)
                             
default@lineitem,lineitem,Tbl:COMPLETE,Col:COMPLETE,Output:["l_partkey"]
-          <-Reducer 7 [SIMPLE_EDGE] llap
-            SHUFFLE [RS_41]
-              PartitionCols:_col0, _col1
-              Group By Operator [GBY_39] (rows=4 width=8)
-                Output:["_col0","_col1"],keys:_col0, _col1
-                Select Operator [SEL_34] (rows=14 width=8)
-                  Output:["_col0","_col1"]
-                  Merge Join Operator [MERGEJOIN_64] (rows=14 width=8)
-                    
Conds:RS_31._col1=RS_32._col0(Inner),Output:["_col0","_col3"]
-                  <-Map 6 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_31]
-                      PartitionCols:_col1
-                      Select Operator [SEL_12] (rows=14 width=95)
-                        Output:["_col0","_col1"]
-                        Filter Operator [FIL_59] (rows=14 width=96)
-                          predicate:(l_shipmode = 'AIR')
-                          TableScan [TS_10] (rows=100 width=96)
-                            
default@lineitem,lineitem,Tbl:COMPLETE,Col:COMPLETE,Output:["l_orderkey","l_linenumber","l_shipmode"]
-                  <-Reducer 11 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_32]
-                      PartitionCols:_col0
-                      Group By Operator [GBY_29] (rows=3 width=4)
-                        Output:["_col0"],keys:KEY._col0
-                      <-Reducer 10 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_28]
-                          PartitionCols:_col0
-                          Group By Operator [GBY_27] (rows=3 width=4)
-                            Output:["_col0"],keys:_col2
-                            Merge Join Operator [MERGEJOIN_63] (rows=34 
width=4)
-                              
Conds:RS_23._col0=RS_24._col0(Inner),Output:["_col2"]
-                            <-Map 12 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_24]
-                                PartitionCols:_col0
-                                Select Operator [SEL_22] (rows=100 width=8)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_61] (rows=100 width=8)
-                                    predicate:l_partkey is not null
-                                    TableScan [TS_20] (rows=100 width=8)
-                                      
default@lineitem,li,Tbl:COMPLETE,Col:COMPLETE,Output:["l_partkey","l_linenumber"]
-                            <-Reducer 9 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_23]
-                                PartitionCols:_col0
-                                Group By Operator [GBY_18] (rows=50 width=4)
-                                  Output:["_col0"],keys:KEY._col0
-                                <-Map 8 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_17]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_16] (rows=50 
width=4)
-                                      Output:["_col0"],keys:l_partkey
-                                      Filter Operator [FIL_60] (rows=100 
width=4)
-                                        predicate:l_partkey is not null
-                                        TableScan [TS_13] (rows=100 width=4)
-                                          
default@lineitem,lineitem,Tbl:COMPLETE,Col:COMPLETE,Output:["l_partkey"]
 
 PREHOOK: query: explain select key, value, count(*) 
 from src_cbo b
@@ -2516,128 +2384,71 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Map 9 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE)
-Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
-Reducer 12 <- Reducer 11 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE)
-Reducer 14 <- Map 13 (SIMPLE_EDGE)
-Reducer 16 <- Map 15 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 5 <- Map 4 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
-Reducer 8 <- Map 7 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 5 <- Map 4 (SIMPLE_EDGE)
+Reducer 7 <- Map 6 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 3 llap
-      File Output Operator [FS_54]
-        Select Operator [SEL_53] (rows=13 width=223)
+      File Output Operator [FS_26]
+        Select Operator [SEL_25] (rows=13 width=223)
           Output:["_col0","_col1","_col2"]
-          Filter Operator [FIL_52] (rows=13 width=243)
-            predicate:CASE WHEN ((_col4 = 0)) THEN (true) WHEN (_col4 is null) 
THEN (true) WHEN (_col8 is not null) THEN (false) WHEN (_col0 is null) THEN 
(null) WHEN ((_col5 < _col4)) THEN (false) ELSE (true) END
-            Merge Join Operator [MERGEJOIN_76] (rows=26 width=243)
-              Conds:RS_49._col0, _col1=RS_50._col3, _col1(Left 
Outer),Output:["_col0","_col1","_col2","_col4","_col5","_col8"]
-            <-Reducer 12 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_50]
-                PartitionCols:_col3, _col1
-                Merge Join Operator [MERGEJOIN_75] (rows=2 width=223)
-                  
Conds:RS_42._col0=RS_43._col0(Inner),Output:["_col1","_col2","_col3"]
-                <-Reducer 11 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_42]
-                    PartitionCols:_col0
-                    Select Operator [SEL_35] (rows=4 width=223)
-                      Output:["_col0","_col1","_col2"]
-                      Group By Operator [GBY_34] (rows=4 width=219)
-                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                      <-Reducer 10 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_33]
-                          PartitionCols:_col0, _col1
-                          Group By Operator [GBY_32] (rows=4 width=219)
-                            Output:["_col0","_col1"],keys:_col1, _col2
-                            Merge Join Operator [MERGEJOIN_74] (rows=8 
width=219)
-                              
Conds:RS_28._col0=RS_29._col0(Inner),Output:["_col1","_col2"]
-                            <-Map 9 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_28]
-                                PartitionCols:_col0
-                                Select Operator [SEL_21] (rows=8 width=219)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_69] (rows=8 width=223)
-                                    predicate:(p_size < 10)
-                                    TableScan [TS_19] (rows=26 width=223)
-                                      
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
-                            <-Reducer 14 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_29]
-                                PartitionCols:_col0
-                                Group By Operator [GBY_26] (rows=5 width=98)
-                                  Output:["_col0"],keys:KEY._col0
-                                <-Map 13 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_25]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_24] (rows=5 
width=98)
-                                      Output:["_col0"],keys:p_mfgr
-                                      TableScan [TS_22] (rows=26 width=98)
-                                        
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr"]
-                <-Reducer 16 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_43]
-                    PartitionCols:_col0
-                    Group By Operator [GBY_40] (rows=13 width=121)
-                      Output:["_col0"],keys:KEY._col0
-                    <-Map 15 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_39]
-                        PartitionCols:_col0
-                        Group By Operator [GBY_38] (rows=13 width=121)
-                          Output:["_col0"],keys:p_name
-                          TableScan [TS_36] (rows=26 width=121)
-                            
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name"]
+          Filter Operator [FIL_24] (rows=13 width=243)
+            predicate:(not CASE WHEN ((_col4 = 0)) THEN (false) WHEN (_col4 is 
null) THEN (false) WHEN (_col8 is not null) THEN (true) WHEN (_col0 is null) 
THEN (null) WHEN ((_col5 < _col4)) THEN (true) ELSE (false) END)
+            Merge Join Operator [MERGEJOIN_32] (rows=26 width=243)
+              Conds:RS_21._col0, _col1=RS_22._col0, _col1(Left 
Outer),Output:["_col0","_col1","_col2","_col4","_col5","_col8"]
             <-Reducer 2 [SIMPLE_EDGE] llap
-              SHUFFLE [RS_49]
+              SHUFFLE [RS_21]
                 PartitionCols:_col0, _col1
-                Merge Join Operator [MERGEJOIN_73] (rows=26 width=239)
-                  Conds:RS_46._col1=RS_47._col0(Left 
Outer),Output:["_col0","_col1","_col2","_col4","_col5"]
+                Merge Join Operator [MERGEJOIN_31] (rows=26 width=239)
+                  Conds:RS_18._col1=RS_19._col0(Left 
Outer),Output:["_col0","_col1","_col2","_col4","_col5"]
                 <-Map 1 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_46]
+                  SHUFFLE [RS_18]
                     PartitionCols:_col1
                     Select Operator [SEL_1] (rows=26 width=223)
                       Output:["_col0","_col1","_col2"]
                       TableScan [TS_0] (rows=26 width=223)
                         
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
-                <-Reducer 6 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_47]
+                <-Reducer 5 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_19]
                     PartitionCols:_col0
-                    Group By Operator [GBY_17] (rows=2 width=114)
+                    Group By Operator [GBY_7] (rows=1 width=114)
                       
Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0
-                    <-Reducer 5 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_16]
+                    <-Map 4 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_6]
                         PartitionCols:_col0
-                        Group By Operator [GBY_15] (rows=2 width=114)
-                          
Output:["_col0","_col1","_col2"],aggregations:["count()","count(_col1)"],keys:_col2
-                          Select Operator [SEL_14] (rows=8 width=219)
-                            Output:["_col2","_col1"]
-                            Merge Join Operator [MERGEJOIN_72] (rows=8 
width=219)
-                              
Conds:RS_11._col0=RS_12._col0(Inner),Output:["_col1","_col2"]
-                            <-Map 4 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_11]
-                                PartitionCols:_col0
-                                Select Operator [SEL_4] (rows=8 width=219)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_67] (rows=8 width=223)
-                                    predicate:(p_size < 10)
-                                    TableScan [TS_2] (rows=26 width=223)
-                                      
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
-                            <-Reducer 8 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_12]
-                                PartitionCols:_col0
-                                Group By Operator [GBY_9] (rows=5 width=98)
-                                  Output:["_col0"],keys:KEY._col0
-                                <-Map 7 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_8]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_7] (rows=5 width=98)
-                                      Output:["_col0"],keys:p_mfgr
-                                      TableScan [TS_5] (rows=26 width=98)
-                                        
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr"]
+                        Group By Operator [GBY_5] (rows=1 width=114)
+                          
Output:["_col0","_col1","_col2"],aggregations:["count()","count(p_name)"],keys:p_mfgr
+                          Select Operator [SEL_4] (rows=4 width=223)
+                            Output:["p_mfgr","p_name"]
+                            Filter Operator [FIL_29] (rows=4 width=223)
+                              predicate:((p_size < 10) and (p_mfgr = p_mfgr))
+                              TableScan [TS_2] (rows=26 width=223)
+                                
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
+            <-Reducer 7 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_22]
+                PartitionCols:_col0, _col1
+                Select Operator [SEL_17] (rows=1 width=223)
+                  Output:["_col0","_col1","_col2"]
+                  Filter Operator [FIL_16] (rows=1 width=219)
+                    predicate:(_col0 = _col0)
+                    Group By Operator [GBY_14] (rows=2 width=219)
+                      Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                    <-Map 6 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_13]
+                        PartitionCols:_col0, _col1
+                        Group By Operator [GBY_12] (rows=2 width=219)
+                          Output:["_col0","_col1"],keys:p_name, p_mfgr
+                          Select Operator [SEL_11] (rows=4 width=223)
+                            Output:["p_name","p_mfgr"]
+                            Filter Operator [FIL_30] (rows=4 width=223)
+                              predicate:((p_size < 10) and (p_mfgr = p_mfgr))
+                              TableScan [TS_9] (rows=26 width=223)
+                                
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_name","p_mfgr","p_size"]
 
 PREHOOK: query: explain select p_name, p_size 
 from 
@@ -2752,118 +2563,65 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 11 <- Map 10 (SIMPLE_EDGE)
-Reducer 12 <- Reducer 11 (SIMPLE_EDGE)
-Reducer 14 <- Map 13 (SIMPLE_EDGE)
-Reducer 15 <- Reducer 14 (SIMPLE_EDGE), Reducer 20 (SIMPLE_EDGE)
-Reducer 16 <- Reducer 15 (SIMPLE_EDGE)
-Reducer 17 <- Reducer 16 (SIMPLE_EDGE), Reducer 22 (SIMPLE_EDGE)
-Reducer 19 <- Map 18 (SIMPLE_EDGE)
+Reducer 10 <- Map 9 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (SIMPLE_EDGE)
 Reducer 2 <- Map 1 (SIMPLE_EDGE)
-Reducer 20 <- Reducer 19 (SIMPLE_EDGE)
-Reducer 22 <- Map 21 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 17 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 11 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
 Reducer 7 <- Map 6 (SIMPLE_EDGE)
-Reducer 8 <- Reducer 12 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
-Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 5 llap
-      File Output Operator [FS_83]
-        Select Operator [SEL_82] (rows=2 width=106)
+      File Output Operator [FS_42]
+        Select Operator [SEL_41] (rows=3 width=106)
           Output:["_col0","_col1"]
         <-Reducer 4 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_81]
-            Select Operator [SEL_80] (rows=2 width=106)
+          SHUFFLE [RS_40]
+            Select Operator [SEL_39] (rows=3 width=106)
               Output:["_col0","_col1"]
-              Filter Operator [FIL_79] (rows=2 width=126)
-                predicate:CASE WHEN ((_col3 = 0)) THEN (true) WHEN (_col3 is 
null) THEN (true) WHEN (_col7 is not null) THEN (false) WHEN (_col0 is null) 
THEN (null) WHEN ((_col4 < _col3)) THEN (false) ELSE (true) END
-                Merge Join Operator [MERGEJOIN_108] (rows=5 width=126)
-                  Conds:RS_76._col0, _col1=RS_77._col3, _col1(Left 
Outer),Output:["_col0","_col1","_col3","_col4","_col7"]
-                <-Reducer 17 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_77]
-                    PartitionCols:_col3, _col1
-                    Merge Join Operator [MERGEJOIN_107] (rows=1 width=110)
-                      
Conds:RS_69._col0=RS_70._col0(Inner),Output:["_col1","_col2","_col3"]
-                    <-Reducer 16 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_69]
-                        PartitionCols:_col0
-                        Select Operator [SEL_57] (rows=1 width=110)
-                          Output:["_col0","_col1","_col2"]
-                          Group By Operator [GBY_56] (rows=1 width=106)
-                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                          <-Reducer 15 [SIMPLE_EDGE] llap
-                            SHUFFLE [RS_55]
-                              PartitionCols:_col0, _col1
-                              Group By Operator [GBY_54] (rows=1 width=106)
-                                Output:["_col0","_col1"],keys:_col0, _col3
-                                Merge Join Operator [MERGEJOIN_106] (rows=1 
width=106)
-                                  
Conds:RS_50._col1=RS_51._col0(Inner),Output:["_col0","_col3"]
-                                <-Reducer 14 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_50]
-                                    PartitionCols:_col1
-                                    Select Operator [SEL_38] (rows=1 width=114)
-                                      Output:["_col0","_col1"]
-                                      Filter Operator [FIL_98] (rows=1 
width=114)
-                                        predicate:((_col2 - _col1) > 600.0)
-                                        Group By Operator [GBY_36] (rows=5 
width=114)
-                                          
Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)"],keys:KEY._col0
-                                        <-Map 13 [SIMPLE_EDGE] llap
-                                          SHUFFLE [RS_35]
-                                            PartitionCols:_col0
-                                            Group By Operator [GBY_34] (rows=5 
width=114)
-                                              
Output:["_col0","_col1","_col2"],aggregations:["min(p_retailprice)","max(p_retailprice)"],keys:p_mfgr
-                                              TableScan [TS_32] (rows=26 
width=106)
-                                                
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
-                                <-Reducer 20 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_51]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_48] (rows=2 width=8)
-                                      Output:["_col0"],keys:KEY._col0
-                                    <-Reducer 19 [SIMPLE_EDGE] llap
-                                      SHUFFLE [RS_47]
-                                        PartitionCols:_col0
-                                        Group By Operator [GBY_46] (rows=2 
width=8)
-                                          Output:["_col0"],keys:_col1
-                                          Select Operator [SEL_103] (rows=5 
width=8)
-                                            Output:["_col1"]
-                                            Group By Operator [GBY_43] (rows=5 
width=106)
-                                              
Output:["_col0","_col1"],aggregations:["min(VALUE._col0)"],keys:KEY._col0
-                                            <-Map 18 [SIMPLE_EDGE] llap
-                                              SHUFFLE [RS_42]
-                                                PartitionCols:_col0
-                                                Group By Operator [GBY_41] 
(rows=5 width=106)
-                                                  
Output:["_col0","_col1"],aggregations:["min(p_retailprice)"],keys:p_mfgr
-                                                  Select Operator [SEL_40] 
(rows=26 width=106)
-                                                    
Output:["p_mfgr","p_retailprice"]
-                                                    TableScan [TS_39] (rows=26 
width=106)
-                                                      
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
-                    <-Reducer 22 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_70]
-                        PartitionCols:_col0
-                        Group By Operator [GBY_67] (rows=5 width=98)
-                          Output:["_col0"],keys:_col0
-                          Group By Operator [GBY_62] (rows=5 width=98)
-                            Output:["_col0"],keys:KEY._col0
-                          <-Map 21 [SIMPLE_EDGE] llap
-                            SHUFFLE [RS_61]
-                              PartitionCols:_col0
-                              Group By Operator [GBY_60] (rows=5 width=98)
-                                Output:["_col0"],keys:p_mfgr
-                                TableScan [TS_58] (rows=26 width=98)
-                                  
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr"]
+              Filter Operator [FIL_38] (rows=3 width=126)
+                predicate:(not CASE WHEN ((_col3 = 0)) THEN (false) WHEN 
(_col3 is null) THEN (false) WHEN (_col7 is not null) THEN (true) WHEN (_col0 
is null) THEN (null) WHEN ((_col4 < _col3)) THEN (true) ELSE (false) END)
+                Merge Join Operator [MERGEJOIN_49] (rows=5 width=126)
+                  Conds:RS_35._col0, _col1=RS_36._col0, _col1(Left 
Outer),Output:["_col0","_col1","_col3","_col4","_col7"]
+                <-Reducer 11 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_36]
+                    PartitionCols:_col0, _col1
+                    Select Operator [SEL_31] (rows=1 width=110)
+                      Output:["_col0","_col1","_col2"]
+                      Filter Operator [FIL_30] (rows=1 width=106)
+                        predicate:(_col0 = _col0)
+                        Group By Operator [GBY_28] (rows=1 width=106)
+                          Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                        <-Reducer 10 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_27]
+                            PartitionCols:_col0, _col1
+                            Group By Operator [GBY_26] (rows=1 width=106)
+                              Output:["_col0","_col1"],keys:_col0, _col1
+                              Select Operator [SEL_24] (rows=1 width=114)
+                                Output:["_col0","_col1"]
+                                Filter Operator [FIL_46] (rows=1 width=114)
+                                  predicate:((_col1 = _col1) and ((_col2 - 
_col1) > 600.0))
+                                  Group By Operator [GBY_22] (rows=5 width=114)
+                                    
Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)"],keys:KEY._col0
+                                  <-Map 9 [SIMPLE_EDGE] llap
+                                    SHUFFLE [RS_21]
+                                      PartitionCols:_col0
+                                      Group By Operator [GBY_20] (rows=5 
width=114)
+                                        
Output:["_col0","_col1","_col2"],aggregations:["min(p_retailprice)","max(p_retailprice)"],keys:p_mfgr
+                                        TableScan [TS_18] (rows=26 width=106)
+                                          
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
                 <-Reducer 3 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_76]
+                  SHUFFLE [RS_35]
                     PartitionCols:_col0, _col1
-                    Merge Join Operator [MERGEJOIN_105] (rows=5 width=122)
-                      Conds:RS_73._col1=RS_74._col0(Left 
Outer),Output:["_col0","_col1","_col3","_col4"]
+                    Merge Join Operator [MERGEJOIN_48] (rows=5 width=122)
+                      Conds:RS_32._col1=RS_33._col0(Left 
Outer),Output:["_col0","_col1","_col3","_col4"]
                     <-Reducer 2 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_73]
+                      SHUFFLE [RS_32]
                         PartitionCols:_col1
                         Group By Operator [GBY_4] (rows=5 width=106)
                           
Output:["_col0","_col1"],aggregations:["min(VALUE._col0)"],keys:KEY._col0
@@ -2876,61 +2634,31 @@ Stage-0
                                 Output:["p_mfgr","p_retailprice"]
                                 TableScan [TS_0] (rows=26 width=106)
                                   
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
-                    <-Reducer 9 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_74]
+                    <-Reducer 8 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_33]
                         PartitionCols:_col0
-                        Group By Operator [GBY_30] (rows=1 width=24)
+                        Group By Operator [GBY_16] (rows=1 width=24)
                           
Output:["_col0","_col1","_col2"],aggregations:["count(VALUE._col0)","count(VALUE._col1)"],keys:KEY._col0
-                        <-Reducer 8 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_29]
+                        <-Reducer 7 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_15]
                             PartitionCols:_col0
-                            Group By Operator [GBY_28] (rows=1 width=24)
-                              
Output:["_col0","_col1","_col2"],aggregations:["count()","count(_col0)"],keys:_col3
-                              Select Operator [SEL_27] (rows=1 width=106)
-                                Output:["_col3","_col0"]
-                                Merge Join Operator [MERGEJOIN_104] (rows=1 
width=106)
-                                  
Conds:RS_24._col1=RS_25._col0(Inner),Output:["_col0","_col3"]
-                                <-Reducer 12 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_25]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_22] (rows=2 width=8)
-                                      Output:["_col0"],keys:KEY._col0
-                                    <-Reducer 11 [SIMPLE_EDGE] llap
-                                      SHUFFLE [RS_21]
-                                        PartitionCols:_col0
-                                        Group By Operator [GBY_20] (rows=2 
width=8)
-                                          Output:["_col0"],keys:_col1
-                                          Select Operator [SEL_102] (rows=5 
width=8)
-                                            Output:["_col1"]
-                                            Group By Operator [GBY_17] (rows=5 
width=106)
-                                              
Output:["_col0","_col1"],aggregations:["min(VALUE._col0)"],keys:KEY._col0
-                                            <-Map 10 [SIMPLE_EDGE] llap
-                                              SHUFFLE [RS_16]
-                                                PartitionCols:_col0
-                                                Group By Operator [GBY_15] 
(rows=5 width=106)
-                                                  
Output:["_col0","_col1"],aggregations:["min(p_retailprice)"],keys:p_mfgr
-                                                  Select Operator [SEL_14] 
(rows=26 width=106)
-                                                    
Output:["p_mfgr","p_retailprice"]
-                                                    TableScan [TS_13] (rows=26 
width=106)
-                                                      
default@part,b,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
-                                <-Reducer 7 [SIMPLE_EDGE] llap
-                                  SHUFFLE [RS_24]
-                                    PartitionCols:_col1
-                                    Select Operator [SEL_12] (rows=1 width=114)
-                                      Output:["_col0","_col1"]
-                                      Filter Operator [FIL_96] (rows=1 
width=114)
-                                        predicate:((_col2 - _col1) > 600.0)
-                                        Group By Operator [GBY_10] (rows=5 
width=114)
-                                          
Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)"],keys:KEY._col0
-                                        <-Map 6 [SIMPLE_EDGE] llap
-                                          SHUFFLE [RS_9]
-                                            PartitionCols:_col0
-                                            Group By Operator [GBY_8] (rows=5 
width=114)
-                                              
Output:["_col0","_col1","_col2"],aggregations:["min(p_retailprice)","max(p_retailprice)"],keys:p_mfgr
-                                              Select Operator [SEL_7] (rows=26 
width=106)
-                                                
Output:["p_mfgr","p_retailprice"]
-                                                TableScan [TS_6] (rows=26 
width=106)
-                                                  
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
+                            Group By Operator [GBY_14] (rows=1 width=24)
+                              
Output:["_col0","_col1","_col2"],aggregations:["count()","count(_col0)"],keys:_col1
+                              Select Operator [SEL_12] (rows=1 width=114)
+                                Output:["_col1","_col0"]
+                                Filter Operator [FIL_45] (rows=1 width=114)
+                                  predicate:((_col1 = _col1) and ((_col2 - 
_col1) > 600.0))
+                                  Group By Operator [GBY_10] (rows=5 width=114)
+                                    
Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)"],keys:KEY._col0
+                                  <-Map 6 [SIMPLE_EDGE] llap
+                                    SHUFFLE [RS_9]
+                                      PartitionCols:_col0
+                                      Group By Operator [GBY_8] (rows=5 
width=114)
+                                        
Output:["_col0","_col1","_col2"],aggregations:["min(p_retailprice)","max(p_retailprice)"],keys:p_mfgr
+                                        Select Operator [SEL_7] (rows=26 
width=106)
+                                          Output:["p_mfgr","p_retailprice"]
+                                          TableScan [TS_6] (rows=26 width=106)
+                                            
default@part,part,Tbl:COMPLETE,Col:COMPLETE,Output:["p_mfgr","p_retailprice"]
 
 PREHOOK: query: explain select count(c_int) over(), sum(c_float) over(), 
max(c_int) over(), min(c_int) over(), row_number() over(), rank() over(), 
dense_rank() over(), percent_rank() over(), lead(c_int, 2, c_int) over(), 
lag(c_float, 2, c_float) over() from cbo_t1
 PREHOOK: type: QUERY

http://git-wip-us.apache.org/repos/asf/hive/blob/bddf5a7a/ql/src/test/results/clientpositive/llap/subquery_exists.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/subquery_exists.q.out 
b/ql/src/test/results/clientpositive/llap/subquery_exists.q.out
index 23d68ab..9e0a1d7 100644
--- a/ql/src/test/results/clientpositive/llap/subquery_exists.q.out
+++ b/ql/src/test/results/clientpositive/llap/subquery_exists.q.out
@@ -25,9 +25,7 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-        Reducer 4 <- Map 3 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-        Reducer 6 <- Map 5 (SIMPLE_EDGE)
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -52,34 +50,22 @@ STAGE PLANS:
                   alias: a
                   Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
                   Filter Operator
-                    predicate: (value > 'val_9') (type: boolean)
-                    Statistics: Num rows: 166 Data size: 29548 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    predicate: ((value = value) and (key = key) and (value > 
'val_9')) (type: boolean)
+                    Statistics: Num rows: 41 Data size: 7298 Basic stats: 
COMPLETE Column stats: COMPLETE
                     Select Operator
                       expressions: key (type: string), value (type: string)
                       outputColumnNames: _col0, _col1
-                      Statistics: Num rows: 166 Data size: 29548 Basic stats: 
COMPLETE Column stats: COMPLETE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: string), _col1 (type: 
string)
-                        sort order: ++
-                        Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string)
-                        Statistics: Num rows: 166 Data size: 29548 Basic 
stats: COMPLETE Column stats: COMPLETE
-            Execution mode: llap
-            LLAP IO: no inputs
-        Map 5 
-            Map Operator Tree:
-                TableScan
-                  alias: b
-                  Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  Group By Operator
-                    keys: key (type: string), value (type: string)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: string), _col1 (type: 
string)
-                      sort order: ++
-                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string)
-                      Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Statistics: Num rows: 41 Data size: 7298 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Group By Operator
+                        keys: _col0 (type: string), _col1 (type: string)
+                        mode: hash
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 20 Data size: 3560 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: string), _col1 (type: 
string)
+                          sort order: ++
+                          Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string)
+                          Statistics: Num rows: 20 Data size: 3560 Basic 
stats: COMPLETE Column stats: COMPLETE
             Execution mode: llap
             LLAP IO: no inputs
         Reducer 2 
@@ -100,44 +86,6 @@ STAGE PLANS:
                       input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                       serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-        Reducer 4 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Merge Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: string), _col1 (type: string)
-                  1 _col0 (type: string), _col1 (type: string)
-                outputColumnNames: _col2, _col3
-                Statistics: Num rows: 1 Data size: 178 Basic stats: COMPLETE 
Column stats: COMPLETE
-                Select Operator
-                  expressions: _col2 (type: string), _col3 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 1 Data size: 178 Basic stats: COMPLETE 
Column stats: COMPLETE
-                  Group By Operator
-                    keys: _col0 (type: string), _col1 (type: string)
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Statistics: Num rows: 1 Data size: 178 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: string), _col1 (type: 
string)
-                      sort order: ++
-                      Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string)
-                      Statistics: Num rows: 1 Data size: 178 Basic stats: 
COMPLETE Column stats: COMPLETE
-        Reducer 6 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Group By Operator
-                keys: KEY._col0 (type: string), KEY._col1 (type: string)
-                mode: mergepartial
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: _col0 (type: string), _col1 (type: string)
-                  sort order: ++
-                  Map-reduce partition columns: _col0 (type: string), _col1 
(type: string)
-                  Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
 
   Stage: Stage-0
     Fetch Operator
@@ -281,9 +229,7 @@ STAGE PLANS:
     Tez
 #### A masked pattern was here ####
       Edges:
-        Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-        Reducer 4 <- Map 3 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-        Reducer 6 <- Map 5 (SIMPLE_EDGE)
+        Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 3 (SIMPLE_EDGE)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -308,32 +254,23 @@ STAGE PLANS:
                 TableScan
                   alias: a
                   Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  Select Operator
-                    expressions: value (type: string)
-                    outputColumnNames: _col0
-                    Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: string)
-                      sort order: +
-                      Map-reduce partition columns: _col0 (type: string)
-                      Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-            Execution mode: llap
-            LLAP IO: no inputs
-        Map 5 
-            Map Operator Tree:
-                TableScan
-                  alias: b
-                  Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  Group By Operator
-                    keys: value (type: string)
-                    mode: hash
-                    outputColumnNames: _col0
-                    Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: string)
-                      sort order: +
-                      Map-reduce partition columns: _col0 (type: string)
-                      Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Filter Operator
+                    predicate: (value = value) (type: boolean)
+                    Statistics: Num rows: 250 Data size: 22750 Basic stats: 
COMPLETE Column stats: COMPLETE
+                    Select Operator
+                      expressions: value (type: string)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 250 Data size: 22750 Basic stats: 
COMPLETE Column stats: COMPLETE
+                      Group By Operator
+                        keys: _col0 (type: string)
+                        mode: hash
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 107 Data size: 9737 Basic stats: 
COMPLETE Column stats: COMPLETE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col0 (type: string)
+                          Statistics: Num rows: 107 Data size: 9737 Basic 
stats: COMPLETE Column stats: COMPLETE
             Execution mode: llap
             LLAP IO: no inputs
         Reducer 2 
@@ -346,52 +283,14 @@ STAGE PLANS:
                   0 _col1 (type: string)
                   1 _col0 (type: string)
                 outputColumnNames: _col0, _col1
-                Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
                 File Output Operator
                   compressed: false
-                  Statistics: Num rows: 500 Data size: 89000 Basic stats: 
COMPLETE Column stats: COMPLETE
+                  Statistics: Num rows: 250 Data size: 44500 Basic stats: 
COMPLETE Column stats: COMPLETE
                   table:
                       input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
                       output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
                       serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
-        Reducer 4 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Merge Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                keys:
-                  0 _col0 (type: string)
-                  1 _col0 (type: string)
-                outputColumnNames: _col1
-                Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                Select Operator
-                  expressions: _col1 (type: string)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 500 Data size: 45500 Basic stats: 
COMPLETE Column stats: COMPLETE
-                  Group By Operator
-                    keys: _col0 (type: string)
-                    mode: hash
-                    outputColumnNames: _col0
-                    Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
-                    Reduce Output Operator
-                      key expressions: _col0 (type: string)
-                      sort order: +
-                      Map-reduce partition columns: _col0 (type: string)
-                      Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
-        Reducer 6 
-            Execution mode: llap
-            Reduce Operator Tree:
-              Group By Operator
-                keys: KEY._col0 (type: string)
-                mode: mergepartial
-                outputColumnNames: _col0
-                Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
-                Reduce Output Operator
-                  key expressions: _col0 (type: string)
-                  sort order: +
-                  Map-reduce partition columns: _col0 (type: string)
-                  Statistics: Num rows: 214 Data size: 19474 Basic stats: 
COMPLETE Column stats: COMPLETE
 
   Stage: Stage-0
     Fetch Operator

Reply via email to