http://git-wip-us.apache.org/repos/asf/hive/blob/13960aa9/ql/src/test/results/clientpositive/llap/explainanalyze_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/llap/explainanalyze_2.q.out 
b/ql/src/test/results/clientpositive/llap/explainanalyze_2.q.out
index c1cc477..6ec4d00 100644
--- a/ql/src/test/results/clientpositive/llap/explainanalyze_2.q.out
+++ b/ql/src/test/results/clientpositive/llap/explainanalyze_2.q.out
@@ -41,134 +41,129 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Union 2 (CONTAINS)
+Map 12 <- Union 10 (CONTAINS)
 Map 13 <- Union 14 (CONTAINS)
 Map 16 <- Union 14 (CONTAINS)
-Map 8 <- Union 2 (CONTAINS)
-Reducer 10 <- Map 9 (SIMPLE_EDGE), Reducer 15 (SIMPLE_EDGE)
-Reducer 11 <- Map 17 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE), Union 6 
(CONTAINS)
+Map 9 <- Union 10 (CONTAINS)
+Reducer 11 <- Union 10 (SIMPLE_EDGE)
 Reducer 15 <- Union 14 (SIMPLE_EDGE)
-Reducer 3 <- Union 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 12 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE), Union 6 (CONTAINS)
-Reducer 7 <- Union 6 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 5 <- Union 4 (SIMPLE_EDGE)
+Reducer 6 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 15 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE), Union 4 
(CONTAINS)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 7 llap
+      Reducer 5 llap
       File Output Operator [FS_56]
-        Group By Operator [GBY_54] (rows=32/15 width=177)
+        Group By Operator [GBY_54] (rows=48/15 width=177)
           Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-        <-Union 6 [SIMPLE_EDGE]
-          <-Reducer 11 [CONTAINS] llap
+        <-Union 4 [SIMPLE_EDGE]
+          <-Reducer 3 [CONTAINS] llap
             Reduce Output Operator [RS_53]
               PartitionCols:_col0, _col1
-              Select Operator [SEL_49] (rows=67/61 width=177)
+              Select Operator [SEL_24] (rows=66/61 width=177)
                 Output:["_col0","_col1"]
-                Merge Join Operator [MERGEJOIN_82] (rows=67/61 width=177)
-                  Conds:RS_46._col2=RS_47._col0(Inner),Output:["_col1","_col2"]
-                <-Map 17 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_47]
-                    PartitionCols:_col0
-                    Select Operator [SEL_42] (rows=500/500 width=87)
-                      Output:["_col0"]
-                      Filter Operator [FIL_78] (rows=500/500 width=87)
-                        predicate:key is not null
-                        TableScan [TS_40] (rows=500/500 width=87)
-                          
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-                <-Reducer 10 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_46]
+                Merge Join Operator [MERGEJOIN_79] (rows=66/61 width=177)
+                  Conds:RS_21._col2=RS_22._col1(Inner),Output:["_col1","_col4"]
+                <-Reducer 11 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_22]
+                    PartitionCols:_col1
+                    Select Operator [SEL_17] (rows=525/319 width=178)
+                      Output:["_col1"]
+                      Group By Operator [GBY_16] (rows=525/319 width=178)
+                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                      <-Union 10 [SIMPLE_EDGE]
+                        <-Map 12 [CONTAINS] llap
+                          Reduce Output Operator [RS_15]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_11] (rows=500/500 width=178)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_72] (rows=500/500 width=178)
+                                predicate:value is not null
+                                TableScan [TS_9] (rows=500/500 width=178)
+                                  Output:["key","value"]
+                        <-Map 9 [CONTAINS] llap
+                          Reduce Output Operator [RS_15]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_8] (rows=25/25 width=175)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_71] (rows=25/25 width=175)
+                                predicate:value is not null
+                                TableScan [TS_6] (rows=25/25 width=175)
+                                  Output:["key","value"]
+                <-Reducer 2 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_21]
                     PartitionCols:_col2
-                    Merge Join Operator [MERGEJOIN_81] (rows=42/52 width=177)
-                      
Conds:RS_43._col1=RS_44._col1(Inner),Output:["_col1","_col2"]
-                    <-Map 9 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_44]
-                        PartitionCols:_col1
-                        Select Operator [SEL_14] (rows=25/25 width=175)
+                    Merge Join Operator [MERGEJOIN_77] (rows=39/37 width=175)
+                      
Conds:RS_18._col0=RS_19._col0(Inner),Output:["_col1","_col2"]
+                    <-Map 1 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_18]
+                        PartitionCols:_col0
+                        Select Operator [SEL_2] (rows=500/500 width=87)
+                          Output:["_col0"]
+                          Filter Operator [FIL_69] (rows=500/500 width=87)
+                            predicate:key is not null
+                            TableScan [TS_0] (rows=500/500 width=87)
+                              
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+                    <-Map 8 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_19]
+                        PartitionCols:_col0
+                        Select Operator [SEL_5] (rows=25/25 width=175)
                           Output:["_col0","_col1"]
-                          Filter Operator [FIL_73] (rows=25/25 width=175)
+                          Filter Operator [FIL_70] (rows=25/25 width=175)
                             predicate:(key is not null and value is not null)
-                            TableScan [TS_12] (rows=25/25 width=175)
+                            TableScan [TS_3] (rows=25/25 width=175)
                               
default@src1,x,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                    <-Reducer 15 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_43]
-                        PartitionCols:_col1
-                        Select Operator [SEL_36] (rows=525/319 width=178)
-                          Output:["_col1"]
-                          Group By Operator [GBY_35] (rows=525/319 width=178)
-                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                          <-Union 14 [SIMPLE_EDGE]
-                            <-Map 13 [CONTAINS] llap
-                              Reduce Output Operator [RS_34]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_27] (rows=25/25 width=175)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_75] (rows=25/25 
width=175)
-                                    predicate:value is not null
-                                    TableScan [TS_25] (rows=25/25 width=175)
-                                      Output:["key","value"]
-                            <-Map 16 [CONTAINS] llap
-                              Reduce Output Operator [RS_34]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_30] (rows=500/500 
width=178)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_76] (rows=500/500 
width=178)
-                                    predicate:value is not null
-                                    TableScan [TS_28] (rows=500/500 width=178)
-                                      Output:["key","value"]
-          <-Reducer 5 [CONTAINS] llap
+          <-Reducer 7 [CONTAINS] llap
             Reduce Output Operator [RS_53]
               PartitionCols:_col0, _col1
-              Select Operator [SEL_24] (rows=67/61 width=177)
+              Select Operator [SEL_49] (rows=66/61 width=177)
                 Output:["_col0","_col1"]
-                Merge Join Operator [MERGEJOIN_80] (rows=67/61 width=177)
-                  Conds:RS_21._col2=RS_22._col0(Inner),Output:["_col1","_col2"]
-                <-Map 12 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_22]
-                    PartitionCols:_col0
-                    Select Operator [SEL_17] (rows=500/500 width=87)
-                      Output:["_col0"]
-                      Filter Operator [FIL_74] (rows=500/500 width=87)
-                        predicate:key is not null
-                        TableScan [TS_15] (rows=500/500 width=87)
-                          
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-                <-Reducer 4 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_21]
+                Merge Join Operator [MERGEJOIN_80] (rows=66/61 width=177)
+                  Conds:RS_46._col2=RS_47._col1(Inner),Output:["_col1","_col4"]
+                <-Reducer 15 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_47]
+                    PartitionCols:_col1
+                    Select Operator [SEL_42] (rows=525/319 width=178)
+                      Output:["_col1"]
+                      Group By Operator [GBY_41] (rows=525/319 width=178)
+                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                      <-Union 14 [SIMPLE_EDGE]
+                        <-Map 13 [CONTAINS] llap
+                          Reduce Output Operator [RS_40]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_33] (rows=25/25 width=175)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_75] (rows=25/25 width=175)
+                                predicate:value is not null
+                                TableScan [TS_31] (rows=25/25 width=175)
+                                  Output:["key","value"]
+                        <-Map 16 [CONTAINS] llap
+                          Reduce Output Operator [RS_40]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_36] (rows=500/500 width=178)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_76] (rows=500/500 width=178)
+                                predicate:value is not null
+                                TableScan [TS_34] (rows=500/500 width=178)
+                                  Output:["key","value"]
+                <-Reducer 6 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_46]
                     PartitionCols:_col2
-                    Merge Join Operator [MERGEJOIN_79] (rows=42/52 width=177)
-                      
Conds:RS_18._col1=RS_19._col1(Inner),Output:["_col1","_col2"]
-                    <-Map 9 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_19]
-                        PartitionCols:_col1
-                         Please refer to the previous Select Operator [SEL_14]
-                    <-Reducer 3 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_18]
-                        PartitionCols:_col1
-                        Select Operator [SEL_11] (rows=525/319 width=178)
-                          Output:["_col1"]
-                          Group By Operator [GBY_10] (rows=525/319 width=178)
-                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                          <-Union 2 [SIMPLE_EDGE]
-                            <-Map 1 [CONTAINS] llap
-                              Reduce Output Operator [RS_9]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_2] (rows=25/25 width=175)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_71] (rows=25/25 
width=175)
-                                    predicate:value is not null
-                                    TableScan [TS_0] (rows=25/25 width=175)
-                                      Output:["key","value"]
-                            <-Map 8 [CONTAINS] llap
-                              Reduce Output Operator [RS_9]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_5] (rows=500/500 
width=178)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_72] (rows=500/500 
width=178)
-                                    predicate:value is not null
-                                    TableScan [TS_3] (rows=500/500 width=178)
-                                      Output:["key","value"]
+                    Merge Join Operator [MERGEJOIN_78] (rows=39/37 width=175)
+                      
Conds:RS_43._col0=RS_44._col0(Inner),Output:["_col1","_col2"]
+                    <-Map 1 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_43]
+                        PartitionCols:_col0
+                         Please refer to the previous Select Operator [SEL_2]
+                    <-Map 8 [SIMPLE_EDGE] llap
+                      SHUFFLE [RS_44]
+                        PartitionCols:_col0
+                         Please refer to the previous Select Operator [SEL_5]
 
 PREHOOK: query: SELECT x.key, y.value
 FROM src1 x JOIN src y ON (x.key = y.key) 
@@ -229,249 +224,234 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Union 2 (CONTAINS)
-Map 10 <- Union 2 (CONTAINS)
-Map 17 <- Union 18 (CONTAINS)
-Map 22 <- Union 18 (CONTAINS)
-Map 23 <- Union 20 (CONTAINS)
-Map 25 <- Union 26 (CONTAINS)
-Map 32 <- Union 26 (CONTAINS)
-Map 33 <- Union 28 (CONTAINS)
-Map 34 <- Union 30 (CONTAINS)
-Reducer 12 <- Map 11 (SIMPLE_EDGE), Reducer 21 (SIMPLE_EDGE)
-Reducer 13 <- Map 24 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE), Union 6 
(CONTAINS)
-Reducer 14 <- Map 11 (SIMPLE_EDGE), Reducer 31 (SIMPLE_EDGE)
-Reducer 15 <- Map 16 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE), Union 8 
(CONTAINS)
-Reducer 19 <- Union 18 (SIMPLE_EDGE), Union 20 (CONTAINS)
-Reducer 21 <- Union 20 (SIMPLE_EDGE)
+Map 12 <- Union 13 (CONTAINS)
+Map 15 <- Union 13 (CONTAINS)
+Map 16 <- Union 17 (CONTAINS)
+Map 21 <- Union 17 (CONTAINS)
+Map 22 <- Union 19 (CONTAINS)
+Map 23 <- Union 24 (CONTAINS)
+Map 30 <- Union 24 (CONTAINS)
+Map 31 <- Union 26 (CONTAINS)
+Map 32 <- Union 28 (CONTAINS)
+Reducer 10 <- Reducer 20 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 14 <- Union 13 (SIMPLE_EDGE)
+Reducer 18 <- Union 17 (SIMPLE_EDGE), Union 19 (CONTAINS)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
+Reducer 20 <- Union 19 (SIMPLE_EDGE)
+Reducer 25 <- Union 24 (SIMPLE_EDGE), Union 26 (CONTAINS)
 Reducer 27 <- Union 26 (SIMPLE_EDGE), Union 28 (CONTAINS)
-Reducer 29 <- Union 28 (SIMPLE_EDGE), Union 30 (CONTAINS)
-Reducer 3 <- Union 2 (SIMPLE_EDGE)
-Reducer 31 <- Union 30 (SIMPLE_EDGE)
-Reducer 4 <- Map 11 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 16 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE), Union 6 (CONTAINS)
-Reducer 7 <- Union 6 (SIMPLE_EDGE), Union 8 (CONTAINS)
-Reducer 9 <- Union 8 (SIMPLE_EDGE)
+Reducer 29 <- Union 28 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 14 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 5 <- Union 4 (SIMPLE_EDGE), Union 6 (CONTAINS)
+Reducer 7 <- Union 6 (SIMPLE_EDGE)
+Reducer 8 <- Reducer 2 (SIMPLE_EDGE), Reducer 29 (SIMPLE_EDGE), Union 6 
(CONTAINS)
+Reducer 9 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 9 llap
+      Reducer 7 llap
       File Output Operator [FS_114]
-        Group By Operator [GBY_112] (rows=398/15 width=177)
+        Group By Operator [GBY_112] (rows=384/15 width=177)
           Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-        <-Union 8 [SIMPLE_EDGE]
-          <-Reducer 15 [CONTAINS] llap
-            Reduce Output Operator [RS_111]
-              PartitionCols:_col0, _col1
-              Select Operator [SEL_107] (rows=199/61 width=177)
-                Output:["_col0","_col1"]
-                Merge Join Operator [MERGEJOIN_162] (rows=199/61 width=177)
-                  
Conds:RS_104._col2=RS_105._col0(Inner),Output:["_col2","_col5"]
-                <-Map 16 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_105]
-                    PartitionCols:_col0
-                    Select Operator [SEL_17] (rows=500/500 width=178)
-                      Output:["_col0","_col1"]
-                      Filter Operator [FIL_145] (rows=500/500 width=178)
-                        predicate:key is not null
-                        TableScan [TS_15] (rows=500/500 width=178)
-                          
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                <-Reducer 14 [SIMPLE_EDGE] llap
-                  SHUFFLE [RS_104]
-                    PartitionCols:_col2
-                    Merge Join Operator [MERGEJOIN_161] (rows=123/52 width=86)
-                      Conds:RS_101._col1=RS_102._col1(Inner),Output:["_col2"]
-                    <-Map 11 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_102]
-                        PartitionCols:_col1
-                        Select Operator [SEL_14] (rows=25/25 width=175)
-                          Output:["_col0","_col1"]
-                          Filter Operator [FIL_144] (rows=25/25 width=175)
-                            predicate:(key is not null and value is not null)
-                            TableScan [TS_12] (rows=25/25 width=175)
-                              
default@src1,x,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                    <-Reducer 31 [SIMPLE_EDGE] llap
-                      SHUFFLE [RS_101]
-                        PartitionCols:_col1
-                        Select Operator [SEL_94] (rows=1525/319 width=178)
-                          Output:["_col1"]
-                          Group By Operator [GBY_93] (rows=1525/319 width=178)
-                            Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                          <-Union 30 [SIMPLE_EDGE]
-                            <-Map 34 [CONTAINS] llap
-                              Reduce Output Operator [RS_92]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_88] (rows=500/500 
width=178)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_154] (rows=500/500 
width=178)
-                                    predicate:value is not null
-                                    TableScan [TS_86] (rows=500/500 width=178)
-                                      Output:["key","value"]
-                            <-Reducer 29 [CONTAINS] llap
-                              Reduce Output Operator [RS_92]
-                                PartitionCols:_col1, _col0
-                                Select Operator [SEL_85] (rows=1025/319 
width=178)
-                                  Output:["_col0","_col1"]
-                                  Group By Operator [GBY_84] (rows=1025/319 
width=178)
-                                    Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
-                                  <-Union 28 [SIMPLE_EDGE]
-                                    <-Map 33 [CONTAINS] llap
-                                      Reduce Output Operator [RS_83]
-                                        PartitionCols:_col1, _col0
-                                        Select Operator [SEL_79] (rows=500/500 
width=178)
-                                          Output:["_col0","_col1"]
-                                          Filter Operator [FIL_153] 
(rows=500/500 width=178)
-                                            predicate:value is not null
-                                            TableScan [TS_77] (rows=500/500 
width=178)
-                                              Output:["key","value"]
-                                    <-Reducer 27 [CONTAINS] llap
-                                      Reduce Output Operator [RS_83]
-                                        PartitionCols:_col1, _col0
-                                        Select Operator [SEL_76] (rows=525/319 
width=178)
-                                          Output:["_col0","_col1"]
-                                          Group By Operator [GBY_75] 
(rows=525/319 width=178)
-                                            
Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                          <-Union 26 [SIMPLE_EDGE]
-                                            <-Map 25 [CONTAINS] llap
-                                              Reduce Output Operator [RS_74]
-                                                PartitionCols:_col1, _col0
-                                                Select Operator [SEL_67] 
(rows=25/25 width=175)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_151] 
(rows=25/25 width=175)
-                                                    predicate:value is not null
-                                                    TableScan [TS_65] 
(rows=25/25 width=175)
-                                                      Output:["key","value"]
-                                            <-Map 32 [CONTAINS] llap
-                                              Reduce Output Operator [RS_74]
-                                                PartitionCols:_col1, _col0
-                                                Select Operator [SEL_70] 
(rows=500/500 width=178)
-                                                  Output:["_col0","_col1"]
-                                                  Filter Operator [FIL_152] 
(rows=500/500 width=178)
-                                                    predicate:value is not null
-                                                    TableScan [TS_68] 
(rows=500/500 width=178)
-                                                      Output:["key","value"]
-          <-Reducer 7 [CONTAINS] llap
+        <-Union 6 [SIMPLE_EDGE]
+          <-Reducer 5 [CONTAINS] llap
             Reduce Output Operator [RS_111]
               PartitionCols:_col0, _col1
-              Group By Operator [GBY_63] (rows=199/15 width=177)
+              Group By Operator [GBY_63] (rows=196/15 width=177)
                 Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-              <-Union 6 [SIMPLE_EDGE]
-                <-Reducer 13 [CONTAINS] llap
+              <-Union 4 [SIMPLE_EDGE]
+                <-Reducer 10 [CONTAINS] llap
                   Reduce Output Operator [RS_62]
                     PartitionCols:_col0, _col1
-                    Select Operator [SEL_58] (rows=132/61 width=177)
+                    Select Operator [SEL_58] (rows=130/61 width=177)
                       Output:["_col0","_col1"]
-                      Merge Join Operator [MERGEJOIN_160] (rows=132/61 
width=177)
-                        
Conds:RS_55._col2=RS_56._col0(Inner),Output:["_col2","_col5"]
-                      <-Map 24 [SIMPLE_EDGE] llap
+                      Merge Join Operator [MERGEJOIN_155] (rows=130/61 
width=177)
+                        
Conds:RS_55._col3=RS_56._col1(Inner),Output:["_col1","_col2"]
+                      <-Reducer 20 [SIMPLE_EDGE] llap
                         SHUFFLE [RS_56]
-                          PartitionCols:_col0
-                          Select Operator [SEL_51] (rows=500/500 width=178)
-                            Output:["_col0","_col1"]
-                            Filter Operator [FIL_150] (rows=500/500 width=178)
-                              predicate:key is not null
-                              TableScan [TS_49] (rows=500/500 width=178)
-                                
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                      <-Reducer 12 [SIMPLE_EDGE] llap
+                          PartitionCols:_col1
+                          Select Operator [SEL_51] (rows=1025/319 width=178)
+                            Output:["_col1"]
+                            Group By Operator [GBY_50] (rows=1025/319 
width=178)
+                              Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
+                            <-Union 19 [SIMPLE_EDGE]
+                              <-Map 22 [CONTAINS] llap
+                                Reduce Output Operator [RS_49]
+                                  PartitionCols:_col1, _col0
+                                  Select Operator [SEL_45] (rows=500/500 
width=178)
+                                    Output:["_col0","_col1"]
+                                    Filter Operator [FIL_144] (rows=500/500 
width=178)
+                                      predicate:value is not null
+                                      TableScan [TS_43] (rows=500/500 
width=178)
+                                        Output:["key","value"]
+                              <-Reducer 18 [CONTAINS] llap
+                                Reduce Output Operator [RS_49]
+                                  PartitionCols:_col1, _col0
+                                  Select Operator [SEL_42] (rows=525/319 
width=178)
+                                    Output:["_col0","_col1"]
+                                    Group By Operator [GBY_41] (rows=525/319 
width=178)
+                                      Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
+                                    <-Union 17 [SIMPLE_EDGE]
+                                      <-Map 16 [CONTAINS] llap
+                                        Reduce Output Operator [RS_40]
+                                          PartitionCols:_col1, _col0
+                                          Select Operator [SEL_33] (rows=25/25 
width=175)
+                                            Output:["_col0","_col1"]
+                                            Filter Operator [FIL_142] 
(rows=25/25 width=175)
+                                              predicate:value is not null
+                                              TableScan [TS_31] (rows=25/25 
width=175)
+                                                Output:["key","value"]
+                                      <-Map 21 [CONTAINS] llap
+                                        Reduce Output Operator [RS_40]
+                                          PartitionCols:_col1, _col0
+                                          Select Operator [SEL_36] 
(rows=500/500 width=178)
+                                            Output:["_col0","_col1"]
+                                            Filter Operator [FIL_143] 
(rows=500/500 width=178)
+                                              predicate:value is not null
+                                              TableScan [TS_34] (rows=500/500 
width=178)
+                                                Output:["key","value"]
+                      <-Reducer 9 [SIMPLE_EDGE] llap
                         SHUFFLE [RS_55]
-                          PartitionCols:_col2
-                          Merge Join Operator [MERGEJOIN_159] (rows=82/52 
width=86)
-                            
Conds:RS_52._col1=RS_53._col1(Inner),Output:["_col2"]
+                          PartitionCols:_col3
+                          Merge Join Operator [MERGEJOIN_152] (rows=39/37 
width=266)
+                            
Conds:RS_52._col0=RS_53._col0(Inner),Output:["_col1","_col2","_col3"]
+                          <-Map 1 [SIMPLE_EDGE] llap
+                            SHUFFLE [RS_52]
+                              PartitionCols:_col0
+                              Select Operator [SEL_2] (rows=500/500 width=178)
+                                Output:["_col0","_col1"]
+                                Filter Operator [FIL_136] (rows=500/500 
width=178)
+                                  predicate:key is not null
+                                  TableScan [TS_0] (rows=500/500 width=178)
+                                    
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
                           <-Map 11 [SIMPLE_EDGE] llap
                             SHUFFLE [RS_53]
-                              PartitionCols:_col1
-                               Please refer to the previous Select Operator 
[SEL_14]
-                          <-Reducer 21 [SIMPLE_EDGE] llap
-                            SHUFFLE [RS_52]
-                              PartitionCols:_col1
-                              Select Operator [SEL_45] (rows=1025/319 
width=178)
-                                Output:["_col1"]
-                                Group By Operator [GBY_44] (rows=1025/319 
width=178)
-                                  Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
-                                <-Union 20 [SIMPLE_EDGE]
-                                  <-Map 23 [CONTAINS] llap
-                                    Reduce Output Operator [RS_43]
-                                      PartitionCols:_col1, _col0
-                                      Select Operator [SEL_39] (rows=500/500 
width=178)
-                                        Output:["_col0","_col1"]
-                                        Filter Operator [FIL_148] 
(rows=500/500 width=178)
-                                          predicate:value is not null
-                                          TableScan [TS_37] (rows=500/500 
width=178)
-                                            Output:["key","value"]
-                                  <-Reducer 19 [CONTAINS] llap
-                                    Reduce Output Operator [RS_43]
-                                      PartitionCols:_col1, _col0
-                                      Select Operator [SEL_36] (rows=525/319 
width=178)
-                                        Output:["_col0","_col1"]
-                                        Group By Operator [GBY_35] 
(rows=525/319 width=178)
-                                          
Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                        <-Union 18 [SIMPLE_EDGE]
-                                          <-Map 17 [CONTAINS] llap
-                                            Reduce Output Operator [RS_34]
-                                              PartitionCols:_col1, _col0
-                                              Select Operator [SEL_27] 
(rows=25/25 width=175)
-                                                Output:["_col0","_col1"]
-                                                Filter Operator [FIL_146] 
(rows=25/25 width=175)
-                                                  predicate:value is not null
-                                                  TableScan [TS_25] 
(rows=25/25 width=175)
-                                                    Output:["key","value"]
-                                          <-Map 22 [CONTAINS] llap
-                                            Reduce Output Operator [RS_34]
-                                              PartitionCols:_col1, _col0
-                                              Select Operator [SEL_30] 
(rows=500/500 width=178)
-                                                Output:["_col0","_col1"]
-                                                Filter Operator [FIL_147] 
(rows=500/500 width=178)
-                                                  predicate:value is not null
-                                                  TableScan [TS_28] 
(rows=500/500 width=178)
-                                                    Output:["key","value"]
-                <-Reducer 5 [CONTAINS] llap
+                              PartitionCols:_col0
+                              Select Operator [SEL_5] (rows=25/25 width=175)
+                                Output:["_col0","_col1"]
+                                Filter Operator [FIL_137] (rows=25/25 
width=175)
+                                  predicate:(key is not null and value is not 
null)
+                                  TableScan [TS_3] (rows=25/25 width=175)
+                                    
default@src1,x,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                <-Reducer 3 [CONTAINS] llap
                   Reduce Output Operator [RS_62]
                     PartitionCols:_col0, _col1
-                    Select Operator [SEL_24] (rows=67/61 width=177)
+                    Select Operator [SEL_24] (rows=66/61 width=177)
                       Output:["_col0","_col1"]
-                      Merge Join Operator [MERGEJOIN_158] (rows=67/61 
width=177)
-                        
Conds:RS_21._col2=RS_22._col0(Inner),Output:["_col2","_col5"]
-                      <-Map 16 [SIMPLE_EDGE] llap
-                        SHUFFLE [RS_22]
-                          PartitionCols:_col0
-                           Please refer to the previous Select Operator 
[SEL_17]
-                      <-Reducer 4 [SIMPLE_EDGE] llap
+                      Merge Join Operator [MERGEJOIN_154] (rows=66/61 
width=177)
+                        
Conds:RS_21._col3=RS_22._col1(Inner),Output:["_col1","_col2"]
+                      <-Reducer 2 [SIMPLE_EDGE] llap
                         SHUFFLE [RS_21]
-                          PartitionCols:_col2
-                          Merge Join Operator [MERGEJOIN_157] (rows=42/52 
width=86)
-                            
Conds:RS_18._col1=RS_19._col1(Inner),Output:["_col2"]
+                          PartitionCols:_col3
+                          Merge Join Operator [MERGEJOIN_151] (rows=39/37 
width=266)
+                            
Conds:RS_18._col0=RS_19._col0(Inner),Output:["_col1","_col2","_col3"]
+                          <-Map 1 [SIMPLE_EDGE] llap
+                            SHUFFLE [RS_18]
+                              PartitionCols:_col0
+                               Please refer to the previous Select Operator 
[SEL_2]
                           <-Map 11 [SIMPLE_EDGE] llap
                             SHUFFLE [RS_19]
-                              PartitionCols:_col1
-                               Please refer to the previous Select Operator 
[SEL_14]
-                          <-Reducer 3 [SIMPLE_EDGE] llap
-                            SHUFFLE [RS_18]
-                              PartitionCols:_col1
-                              Select Operator [SEL_11] (rows=525/319 width=178)
-                                Output:["_col1"]
-                                Group By Operator [GBY_10] (rows=525/319 
width=178)
-                                  Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
-                                <-Union 2 [SIMPLE_EDGE]
-                                  <-Map 1 [CONTAINS] llap
-                                    Reduce Output Operator [RS_9]
-                                      PartitionCols:_col1, _col0
-                                      Select Operator [SEL_2] (rows=25/25 
width=175)
-                                        Output:["_col0","_col1"]
-                                        Filter Operator [FIL_142] (rows=25/25 
width=175)
-                                          predicate:value is not null
-                                          TableScan [TS_0] (rows=25/25 
width=175)
-                                            Output:["key","value"]
-                                  <-Map 10 [CONTAINS] llap
-                                    Reduce Output Operator [RS_9]
-                                      PartitionCols:_col1, _col0
-                                      Select Operator [SEL_5] (rows=500/500 
width=178)
-                                        Output:["_col0","_col1"]
-                                        Filter Operator [FIL_143] 
(rows=500/500 width=178)
-                                          predicate:value is not null
-                                          TableScan [TS_3] (rows=500/500 
width=178)
-                                            Output:["key","value"]
+                              PartitionCols:_col0
+                               Please refer to the previous Select Operator 
[SEL_5]
+                      <-Reducer 14 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_22]
+                          PartitionCols:_col1
+                          Select Operator [SEL_17] (rows=525/319 width=178)
+                            Output:["_col1"]
+                            Group By Operator [GBY_16] (rows=525/319 width=178)
+                              Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
+                            <-Union 13 [SIMPLE_EDGE]
+                              <-Map 12 [CONTAINS] llap
+                                Reduce Output Operator [RS_15]
+                                  PartitionCols:_col1, _col0
+                                  Select Operator [SEL_8] (rows=25/25 
width=175)
+                                    Output:["_col0","_col1"]
+                                    Filter Operator [FIL_138] (rows=25/25 
width=175)
+                                      predicate:value is not null
+                                      TableScan [TS_6] (rows=25/25 width=175)
+                                        Output:["key","value"]
+                              <-Map 15 [CONTAINS] llap
+                                Reduce Output Operator [RS_15]
+                                  PartitionCols:_col1, _col0
+                                  Select Operator [SEL_11] (rows=500/500 
width=178)
+                                    Output:["_col0","_col1"]
+                                    Filter Operator [FIL_139] (rows=500/500 
width=178)
+                                      predicate:value is not null
+                                      TableScan [TS_9] (rows=500/500 width=178)
+                                        Output:["key","value"]
+          <-Reducer 8 [CONTAINS] llap
+            Reduce Output Operator [RS_111]
+              PartitionCols:_col0, _col1
+              Select Operator [SEL_107] (rows=193/61 width=177)
+                Output:["_col0","_col1"]
+                Merge Join Operator [MERGEJOIN_156] (rows=193/61 width=177)
+                  
Conds:RS_104._col3=RS_105._col1(Inner),Output:["_col1","_col2"]
+                <-Reducer 2 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_104]
+                    PartitionCols:_col3
+                     Please refer to the previous Merge Join Operator 
[MERGEJOIN_151]
+                <-Reducer 29 [SIMPLE_EDGE] llap
+                  SHUFFLE [RS_105]
+                    PartitionCols:_col1
+                    Select Operator [SEL_100] (rows=1525/319 width=178)
+                      Output:["_col1"]
+                      Group By Operator [GBY_99] (rows=1525/319 width=178)
+                        Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                      <-Union 28 [SIMPLE_EDGE]
+                        <-Map 32 [CONTAINS] llap
+                          Reduce Output Operator [RS_98]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_94] (rows=500/500 width=178)
+                              Output:["_col0","_col1"]
+                              Filter Operator [FIL_150] (rows=500/500 
width=178)
+                                predicate:value is not null
+                                TableScan [TS_92] (rows=500/500 width=178)
+                                  Output:["key","value"]
+                        <-Reducer 27 [CONTAINS] llap
+                          Reduce Output Operator [RS_98]
+                            PartitionCols:_col1, _col0
+                            Select Operator [SEL_91] (rows=1025/319 width=178)
+                              Output:["_col0","_col1"]
+                              Group By Operator [GBY_90] (rows=1025/319 
width=178)
+                                Output:["_col0","_col1"],keys:KEY._col0, 
KEY._col1
+                              <-Union 26 [SIMPLE_EDGE]
+                                <-Map 31 [CONTAINS] llap
+                                  Reduce Output Operator [RS_89]
+                                    PartitionCols:_col1, _col0
+                                    Select Operator [SEL_85] (rows=500/500 
width=178)
+                                      Output:["_col0","_col1"]
+                                      Filter Operator [FIL_149] (rows=500/500 
width=178)
+                                        predicate:value is not null
+                                        TableScan [TS_83] (rows=500/500 
width=178)
+                                          Output:["key","value"]
+                                <-Reducer 25 [CONTAINS] llap
+                                  Reduce Output Operator [RS_89]
+                                    PartitionCols:_col1, _col0
+                                    Select Operator [SEL_82] (rows=525/319 
width=178)
+                                      Output:["_col0","_col1"]
+                                      Group By Operator [GBY_81] (rows=525/319 
width=178)
+                                        
Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                      <-Union 24 [SIMPLE_EDGE]
+                                        <-Map 23 [CONTAINS] llap
+                                          Reduce Output Operator [RS_80]
+                                            PartitionCols:_col1, _col0
+                                            Select Operator [SEL_73] 
(rows=25/25 width=175)
+                                              Output:["_col0","_col1"]
+                                              Filter Operator [FIL_147] 
(rows=25/25 width=175)
+                                                predicate:value is not null
+                                                TableScan [TS_71] (rows=25/25 
width=175)
+                                                  Output:["key","value"]
+                                        <-Map 30 [CONTAINS] llap
+                                          Reduce Output Operator [RS_80]
+                                            PartitionCols:_col1, _col0
+                                            Select Operator [SEL_76] 
(rows=500/500 width=178)
+                                              Output:["_col0","_col1"]
+                                              Filter Operator [FIL_148] 
(rows=500/500 width=178)
+                                                predicate:value is not null
+                                                TableScan [TS_74] 
(rows=500/500 width=178)
+                                                  Output:["key","value"]
 
 PREHOOK: query: CREATE TABLE srcbucket_mapjoin_n11(key int, value string) 
partitioned by (ds string) CLUSTERED BY (key) INTO 2 BUCKETS STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
@@ -629,7 +609,7 @@ Stage-0
     Stage-1
       Map 1 llap
       File Output Operator [FS_10]
-        Merge Join Operator [MERGEJOIN_15] (rows=382/480 width=95)
+        Merge Join Operator [MERGEJOIN_15] (rows=401/480 width=95)
           Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0","_col1"]
         <-Select Operator [SEL_5] (rows=242/242 width=4)
             Output:["_col0"]
@@ -664,41 +644,48 @@ Plan optimized by CBO.
 
 Vertex dependency in root stage
 Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
+Reducer 3 <- Map 5 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 2 llap
+      Reducer 3 llap
       File Output Operator [FS_16]
-        Merge Join Operator [MERGEJOIN_27] (rows=604/1166 width=95)
-          Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col0","_col1"]
-        <-Map 1 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_12]
-            PartitionCols:_col1
-            Merge Join Operator [MERGEJOIN_25] (rows=382/480 width=95)
-              Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0","_col1"]
-            <-Select Operator [SEL_5] (rows=242/242 width=4)
-                Output:["_col0"]
-                Filter Operator [FIL_23] (rows=242/242 width=4)
-                  predicate:key is not null
-                  TableScan [TS_3] (rows=242/242 width=4)
-                    default@tab_n6,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-            <-Select Operator [SEL_2] (rows=242/242 width=95)
-                Output:["_col0","_col1"]
-                Filter Operator [FIL_22] (rows=242/242 width=95)
-                  predicate:(key is not null and value is not null)
-                  TableScan [TS_0] (rows=242/242 width=95)
-                    
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-        <-Map 4 [SIMPLE_EDGE] llap
+        Merge Join Operator [MERGEJOIN_26] (rows=633/1166 width=95)
+          Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col0","_col1"]
+        <-Map 5 [SIMPLE_EDGE] llap
           SHUFFLE [RS_13]
             PartitionCols:_col0
-            Select Operator [SEL_8] (rows=242/242 width=91)
+            Select Operator [SEL_8] (rows=242/242 width=4)
               Output:["_col0"]
-              Filter Operator [FIL_24] (rows=242/242 width=91)
-                predicate:value is not null
-                TableScan [TS_6] (rows=242/242 width=91)
-                  default@tab_n6,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
+              Filter Operator [FIL_24] (rows=242/242 width=4)
+                predicate:key is not null
+                TableScan [TS_6] (rows=242/242 width=4)
+                  default@tab_n6,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+        <-Reducer 2 [SIMPLE_EDGE] llap
+          SHUFFLE [RS_12]
+            PartitionCols:_col0
+            Merge Join Operator [MERGEJOIN_25] (rows=382/480 width=95)
+              Conds:RS_9._col1=RS_10._col0(Inner),Output:["_col0","_col1"]
+            <-Map 1 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_9]
+                PartitionCols:_col1
+                Select Operator [SEL_2] (rows=242/242 width=95)
+                  Output:["_col0","_col1"]
+                  Filter Operator [FIL_22] (rows=242/242 width=95)
+                    predicate:(key is not null and value is not null)
+                    TableScan [TS_0] (rows=242/242 width=95)
+                      
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+            <-Map 4 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_10]
+                PartitionCols:_col0
+                Select Operator [SEL_5] (rows=242/242 width=91)
+                  Output:["_col0"]
+                  Filter Operator [FIL_23] (rows=242/242 width=91)
+                    predicate:value is not null
+                    TableScan [TS_3] (rows=242/242 width=91)
+                      
default@tab_n6,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
 
 PREHOOK: query: select s1.key as key, s1.value as value from tab_n6 s1 join 
tab2_n3 s3 on s1.key=s3.key
 PREHOOK: type: QUERY
@@ -728,7 +715,7 @@ Stage-0
     Stage-1
       Map 1 llap
       File Output Operator [FS_10]
-        Merge Join Operator [MERGEJOIN_15] (rows=382/480 width=95)
+        Merge Join Operator [MERGEJOIN_15] (rows=401/480 width=95)
           Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0","_col1"]
         <-Select Operator [SEL_5] (rows=242/242 width=4)
             Output:["_col0"]
@@ -767,41 +754,48 @@ Plan optimized by CBO.
 
 Vertex dependency in root stage
 Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 4 (SIMPLE_EDGE)
+Reducer 3 <- Map 5 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 2 llap
+      Reducer 3 llap
       File Output Operator [FS_16]
-        Merge Join Operator [MERGEJOIN_27] (rows=604/1166 width=95)
-          Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col0","_col1"]
-        <-Map 1 [SIMPLE_EDGE] llap
-          SHUFFLE [RS_12]
-            PartitionCols:_col1
-            Merge Join Operator [MERGEJOIN_25] (rows=382/480 width=95)
-              Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0","_col1"]
-            <-Select Operator [SEL_5] (rows=242/242 width=4)
-                Output:["_col0"]
-                Filter Operator [FIL_23] (rows=242/242 width=4)
-                  predicate:key is not null
-                  TableScan [TS_3] (rows=242/242 width=4)
-                    default@tab2_n3,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-            <-Select Operator [SEL_2] (rows=242/242 width=95)
-                Output:["_col0","_col1"]
-                Filter Operator [FIL_22] (rows=242/242 width=95)
-                  predicate:(key is not null and value is not null)
-                  TableScan [TS_0] (rows=242/242 width=95)
-                    
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-        <-Map 4 [SIMPLE_EDGE] llap
+        Merge Join Operator [MERGEJOIN_26] (rows=633/1166 width=95)
+          Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col0","_col1"]
+        <-Map 5 [SIMPLE_EDGE] llap
           SHUFFLE [RS_13]
             PartitionCols:_col0
-            Select Operator [SEL_8] (rows=242/242 width=91)
+            Select Operator [SEL_8] (rows=242/242 width=4)
               Output:["_col0"]
-              Filter Operator [FIL_24] (rows=242/242 width=91)
-                predicate:value is not null
-                TableScan [TS_6] (rows=242/242 width=91)
-                  default@tab2_n3,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
+              Filter Operator [FIL_24] (rows=242/242 width=4)
+                predicate:key is not null
+                TableScan [TS_6] (rows=242/242 width=4)
+                  default@tab2_n3,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+        <-Reducer 2 [SIMPLE_EDGE] llap
+          SHUFFLE [RS_12]
+            PartitionCols:_col0
+            Merge Join Operator [MERGEJOIN_25] (rows=382/480 width=95)
+              Conds:RS_9._col1=RS_10._col0(Inner),Output:["_col0","_col1"]
+            <-Map 1 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_9]
+                PartitionCols:_col1
+                Select Operator [SEL_2] (rows=242/242 width=95)
+                  Output:["_col0","_col1"]
+                  Filter Operator [FIL_22] (rows=242/242 width=95)
+                    predicate:(key is not null and value is not null)
+                    TableScan [TS_0] (rows=242/242 width=95)
+                      
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+            <-Map 4 [SIMPLE_EDGE] llap
+              SHUFFLE [RS_10]
+                PartitionCols:_col0
+                Select Operator [SEL_5] (rows=242/242 width=91)
+                  Output:["_col0"]
+                  Filter Operator [FIL_23] (rows=242/242 width=91)
+                    predicate:value is not null
+                    TableScan [TS_3] (rows=242/242 width=91)
+                      
default@tab2_n3,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
 
 PREHOOK: query: select count(*) from (select s1.key as key, s1.value as value 
from tab_n6 s1 join tab_n6 s3 on s1.key=s3.key
 UNION  ALL
@@ -853,7 +847,7 @@ Stage-0
           Output:["_col0"],aggregations:["count()"]
         <-Reducer 3 [CUSTOM_SIMPLE_EDGE] llap
           PARTITION_ONLY_SHUFFLE [RS_22]
-            Merge Join Operator [MERGEJOIN_38] (rows=1009/1646 width=8)
+            Merge Join Operator [MERGEJOIN_38] (rows=1061/1646 width=8)
               Conds:Union 2._col0=RS_19._col0(Inner)
             <-Map 7 [SIMPLE_EDGE] llap
               SHUFFLE [RS_19]
@@ -868,7 +862,7 @@ Stage-0
               <-Map 1 [CONTAINS] llap
                 Reduce Output Operator [RS_18]
                   PartitionCols:_col0
-                  Merge Join Operator [MERGEJOIN_36] (rows=382/480 width=4)
+                  Merge Join Operator [MERGEJOIN_36] (rows=401/480 width=4)
                     Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0"]
                   <-Select Operator [SEL_5] (rows=242/242 width=4)
                       Output:["_col0"]
@@ -927,24 +921,25 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 8 <- Union 3 (CONTAINS)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE), Union 3 (CONTAINS)
-Reducer 4 <- Map 9 (SIMPLE_EDGE), Union 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 4 (CUSTOM_SIMPLE_EDGE)
+Map 9 <- Union 4 (CONTAINS)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE), Union 4 (CONTAINS)
+Reducer 5 <- Map 10 (SIMPLE_EDGE), Union 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 5 llap
+      Reducer 6 llap
       File Output Operator [FS_31]
         Group By Operator [GBY_29] (rows=1/1 width=8)
           Output:["_col0"],aggregations:["count()"]
-        <-Reducer 4 [CUSTOM_SIMPLE_EDGE] llap
+        <-Reducer 5 [CUSTOM_SIMPLE_EDGE] llap
           PARTITION_ONLY_SHUFFLE [RS_28]
-            Merge Join Operator [MERGEJOIN_50] (rows=1368/3768 width=8)
-              Conds:Union 3._col0=RS_25._col0(Inner)
-            <-Map 9 [SIMPLE_EDGE] llap
+            Merge Join Operator [MERGEJOIN_49] (rows=1443/3768 width=8)
+              Conds:Union 4._col0=RS_25._col0(Inner)
+            <-Map 10 [SIMPLE_EDGE] llap
               SHUFFLE [RS_25]
                 PartitionCols:_col0
                 Select Operator [SEL_23] (rows=500/500 width=4)
@@ -953,8 +948,8 @@ Stage-0
                     predicate:key is not null
                     TableScan [TS_21] (rows=500/500 width=4)
                       
default@tab_part_n7,b_n10,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-            <-Union 3 [SIMPLE_EDGE]
-              <-Map 8 [CONTAINS] llap
+            <-Union 4 [SIMPLE_EDGE]
+              <-Map 9 [CONTAINS] llap
                 Reduce Output Operator [RS_24]
                   PartitionCols:_col0
                   Select Operator [SEL_18] (rows=242/242 width=4)
@@ -963,37 +958,43 @@ Stage-0
                       predicate:key is not null
                       TableScan [TS_16] (rows=242/242 width=4)
                         Output:["key"]
-              <-Reducer 2 [CONTAINS] llap
+              <-Reducer 3 [CONTAINS] llap
                 Reduce Output Operator [RS_24]
                   PartitionCols:_col0
-                  Merge Join Operator [MERGEJOIN_49] (rows=604/1166 width=4)
-                    Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col0"]
-                  <-Map 1 [SIMPLE_EDGE] llap
-                    SHUFFLE [RS_12]
-                      PartitionCols:_col1
-                      Merge Join Operator [MERGEJOIN_47] (rows=382/480 
width=95)
-                        
Conds:SEL_2._col0=SEL_5._col0(Inner),Output:["_col0","_col1"]
-                      <-Select Operator [SEL_5] (rows=242/242 width=4)
-                          Output:["_col0"]
-                          Filter Operator [FIL_43] (rows=242/242 width=4)
-                            predicate:key is not null
-                            TableScan [TS_3] (rows=242/242 width=4)
-                              
default@tab_n6,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
-                      <-Select Operator [SEL_2] (rows=242/242 width=95)
-                          Output:["_col0","_col1"]
-                          Filter Operator [FIL_42] (rows=242/242 width=95)
-                            predicate:(key is not null and value is not null)
-                            TableScan [TS_0] (rows=242/242 width=95)
-                              
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                  <-Map 7 [SIMPLE_EDGE] llap
+                  Merge Join Operator [MERGEJOIN_48] (rows=633/1166 width=4)
+                    Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col0"]
+                  <-Map 8 [SIMPLE_EDGE] llap
                     SHUFFLE [RS_13]
                       PartitionCols:_col0
-                      Select Operator [SEL_8] (rows=242/242 width=91)
+                      Select Operator [SEL_8] (rows=242/242 width=4)
                         Output:["_col0"]
-                        Filter Operator [FIL_44] (rows=242/242 width=91)
-                          predicate:value is not null
-                          TableScan [TS_6] (rows=242/242 width=91)
-                            
default@tab_n6,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
+                        Filter Operator [FIL_44] (rows=242/242 width=4)
+                          predicate:key is not null
+                          TableScan [TS_6] (rows=242/242 width=4)
+                            
default@tab_n6,s3,Tbl:COMPLETE,Col:COMPLETE,Output:["key"]
+                  <-Reducer 2 [SIMPLE_EDGE] llap
+                    SHUFFLE [RS_12]
+                      PartitionCols:_col0
+                      Merge Join Operator [MERGEJOIN_47] (rows=382/480 width=4)
+                        Conds:RS_9._col1=RS_10._col0(Inner),Output:["_col0"]
+                      <-Map 1 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_9]
+                          PartitionCols:_col1
+                          Select Operator [SEL_2] (rows=242/242 width=95)
+                            Output:["_col0","_col1"]
+                            Filter Operator [FIL_42] (rows=242/242 width=95)
+                              predicate:(key is not null and value is not null)
+                              TableScan [TS_0] (rows=242/242 width=95)
+                                
default@tab_n6,s1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                      <-Map 7 [SIMPLE_EDGE] llap
+                        SHUFFLE [RS_10]
+                          PartitionCols:_col0
+                          Select Operator [SEL_5] (rows=242/242 width=91)
+                            Output:["_col0"]
+                            Filter Operator [FIL_43] (rows=242/242 width=91)
+                              predicate:value is not null
+                              TableScan [TS_3] (rows=242/242 width=91)
+                                
default@tab_n6,s2,Tbl:COMPLETE,Col:COMPLETE,Output:["value"]
 
 PREHOOK: query: CREATE TABLE a_n14(key STRING, value STRING) STORED AS TEXTFILE
 PREHOOK: type: CREATETABLE
@@ -1106,24 +1107,24 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Union 2 (CONTAINS)
-Map 16 <- Union 17 (CONTAINS)
-Map 18 <- Union 17 (CONTAINS)
-Map 19 <- Union 17 (CONTAINS)
+Map 13 <- Union 14 (CONTAINS)
+Map 15 <- Union 14 (CONTAINS)
+Map 17 <- Union 18 (CONTAINS)
+Map 19 <- Union 18 (CONTAINS)
+Map 20 <- Union 18 (CONTAINS)
 Map 22 <- Union 23 (CONTAINS)
 Map 24 <- Union 23 (CONTAINS)
 Map 25 <- Union 23 (CONTAINS)
 Map 26 <- Union 23 (CONTAINS)
-Map 9 <- Union 2 (CONTAINS)
 Reducer 11 <- Map 10 (SIMPLE_EDGE), Map 21 (SIMPLE_EDGE)
-Reducer 12 <- Reducer 11 (SIMPLE_EDGE), Union 23 (SIMPLE_EDGE), Union 5 
(CONTAINS)
-Reducer 14 <- Map 13 (SIMPLE_EDGE), Union 17 (SIMPLE_EDGE)
-Reducer 15 <- Map 20 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE), Union 5 
(CONTAINS)
-Reducer 3 <- Map 10 (SIMPLE_EDGE), Union 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE), Union 5 (CONTAINS)
-Reducer 6 <- Union 5 (CUSTOM_SIMPLE_EDGE)
-Reducer 7 <- Union 5 (CUSTOM_SIMPLE_EDGE)
-Reducer 8 <- Union 5 (CUSTOM_SIMPLE_EDGE)
+Reducer 12 <- Reducer 11 (SIMPLE_EDGE), Union 23 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (SIMPLE_EDGE), Union 14 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 5 <- Union 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 6 <- Union 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 7 <- Union 4 (CUSTOM_SIMPLE_EDGE)
+Reducer 8 <- Map 1 (SIMPLE_EDGE), Map 16 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE), Union 18 (SIMPLE_EDGE), Union 4 
(CONTAINS)
 
 Stage-5
   Stats Work{}
@@ -1133,38 +1134,38 @@ Stage-5
         Stage-4
           Dependency Collection{}
             Stage-3
-              Reducer 6 llap
+              Reducer 5 llap
               File Output Operator [FS_5]
                 Group By Operator [GBY_3] (rows=1/1 width=880)
                   
Output:["_col0","_col1"],aggregations:["compute_stats(VALUE._col0, 
'hll')","compute_stats(VALUE._col2, 'hll')"]
-                <-Union 5 [CUSTOM_SIMPLE_EDGE]
+                <-Union 4 [CUSTOM_SIMPLE_EDGE]
                   <-Reducer 12 [CONTAINS] llap
                     File Output Operator [FS_75]
                       table:{"name:":"default.a_n14"}
-                      Select Operator [SEL_72] (rows=192/820 width=175)
+                      Select Operator [SEL_72] (rows=193/820 width=175)
                         Output:["_col0","_col1"]
-                        Merge Join Operator [MERGEJOIN_124] (rows=192/820 
width=175)
+                        Merge Join Operator [MERGEJOIN_121] (rows=193/820 
width=175)
                           Conds:RS_69._col1=Union 
23._col0(Inner),Output:["_col0","_col3"]
                         <-Reducer 11 [SIMPLE_EDGE] llap
                           SHUFFLE [RS_69]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_123] (rows=39/115 
width=264)
+                            Merge Join Operator [MERGEJOIN_118] (rows=39/115 
width=264)
                               
Conds:RS_66._col0=RS_67._col0(Inner),Output:["_col0","_col1","_col3"]
                             <-Map 10 [SIMPLE_EDGE] llap
                               SHUFFLE [RS_66]
                                 PartitionCols:_col0
-                                Select Operator [SEL_10] (rows=25/25 width=175)
+                                Select Operator [SEL_5] (rows=25/25 width=175)
                                   Output:["_col0","_col1"]
-                                  Filter Operator [FIL_106] (rows=25/25 
width=175)
+                                  Filter Operator [FIL_102] (rows=25/25 
width=175)
                                     predicate:(key is not null and value is 
not null)
-                                    TableScan [TS_8] (rows=25/25 width=175)
+                                    TableScan [TS_3] (rows=25/25 width=175)
                                       
default@src1,x,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
                             <-Map 21 [SIMPLE_EDGE] llap
                               SHUFFLE [RS_67]
                                 PartitionCols:_col0
                                 Select Operator [SEL_51] (rows=25/25 width=175)
                                   Output:["_col0","_col1"]
-                                  Filter Operator [FIL_114] (rows=25/25 
width=175)
+                                  Filter Operator [FIL_111] (rows=25/25 
width=175)
                                     predicate:key is not null
                                     TableScan [TS_49] (rows=25/25 width=175)
                                       
default@src1,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
@@ -1174,7 +1175,7 @@ Stage-5
                               PartitionCols:_col0
                               Select Operator [SEL_54] (rows=25/25 width=89)
                                 Output:["_col0"]
-                                Filter Operator [FIL_115] (rows=25/25 width=89)
+                                Filter Operator [FIL_112] (rows=25/25 width=89)
                                   predicate:value is not null
                                   TableScan [TS_52] (rows=25/25 width=89)
                                     Output:["value"]
@@ -1183,7 +1184,7 @@ Stage-5
                               PartitionCols:_col0
                               Select Operator [SEL_57] (rows=500/500 width=91)
                                 Output:["_col0"]
-                                Filter Operator [FIL_116] (rows=500/500 
width=91)
+                                Filter Operator [FIL_113] (rows=500/500 
width=91)
                                   predicate:value is not null
                                   TableScan [TS_55] (rows=500/500 width=91)
                                     Output:["value"]
@@ -1192,7 +1193,7 @@ Stage-5
                               PartitionCols:_col0
                               Select Operator [SEL_61] (rows=500/500 width=91)
                                 Output:["_col0"]
-                                Filter Operator [FIL_117] (rows=500/500 
width=91)
+                                Filter Operator [FIL_114] (rows=500/500 
width=91)
                                   predicate:value is not null
                                   TableScan [TS_59] (rows=500/500 width=91)
                                     Output:["value"]
@@ -1201,175 +1202,175 @@ Stage-5
                               PartitionCols:_col0
                               Select Operator [SEL_64] (rows=500/500 width=91)
                                 Output:["_col0"]
-                                Filter Operator [FIL_118] (rows=500/500 
width=91)
+                                Filter Operator [FIL_115] (rows=500/500 
width=91)
                                   predicate:value is not null
                                   TableScan [TS_62] (rows=500/500 width=91)
                                     Output:["value"]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
                          Please refer to the previous Select Operator [SEL_72]
                     File Output Operator [FS_77]
                       table:{"name:":"default.b_n10"}
                        Please refer to the previous Select Operator [SEL_72]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
                          Please refer to the previous Select Operator [SEL_72]
                     File Output Operator [FS_79]
                       table:{"name:":"default.c_n3"}
                        Please refer to the previous Select Operator [SEL_72]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
                          Please refer to the previous Select Operator [SEL_72]
-                  <-Reducer 15 [CONTAINS] llap
+                  <-Reducer 3 [CONTAINS] llap
                     File Output Operator [FS_75]
                       table:{"name:":"default.a_n14"}
-                      Select Operator [SEL_44] (rows=2682/5421 width=178)
+                      Select Operator [SEL_20] (rows=66/170 width=177)
                         Output:["_col0","_col1"]
-                        Merge Join Operator [MERGEJOIN_122] (rows=2682/5421 
width=178)
-                          
Conds:RS_41._col1=RS_42._col0(Inner),Output:["_col1","_col4"]
-                        <-Map 20 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_42]
-                            PartitionCols:_col0
-                            Select Operator [SEL_37] (rows=500/500 width=178)
-                              Output:["_col0","_col1"]
-                              Filter Operator [FIL_112] (rows=500/500 
width=178)
-                                predicate:key is not null
-                                TableScan [TS_35] (rows=500/500 width=178)
-                                  
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                        <-Reducer 14 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_41]
-                            PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_121] 
(rows=1658/2097 width=87)
-                              Conds:Union 
17._col0=RS_39._col1(Inner),Output:["_col1"]
-                            <-Map 13 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_39]
-                                PartitionCols:_col1
-                                Select Operator [SEL_34] (rows=500/500 
width=178)
+                        Merge Join Operator [MERGEJOIN_119] (rows=66/170 
width=177)
+                          Conds:RS_17._col3=Union 
14._col0(Inner),Output:["_col1","_col2"]
+                        <-Reducer 2 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_17]
+                            PartitionCols:_col3
+                            Merge Join Operator [MERGEJOIN_116] (rows=39/37 
width=266)
+                              
Conds:RS_14._col0=RS_15._col0(Inner),Output:["_col1","_col2","_col3"]
+                            <-Map 1 [SIMPLE_EDGE] llap
+                              SHUFFLE [RS_14]
+                                PartitionCols:_col0
+                                Select Operator [SEL_2] (rows=500/500 
width=178)
                                   Output:["_col0","_col1"]
-                                  Filter Operator [FIL_111] (rows=500/500 
width=178)
-                                    predicate:(key is not null and value is 
not null)
-                                    TableScan [TS_11] (rows=500/500 width=178)
+                                  Filter Operator [FIL_101] (rows=500/500 
width=178)
+                                    predicate:key is not null
+                                    TableScan [TS_0] (rows=500/500 width=178)
                                       
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                            <-Union 17 [SIMPLE_EDGE]
-                              <-Map 16 [CONTAINS] llap
-                                Reduce Output Operator [RS_38]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_23] (rows=25/25 
width=89)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_108] (rows=25/25 
width=89)
-                                      predicate:value is not null
-                                      TableScan [TS_21] (rows=25/25 width=89)
-                                        Output:["value"]
-                              <-Map 18 [CONTAINS] llap
-                                Reduce Output Operator [RS_38]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_26] (rows=500/500 
width=91)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_109] (rows=500/500 
width=91)
-                                      predicate:value is not null
-                                      TableScan [TS_24] (rows=500/500 width=91)
-                                        Output:["value"]
-                              <-Map 19 [CONTAINS] llap
-                                Reduce Output Operator [RS_38]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_30] (rows=500/500 
width=91)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_110] (rows=500/500 
width=91)
-                                      predicate:value is not null
-                                      TableScan [TS_28] (rows=500/500 width=91)
-                                        Output:["value"]
+                            <-Map 10 [SIMPLE_EDGE] llap
+                              SHUFFLE [RS_15]
+                                PartitionCols:_col0
+                                 Please refer to the previous Select Operator 
[SEL_5]
+                        <-Union 14 [SIMPLE_EDGE]
+                          <-Map 13 [CONTAINS] llap
+                            Reduce Output Operator [RS_18]
+                              PartitionCols:_col0
+                              Select Operator [SEL_8] (rows=25/25 width=89)
+                                Output:["_col0"]
+                                Filter Operator [FIL_103] (rows=25/25 width=89)
+                                  predicate:value is not null
+                                  TableScan [TS_6] (rows=25/25 width=89)
+                                    Output:["value"]
+                          <-Map 15 [CONTAINS] llap
+                            Reduce Output Operator [RS_18]
+                              PartitionCols:_col0
+                              Select Operator [SEL_11] (rows=500/500 width=91)
+                                Output:["_col0"]
+                                Filter Operator [FIL_104] (rows=500/500 
width=91)
+                                  predicate:value is not null
+                                  TableScan [TS_9] (rows=500/500 width=91)
+                                    Output:["value"]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_44]
+                         Please refer to the previous Select Operator [SEL_20]
                     File Output Operator [FS_77]
                       table:{"name:":"default.b_n10"}
-                       Please refer to the previous Select Operator [SEL_44]
+                       Please refer to the previous Select Operator [SEL_20]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_44]
+                         Please refer to the previous Select Operator [SEL_20]
                     File Output Operator [FS_79]
                       table:{"name:":"default.c_n3"}
-                       Please refer to the previous Select Operator [SEL_44]
+                       Please refer to the previous Select Operator [SEL_20]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_44]
-                  <-Reducer 4 [CONTAINS] llap
+                         Please refer to the previous Select Operator [SEL_20]
+                  <-Reducer 9 [CONTAINS] llap
                     File Output Operator [FS_75]
                       table:{"name:":"default.a_n14"}
-                      Select Operator [SEL_20] (rows=67/170 width=177)
+                      Select Operator [SEL_44] (rows=2640/5421 width=178)
                         Output:["_col0","_col1"]
-                        Merge Join Operator [MERGEJOIN_120] (rows=67/170 
width=177)
-                          
Conds:RS_17._col1=RS_18._col0(Inner),Output:["_col1","_col4"]
-                        <-Map 13 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_18]
-                            PartitionCols:_col0
-                            Select Operator [SEL_13] (rows=500/500 width=178)
-                              Output:["_col0","_col1"]
-                              Filter Operator [FIL_107] (rows=500/500 
width=178)
-                                predicate:key is not null
-                                 Please refer to the previous TableScan [TS_11]
-                        <-Reducer 3 [SIMPLE_EDGE] llap
-                          SHUFFLE [RS_17]
+                        Merge Join Operator [MERGEJOIN_120] (rows=2640/5421 
width=178)
+                          Conds:RS_41._col1=Union 
18._col0(Inner),Output:["_col0","_col3"]
+                        <-Reducer 8 [SIMPLE_EDGE] llap
+                          SHUFFLE [RS_41]
                             PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_119] (rows=42/108 
width=86)
-                              Conds:Union 
2._col0=RS_15._col1(Inner),Output:["_col1"]
-                            <-Map 10 [SIMPLE_EDGE] llap
-                              SHUFFLE [RS_15]
-                                PartitionCols:_col1
-                                 Please refer to the previous Select Operator 
[SEL_10]
-                            <-Union 2 [SIMPLE_EDGE]
-                              <-Map 1 [CONTAINS] llap
-                                Reduce Output Operator [RS_14]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_2] (rows=25/25 width=89)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_104] (rows=25/25 
width=89)
-                                      predicate:value is not null
-                                      TableScan [TS_0] (rows=25/25 width=89)
-                                        Output:["value"]
-                              <-Map 9 [CONTAINS] llap
-                                Reduce Output Operator [RS_14]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_5] (rows=500/500 
width=91)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_105] (rows=500/500 
width=91)
-                                      predicate:value is not null
-                                      TableScan [TS_3] (rows=500/500 width=91)
-                                        Output:["value"]
+                            Merge Join Operator [MERGEJOIN_117] (rows=791/1028 
width=269)
+                              
Conds:RS_38._col0=RS_39._col0(Inner),Output:["_col0","_col1","_col3"]
+                            <-Map 1 [SIMPLE_EDGE] llap
+                              SHUFFLE [RS_38]
+                                PartitionCols:_col0
+                                Select Operator [SEL_23] (rows=500/500 
width=178)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_105] (rows=500/500 
width=178)
+                                    predicate:(key is not null and value is 
not null)
+                                     Please refer to the previous TableScan 
[TS_0]
+                            <-Map 16 [SIMPLE_EDGE] llap
+                              SHUFFLE [RS_39]
+                                PartitionCols:_col0
+                                Select Operator [SEL_26] (rows=500/500 
width=178)
+                                  Output:["_col0","_col1"]
+                                  Filter Operator [FIL_106] (rows=500/500 
width=178)
+                                    predicate:key is not null
+                                    TableScan [TS_24] (rows=500/500 width=178)
+                                      
default@src,y,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                        <-Union 18 [SIMPLE_EDGE]
+                          <-Map 17 [CONTAINS] llap
+                            Reduce Output Operator [RS_42]
+                              PartitionCols:_col0
+                              Select Operator [SEL_29] (rows=25/25 width=89)
+                                Output:["_col0"]
+                                Filter Operator [FIL_107] (rows=25/25 width=89)
+                                  predicate:value is not null
+                                  TableScan [TS_27] (rows=25/25 width=89)
+                                    Output:["value"]
+                          <-Map 19 [CONTAINS] llap
+                            Reduce Output Operator [RS_42]
+                              PartitionCols:_col0
+                              Select Operator [SEL_32] (rows=500/500 width=91)
+                                Output:["_col0"]
+                                Filter Operator [FIL_108] (rows=500/500 
width=91)
+                                  predicate:value is not null
+                                  TableScan [TS_30] (rows=500/500 width=91)
+                                    Output:["value"]
+                          <-Map 20 [CONTAINS] llap
+                            Reduce Output Operator [RS_42]
+                              PartitionCols:_col0
+                              Select Operator [SEL_36] (rows=500/500 width=91)
+                                Output:["_col0"]
+                                Filter Operator [FIL_109] (rows=500/500 
width=91)
+                                  predicate:value is not null
+                                  TableScan [TS_34] (rows=500/500 width=91)
+                                    Output:["value"]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_20]
+                         Please refer to the previous Select Operator [SEL_44]
                     File Output Operator [FS_77]
                       table:{"name:":"default.b_n10"}
-                       Please refer to the previous Select Operator [SEL_20]
+                       Please refer to the previous Select Operator [SEL_44]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_20]
+                         Please refer to the previous Select Operator [SEL_44]
                     File Output Operator [FS_79]
                       table:{"name:":"default.c_n3"}
-                       Please refer to the previous Select Operator [SEL_20]
+                       Please refer to the previous Select Operator [SEL_44]
                     Reduce Output Operator [RS_2]
-                      Select Operator [SEL_1] (rows=2941/6411 width=178)
+                      Select Operator [SEL_1] (rows=2899/6411 width=178)
                         Output:["key","value"]
-                         Please refer to the previous Select Operator [SEL_20]
-              Reducer 7 llap
+                         Please refer to the previous Select Operator [SEL_44]
+              Reducer 6 llap
               File Output Operator [FS_5]
                 Group By Operator [GBY_3] (rows=1/1 width=880)
                   
Output:["_col0","_col1"],aggregations:["compute_stats(VALUE._col0, 
'hll')","compute_stats(VALUE._col2, 'hll')"]
-                <- Please refer to the previous Union 5 [CUSTOM_SIMPLE_EDGE]
-              Reducer 8 llap
+                <- Please refer to the previous Union 4 [CUSTOM_SIMPLE_EDGE]
+              Reducer 7 llap
               File Output Operator [FS_5]
                 Group By Operator [GBY_3] (rows=1/1 width=880)
                   
Output:["_col0","_col1"],aggregations:["compute_stats(VALUE._col0, 
'hll')","compute_stats(VALUE._col2, 'hll')"]
-                <- Please refer to the previous Union 5 [CUSTOM_SIMPLE_EDGE]
+                <- Please refer to the previous Union 4 [CUSTOM_SIMPLE_EDGE]
 Stage-6
   Stats Work{}
     Stage-1
@@ -1458,32 +1459,32 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Union 2 (CONTAINS)
-Map 13 <- Union 2 (CONTAINS)
-Map 20 <- Union 21 (CONTAINS)
-Map 25 <- Union 21 (CONTAINS)
-Map 26 <- Union 23 (CONTAINS)
+Map 16 <- Union 17 (CONTAINS)
+Map 19 <- Union 17 (CONTAINS)
+Map 21 <- Union 22 (CONTAINS)
+Map 26 <- Union 22 (CONTAINS)
+Map 27 <- Union 24 (CONTAINS)
 Map 29 <- Union 30 (CONTAINS)
 Map 36 <- Union 30 (CONTAINS)
 Map 37 <- Union 32 (CONTAINS)
 Map 38 <- Union 34 (CONTAINS)
-Reducer 10 <- Reducer 9 (CUSTOM_SIMPLE_EDGE)
-Reducer 11 <- Reducer 9 (CUSTOM_SIMPLE_EDGE)
-Reducer 12 <- Reducer 9 (CUSTOM_SIMPLE_EDGE)
-Reducer 15 <- Map 14 (SIMPLE_EDGE), Map 28 (SIMPLE_EDGE)
-Reducer 16 <- Reducer 15 (SIMPLE_EDGE), Reducer 35 (SIMPLE_EDGE), Union 8 
(CONTAINS)
-Reducer 18 <- Map 17 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
-Reducer 19 <- Map 27 (SIMPLE_EDGE), Reducer 18 (SIMPLE_EDGE), Union 6 
(CONTAINS)
-Reducer 22 <- Union 21 (SIMPLE_EDGE), Union 23 (CONTAINS)
-Reducer 24 <- Union 23 (SIMPLE_EDGE)
-Reducer 3 <- Union 2 (SIMPLE_EDGE)
+Reducer 10 <- Reducer 7 (CUSTOM_SIMPLE_EDGE)
+Reducer 11 <- Map 1 (SIMPLE_EDGE), Map 20 (SIMPLE_EDGE)
+Reducer 12 <- Reducer 11 (SIMPLE_EDGE), Reducer 25 (SIMPLE_EDGE), Union 4 
(CONTAINS)
+Reducer 14 <- Map 13 (SIMPLE_EDGE), Map 28 (SIMPLE_EDGE)
+Reducer 15 <- Reducer 14 (SIMPLE_EDGE), Reducer 35 (SIMPLE_EDGE), Union 6 
(CONTAINS)
+Reducer 18 <- Union 17 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 13 (SIMPLE_EDGE)
+Reducer 23 <- Union 22 (SIMPLE_EDGE), Union 24 (CONTAINS)
+Reducer 25 <- Union 24 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 18 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE), Union 4 
(CONTAINS)
 Reducer 31 <- Union 30 (SIMPLE_EDGE), Union 32 (CONTAINS)
 Reducer 33 <- Union 32 (SIMPLE_EDGE), Union 34 (CONTAINS)
 Reducer 35 <- Union 34 (SIMPLE_EDGE)
-Reducer 4 <- Map 14 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 17 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE), Union 6 (CONTAINS)
-Reducer 7 <- Union 6 (SIMPLE_EDGE), Union 8 (CONTAINS)
-Reducer 9 <- Union 8 (SIMPLE_EDGE)
+Reducer 5 <- Union 4 (SIMPLE_EDGE), Union 6 (CONTAINS)
+Reducer 7 <- Union 6 (SIMPLE_EDGE)
+Reducer 8 <- Reducer 7 (CUSTOM_SIMPLE_EDGE)
+Reducer 9 <- Reducer 7 (CUSTOM_SIMPLE_EDGE)
 
 Stage-5
   Stats Work{}
@@ -1497,40 +1498,40 @@ Stage-5
               File Output Operator [FS_5]
                 Group By Operator [GBY_3] (rows=1/1 width=880)
                   
Output:["_col0","_col1"],aggregations:["compute_stats(VALUE._col0, 
'hll')","compute_stats(VALUE._col2, 'hll')"]
-                <-Reducer 9 [CUSTOM_SIMPLE_EDGE] llap
+                <-Reducer 7 [CUSTOM_SIMPLE_EDGE] llap
                   PARTITION_ONLY_SHUFFLE [RS_2]
-                    Select Operator [SEL_1] (rows=2941/319 width=178)
+                    Select Operator [SEL_1] (rows=2899/319 width=178)
                       Output:["key","value"]
-                      Group By Operator [GBY_112] (rows=2941/319 width=178)
+                      Group By Operator [GBY_112] (rows=2899/319 width=178)
                         Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                      <-Union 8 [SIMPLE_EDGE]
-                        <-Reducer 16 [CONTAINS] llap
+                      <-Union 6 [SIMPLE_EDGE]
+                        <-Reducer 15 [CONTAINS] llap
                           Reduce Output Operator [RS_111]
                             PartitionCols:_col0, _col1
-                            Select Operator [SEL_107] (rows=192/304 width=175)
+                            Select Operator [SEL_107] (rows=193/304 width=175)
                               Output:["_col0","_col1"]
-                              Merge Join Operator [MERGEJOIN_164] 
(rows=192/304 width=175)
+                              Merge Join Operator [MERGEJOIN_161] 
(rows=193/304 width=175)
                                 
Conds:RS_104._col1=RS_105._col1(Inner),Output:["_col0","_col3"]
-                              <-Reducer 15 [SIMPLE_EDGE] llap
+                              <-Reducer 14 [SIMPLE_EDGE] llap
                                 SHUFFLE [RS_104]
                                   PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_163] 
(rows=39/115 width=264)
+                                  Merge Join Operator [MERGEJOIN_158] 
(rows=39/115 width=264)
                                     
Conds:RS_101._col0=RS_102._col0(Inner),Output:["_col0","_col1","_col3"]
-                                  <-Map 14 [SIMPLE_EDGE] llap
+                                  <-Map 13 [SIMPLE_EDGE] llap
                                     SHUFFLE [RS_101]
                                       PartitionCols:_col0
-                                      Select Operator [SEL_14] (rows=25/25 
width=175)
+                                      Select Operator [SEL_5] (rows=25/25 
width=175)
                                         Output:["_col0","_col1"]
-                                        Filter Operator [FIL_146] (rows=25/25 
width=175)
+         

<TRUNCATED>

Reply via email to