You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2014/11/25 14:03:23 UTC

svn commit: r1641614 [29/43] - in /hive/branches/spark: itests/src/test/resources/ ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/ ql/src/java/org/apache/hadoop/hive/ql/optimizer/spark/ ql/src/java/org/apache/hadoop/hive/ql/parse/spark/ ql/sr...

Modified: hive/branches/spark/ql/src/test/results/clientpositive/spark/semijoin.q.out
URL: http://svn.apache.org/viewvc/hive/branches/spark/ql/src/test/results/clientpositive/spark/semijoin.q.out?rev=1641614&r1=1641613&r2=1641614&view=diff
==============================================================================
--- hive/branches/spark/ql/src/test/results/clientpositive/spark/semijoin.q.out (original)
+++ hive/branches/spark/ql/src/test/results/clientpositive/spark/semijoin.q.out Tue Nov 25 13:03:18 2014
@@ -119,15 +119,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t1 a left semi join t2 b on a.key=b.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -147,12 +145,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -160,30 +169,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -225,15 +233,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t2 a left semi join t1 b on b.key=a.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -253,12 +259,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -266,30 +283,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -333,15 +349,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t1 a left semi join t4 b on b.key=a.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -361,12 +375,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -374,30 +399,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -433,15 +457,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.value from t1 a left semi join t3 b on (b.key = a.key and b.key < '15') sort by a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -461,12 +483,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0, _col1
                         Statistics: Num rows: 7 Data size: 51 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col1 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col1 (type: int)
-                          Statistics: Num rows: 7 Data size: 51 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col1 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -474,30 +507,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {VALUE._col0}
-                  1 
-                outputColumnNames: _col1
-                Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col1 (type: string)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col1 (type: int)
+                      outputColumnNames: _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: string)
+                          sort order: +
+                          Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -544,15 +576,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t1 a left semi join t2 b on a.key = b.key and b.value < "val_10" sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -572,12 +602,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0, _col1
                         Statistics: Num rows: 2 Data size: 15 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 2 Data size: 15 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -585,30 +626,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -647,32 +687,16 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.value from t1 a left semi join (select key from t3 where key > 5) b on a.key = b.key sort by a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
-        Map 1 
-            Map Operator Tree:
-                TableScan
-                  alias: a
-                  Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Map 4 
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: t3
@@ -689,31 +713,55 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 7 Data size: 51 Basic stats: COMPLETE Column stats: NONE
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: a
+                  Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: key is not null (type: boolean)
+                    Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col1
+                      input vertices:
+                        1 Map 3
+                      Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
                         Reduce Output Operator
-                          key expressions: _col0 (type: int)
+                          key expressions: _col0 (type: string)
                           sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 7 Data size: 51 Basic stats: COMPLETE Column stats: NONE
+                          Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 2 
             Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {VALUE._col0}
-                  1 
-                outputColumnNames: _col1
-                Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col1 (type: string)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE Column stats: NONE
-        Reducer 3 
-            Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: string)
                 outputColumnNames: _col0
@@ -750,15 +798,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.value from t1 a left semi join (select key , value from t2 where key > 5) b on a.key = b.key and b.value <= 'val_20' sort by a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -778,12 +824,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0, _col1
                         Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 1 Data size: 7 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -791,30 +848,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {VALUE._col0}
-                  1 
-                outputColumnNames: _col1
-                Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col1 (type: string)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: string)
-                    sort order: +
-                    Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: string)
+                          sort order: +
+                          Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -850,15 +906,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t2 a left semi join (select key , value from t1 where key > 2) b on a.key = b.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -878,12 +932,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 3 Data size: 21 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 3 Data size: 21 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -891,30 +956,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 49 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -955,15 +1019,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select /*+ mapjoin(b) */ a.key from t3 a left semi join t1 b on a.key = b.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -983,12 +1045,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -996,29 +1069,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                outputColumnNames: _col0
-                Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                      outputColumnNames: _col0
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int)
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int)
+                          sort order: +
+                          Statistics: Num rows: 12 Data size: 89 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -1073,15 +1146,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t1 a left semi join t2 b on a.key = 2*b.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -1101,12 +1172,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: (2 * _col0) (type: int)
-                          sort order: +
-                          Map-reduce partition columns: (2 * _col0) (type: int)
-                          Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 (2 * _col0) (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -1114,30 +1196,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int)
+                        1 (2 * _col0) (type: int)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 47 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -1177,32 +1258,16 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t1 a join t2 b on a.key = b.key left semi join t3 c on b.key = c.key sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
-        Map 1 
-            Map Operator Tree:
-                TableScan
-                  alias: b
-                  Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-                  Filter Operator
-                    predicate: key is not null (type: boolean)
-                    Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
-        Map 4 
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: c
@@ -1219,12 +1284,18 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 {key} {value}
+                            2 
+                          keys:
+                            0 key (type: int)
+                            1 key (type: int)
+                            2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 4 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -1232,35 +1303,62 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                      value expressions: value (type: string)
+                    Spark HashTable Sink Operator
+                      condition expressions:
+                        0 {value}
+                        1 {key} {value}
+                        2 
+                      keys:
+                        0 key (type: int)
+                        1 key (type: int)
+                        2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: b
+                  Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: key is not null (type: boolean)
+                    Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Inner Join 0 to 1
+                           Left Semi Join 1 to 2
+                      condition expressions:
+                        0 {key} {value}
+                        1 {key} {value}
+                        2 
+                      keys:
+                        0 key (type: int)
+                        1 key (type: int)
+                        2 _col0 (type: int)
+                      outputColumnNames: _col0, _col1, _col5, _col6
+                      input vertices:
+                        0 Map 4
+                        2 Map 3
+                      Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string), _col5 (type: int), _col6 (type: string)
+                        outputColumnNames: _col0, _col1, _col2, _col3
+                        Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col2 (type: int), _col3 (type: string)
+            Local Work:
+              Map Reduce Local Work
         Reducer 2 
             Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Inner Join 0 to 1
-                     Left Semi Join 1 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {VALUE._col0}
-                  1 {KEY.reducesinkkey0} {VALUE._col0}
-                  2 
-                outputColumnNames: _col0, _col1, _col5, _col6
-                Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string), _col5 (type: int), _col6 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3
-                  Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-                    value expressions: _col2 (type: int), _col3 (type: string)
-        Reducer 3 
-            Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int), KEY.reducesinkkey1 (type: string), VALUE._col0 (type: int), VALUE._col1 (type: string)
                 outputColumnNames: _col0, _col1, _col2, _col3
@@ -1310,15 +1408,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select * from t3 a left semi join t1 b on a.key = b.key and a.value=b.value sort by a.key, a.value
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -1338,12 +1434,23 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0, _col1
                         Statistics: Num rows: 3 Data size: 21 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int), _col1 (type: string)
-                          sort order: ++
-                          Map-reduce partition columns: _col0 (type: int), _col1 (type: string)
-                          Statistics: Num rows: 3 Data size: 21 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int), value (type: string)
+                            1 _col0 (type: int), _col1 (type: string)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -1351,29 +1458,29 @@ STAGE PLANS:
                   Filter Operator
                     predicate: (key is not null and value is not null) (type: boolean)
                     Statistics: Num rows: 6 Data size: 44 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int), value (type: string)
-                      sort order: ++
-                      Map-reduce partition columns: key (type: int), value (type: string)
-                      Statistics: Num rows: 6 Data size: 44 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                condition expressions:
-                  0 {KEY.reducesinkkey0} {KEY.reducesinkkey1}
-                  1 
-                outputColumnNames: _col0, _col1
-                Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int), _col1 (type: string)
-                  outputColumnNames: _col0, _col1
-                  Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: string)
-                    sort order: ++
-                    Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                      condition expressions:
+                        0 {key} {value}
+                        1 
+                      keys:
+                        0 key (type: int), value (type: string)
+                        1 _col0 (type: int), _col1 (type: string)
+                      outputColumnNames: _col0, _col1
+                      input vertices:
+                        1 Map 1
+                      Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int), _col1 (type: string)
+                        outputColumnNames: _col0, _col1
+                        Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int), _col1 (type: string)
+                          sort order: ++
+                          Statistics: Num rows: 6 Data size: 48 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -1423,15 +1530,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select /*+ mapjoin(b, c) */ a.key from t3 a left semi join t1 b on a.key = b.key left semi join t2 c on a.key = c.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -1451,12 +1556,18 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 43 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key}
+                            1 
+                            2 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+                            2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: c
@@ -1473,12 +1584,25 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key}
+                            1 
+                            2 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+                            2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -1486,32 +1610,34 @@ STAGE PLANS:
                   Filter Operator
                     predicate: key is not null (type: boolean)
                     Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-                    Reduce Output Operator
-                      key expressions: key (type: int)
-                      sort order: +
-                      Map-reduce partition columns: key (type: int)
-                      Statistics: Num rows: 11 Data size: 81 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                     Left Semi Join 0 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                  2 
-                outputColumnNames: _col0
-                Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
-                    Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
-        Reducer 3 
+                    Map Join Operator
+                      condition map:
+                           Left Semi Join 0 to 1
+                           Left Semi Join 0 to 2
+                      condition expressions:
+                        0 {key}
+                        1 
+                        2 
+                      keys:
+                        0 key (type: int)
+                        1 _col0 (type: int)
+                        2 _col0 (type: int)
+                      outputColumnNames: _col0
+                      input vertices:
+                        1 Map 1
+                        2 Map 2
+                      Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+                      Select Operator
+                        expressions: _col0 (type: int)
+                        outputColumnNames: _col0
+                        Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: int)
+                          sort order: +
+                          Statistics: Num rows: 24 Data size: 178 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
+        Reducer 4 
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int)
@@ -1562,15 +1688,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.key from t3 a left outer join t1 b on a.key = b.key left semi join t2 c on b.key = c.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -1578,12 +1702,18 @@ STAGE PLANS:
                 TableScan
                   alias: b
                   Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                  Spark HashTable Sink Operator
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 key (type: int)
+                      2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: c
@@ -1597,42 +1727,57 @@ STAGE PLANS:
                       mode: hash
                       outputColumnNames: _col0
                       Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                      Spark HashTable Sink Operator
+                        condition expressions:
+                          0 {key}
+                          1 
+                          2 
+                        keys:
+                          0 key (type: int)
+                          1 key (type: int)
+                          2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Outer Join0 to 1
-                     Left Semi Join 1 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                  2 
-                outputColumnNames: _col0
-                Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
+                  Map Join Operator
+                    condition map:
+                         Left Outer Join0 to 1
+                         Left Semi Join 1 to 2
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 key (type: int)
+                      2 _col0 (type: int)
+                    outputColumnNames: _col0
+                    input vertices:
+                      1 Map 1
+                      2 Map 2
                     Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-        Reducer 3 
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
+        Reducer 4 
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int)
@@ -1695,28 +1840,16 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.key from t1 a right outer join t3 b on a.key = b.key left semi join t2 c on b.key = c.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
-        Map 1 
-            Map Operator Tree:
-                TableScan
-                  alias: b
-                  Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: c
@@ -1730,42 +1863,73 @@ STAGE PLANS:
                       mode: hash
                       outputColumnNames: _col0
                       Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                      Spark HashTable Sink Operator
+                        condition expressions:
+                          0 {key}
+                          1 
+                          2 
+                        keys:
+                          0 key (type: int)
+                          1 key (type: int)
+                          2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 4 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Right Outer Join0 to 1
-                     Left Semi Join 1 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                  2 
-                outputColumnNames: _col0
-                Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
+                  Spark HashTable Sink Operator
+                    condition expressions:
+                      0 
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 key (type: int)
+                      2 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: b
+                  Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
+                  Map Join Operator
+                    condition map:
+                         Right Outer Join0 to 1
+                         Left Semi Join 1 to 2
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 key (type: int)
+                      2 _col0 (type: int)
+                    outputColumnNames: _col0
+                    input vertices:
+                      0 Map 4
+                      2 Map 3
                     Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-        Reducer 3 
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
+        Reducer 2 
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int)
@@ -1967,15 +2131,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.key from t3 a left semi join t2 b on a.key = b.key left outer join t1 c on a.key = c.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -1992,52 +2154,73 @@ STAGE PLANS:
                       mode: hash
                       outputColumnNames: _col0
                       Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-        Map 4 
+                      Spark HashTable Sink Operator
+                        condition expressions:
+                          0 {key}
+                          1 
+                          2 
+                        keys:
+                          0 key (type: int)
+                          1 _col0 (type: int)
+                          2 key (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: c
                   Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                  Spark HashTable Sink Operator
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 _col0 (type: int)
+                      2 key (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
                   Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                     Left Outer Join0 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                  2 
-                outputColumnNames: _col0
-                Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
+                  Map Join Operator
+                    condition map:
+                         Left Semi Join 0 to 1
+                         Left Outer Join0 to 2
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 _col0 (type: int)
+                      2 key (type: int)
+                    outputColumnNames: _col0
+                    input vertices:
+                      1 Map 1
+                      2 Map 2
                     Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-        Reducer 3 
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
+        Reducer 4 
             Reduce Operator Tree:
               Select Operator
                 expressions: KEY.reducesinkkey0 (type: int)
@@ -2103,15 +2286,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.key from t3 a left semi join t2 b on a.key = b.key right outer join t1 c on a.key = c.key sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 4 (PARTITION-LEVEL SORT, 1), Map 5 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Reducer 2 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -2128,51 +2309,72 @@ STAGE PLANS:
                       mode: hash
                       outputColumnNames: _col0
                       Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col0 (type: int)
-                        sort order: +
-                        Map-reduce partition columns: _col0 (type: int)
-                        Statistics: Num rows: 11 Data size: 84 Basic stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        condition expressions:
+                          0 {key}
+                          1 
+                          2 
+                        keys:
+                          0 key (type: int)
+                          1 _col0 (type: int)
+                          2 key (type: int)
+            Local Work:
+              Map Reduce Local Work
         Map 4 
             Map Operator Tree:
                 TableScan
-                  alias: c
-                  Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
-            Map Operator Tree:
-                TableScan
                   alias: a
                   Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: key (type: int)
-                    sort order: +
-                    Map-reduce partition columns: key (type: int)
-                    Statistics: Num rows: 22 Data size: 163 Basic stats: COMPLETE Column stats: NONE
-        Reducer 2 
-            Reduce Operator Tree:
-              Join Operator
-                condition map:
-                     Left Semi Join 0 to 1
-                     Right Outer Join0 to 2
-                condition expressions:
-                  0 {KEY.reducesinkkey0}
-                  1 
-                  2 
-                outputColumnNames: _col0
-                Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: int)
-                  outputColumnNames: _col0
-                  Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: _col0 (type: int)
-                    sort order: +
+                  Spark HashTable Sink Operator
+                    condition expressions:
+                      0 
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 _col0 (type: int)
+                      2 key (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 3 <- Map 2 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 2 
+            Map Operator Tree:
+                TableScan
+                  alias: c
+                  Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
+                  Map Join Operator
+                    condition map:
+                         Left Semi Join 0 to 1
+                         Right Outer Join0 to 2
+                    condition expressions:
+                      0 {key}
+                      1 
+                      2 
+                    keys:
+                      0 key (type: int)
+                      1 _col0 (type: int)
+                      2 key (type: int)
+                    outputColumnNames: _col0
+                    input vertices:
+                      0 Map 4
+                      1 Map 1
                     Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: _col0 (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Statistics: Num rows: 48 Data size: 358 Basic stats: COMPLETE Column stats: NONE
+            Local Work:
+              Map Reduce Local Work
         Reducer 3 
             Reduce Operator Tree:
               Select Operator
@@ -2390,16 +2592,13 @@ PREHOOK: type: QUERY
 POSTHOOK: query: explain select a.key from t3 a left semi join t2 b on a.key = b.key left outer join t1 c on a.value = c.value sort by a.key
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
+  Stage-3 is a root stage
+  Stage-1 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-3
     Spark
-      Edges:
-        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 1), Map 6 (PARTITION-LEVEL SORT, 1)
-        Reducer 3 <- Map 5 (PARTITION-LEVEL SORT, 1), Reducer 2 (PARTITION-LEVEL SORT, 1)
-        Reducer 4 <- Reducer 3 (SORT, 1)
 #### A masked pattern was here ####
       Vertices:
         Map 1 
@@ -2419,22 +2618,37 @@ STAGE PLANS:
                         mode: hash
                         outputColumnNames: _col0
                         Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-                        Reduce Output Operator
-                          key expressions: _col0 (type: int)
-                          sort order: +
-                          Map-reduce partition columns: _col0 (type: int)
-                          Statistics: Num rows: 6 Data size: 45 Basic stats: COMPLETE Column stats: NONE
-        Map 5 
+                        Spark HashTable Sink Operator
+                          condition expressions:
+                            0 {key} {value}
+                            1 
+                          keys:
+                            0 key (type: int)
+                            1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 2 
             Map Operator Tree:
                 TableScan
                   alias: c
                   Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-                  Reduce Output Operator
-                    key expressions: value (type: string)
-                    sort order: +
-                    Map-reduce partition columns: value (type: string)
-                    Statistics: Num rows: 11 Data size: 79 Basic stats: COMPLETE Column stats: NONE
-        Map 6 
+                  Spark HashTable Sink Operator
+                    condition expressions:
+                      0 {_col0}
+                      1 
+                    keys:
+                      0 _col1 (type: string)
+                      1 value (type: string)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 3 
             Map Operator Tree:
                 TableScan
                   alias: a
@@ -2442,46 +2656,42 @@ STAGE PLANS:

[... 189 lines stripped ...]