You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by am...@apache.org on 2013/04/26 06:59:58 UTC

svn commit: r1476039 [16/22] - in /hive/branches/HIVE-4115: ./ beeline/ beeline/src/java/org/apache/hive/beeline/ bin/ builtins/ cli/ common/src/java/org/apache/hadoop/hive/conf/ conf/ data/files/ eclipse-templates/ hbase-handler/ hbase-handler/src/jav...

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_2.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_2.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_2.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_2.q.out Fri Apr 26 04:59:50 2013
@@ -286,18 +286,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value)))) (TOK_WHERE (and (TOK_FUNCTION TOK_ISNOTNULL (. (TOK_TABLE_OR_COL a) ds)) (= (. (TOK_TABLE_OR_COL b) ds) '1')))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -330,6 +358,8 @@ STAGE PLANS:
                         type: int
                         expr: _col1
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -356,6 +386,128 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1, _col6
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: concat(_col1, _col6)
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1, _col6
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: concat(_col1, _col6)
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1')
 SELECT a.key, concat(a.value, b.value) 
@@ -1176,12 +1328,47 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME test_table1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value))) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '1')))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME test_table2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value))) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '1')))) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (+ (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL a) key))) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value))))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b:test_table2 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b:test_table2 
+          TableScan
+            alias: test_table2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              HashTable Sink Operator
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a:test_table1 
@@ -1194,7 +1381,7 @@ STAGE PLANS:
                     expr: value
                     type: string
               outputColumnNames: _col0, _col1
-              Sorted Merge Bucket Map Join Operator
+              Map Join Operator
                 condition map:
                      Inner Join 0 to 1
                 condition expressions:
@@ -1227,6 +1414,8 @@ STAGE PLANS:
                           type: int
                           expr: _col1
                           type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -1253,6 +1442,149 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a:test_table1 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a:test_table1 
+          TableScan
+            alias: test_table1
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              HashTable Sink Operator
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b:test_table2 
+          TableScan
+            alias: test_table2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                outputColumnNames: _col0, _col1, _col3
+                Position of Big Table: 1
+                Select Operator
+                  expressions:
+                        expr: (_col0 + _col0)
+                        type: int
+                        expr: concat(_col1, _col3)
+                        type: string
+                  outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions:
+                          expr: _col0
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: _col0
+                          type: int
+                    tag: -1
+                    value expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:test_table1 
+          TableScan
+            alias: test_table1
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              Sorted Merge Bucket Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                outputColumnNames: _col0, _col1, _col3
+                Position of Big Table: 0
+                Select Operator
+                  expressions:
+                        expr: (_col0 + _col0)
+                        type: int
+                        expr: concat(_col1, _col3)
+                        type: string
+                  outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions:
+                          expr: _col0
+                          type: int
+                    sort order: +
+                    Map-reduce partition columns:
+                          expr: _col0
+                          type: int
+                    tag: -1
+                    value expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1')
 SELECT a.key+a.key, concat(a.value, b.value) 

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_4.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_4.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_4.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_4.q.out Fri Apr 26 04:59:50 2013
@@ -267,18 +267,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) value))) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL a) ds) '1') (= (. (TOK_TABLE_OR_COL b) ds) '1')))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -311,6 +339,8 @@ STAGE PLANS:
                         type: int
                         expr: _col1
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -337,6 +367,128 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: _col1
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col1
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col1
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: _col1
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col1
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col1
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1')
 SELECT a.key, a.value

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_5.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_5.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_5.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_5.q.out Fri Apr 26 04:59:50 2013
@@ -71,18 +71,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value)))) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL a) ds) '1') (= (. (TOK_TABLE_OR_COL b) ds) '1')))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -115,6 +143,8 @@ STAGE PLANS:
                         type: int
                         expr: _col1
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -141,6 +171,128 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1, _col6
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: concat(_col1, _col6)
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                  sort order: -
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key]]
+                1 [Column[key]]
+              outputColumnNames: _col0, _col1, _col6
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: concat(_col1, _col6)
+                      type: string
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                  sort order: -
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1')
 SELECT a.key, concat(a.value, b.value) 
@@ -252,12 +404,47 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME test_table1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value))) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '1')))) a) (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME test_table2))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL value))) (TOK_WHERE (= (TOK_TABLE_OR_COL ds) '1')))) b) (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value))))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b:test_table2 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b:test_table2 
+          TableScan
+            alias: test_table2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              HashTable Sink Operator
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a:test_table1 
@@ -270,7 +457,7 @@ STAGE PLANS:
                     expr: value
                     type: string
               outputColumnNames: _col0, _col1
-              Sorted Merge Bucket Map Join Operator
+              Map Join Operator
                 condition map:
                      Inner Join 0 to 1
                 condition expressions:
@@ -303,6 +490,8 @@ STAGE PLANS:
                           type: int
                           expr: _col1
                           type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -329,6 +518,149 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a:test_table1 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a:test_table1 
+          TableScan
+            alias: test_table1
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              HashTable Sink Operator
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b:test_table2 
+          TableScan
+            alias: test_table2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                outputColumnNames: _col0, _col1, _col3
+                Position of Big Table: 1
+                Select Operator
+                  expressions:
+                        expr: _col0
+                        type: int
+                        expr: concat(_col1, _col3)
+                        type: string
+                  outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions:
+                          expr: _col0
+                          type: int
+                    sort order: -
+                    Map-reduce partition columns:
+                          expr: _col0
+                          type: int
+                    tag: -1
+                    value expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:test_table1 
+          TableScan
+            alias: test_table1
+            Select Operator
+              expressions:
+                    expr: key
+                    type: int
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              Sorted Merge Bucket Map Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                condition expressions:
+                  0 {_col0} {_col1}
+                  1 {_col1}
+                handleSkewJoin: false
+                keys:
+                  0 [Column[_col0]]
+                  1 [Column[_col0]]
+                outputColumnNames: _col0, _col1, _col3
+                Position of Big Table: 0
+                Select Operator
+                  expressions:
+                        expr: _col0
+                        type: int
+                        expr: concat(_col1, _col3)
+                        type: string
+                  outputColumnNames: _col0, _col1
+                  Reduce Output Operator
+                    key expressions:
+                          expr: _col0
+                          type: int
+                    sort order: -
+                    Map-reduce partition columns:
+                          expr: _col0
+                          type: int
+                    tag: -1
+                    value expressions:
+                          expr: _col0
+                          type: int
+                          expr: _col1
+                          type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1')
 SELECT a.key, concat(a.value, b.value) 

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_6.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_6.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_6.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/bucketsortoptimize_insert_6.q.out Fri Apr 26 04:59:50 2013
@@ -450,18 +450,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (and (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)) (= (. (TOK_TABLE_OR_COL a) key2) (. (TOK_TABLE_OR_COL b) key2))))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value)))) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL a) ds) '1') (= (. (TOK_TABLE_OR_COL b) ds) '1')))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -502,6 +530,8 @@ STAGE PLANS:
                         type: int
                         expr: _col2
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -528,6 +558,144 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col1
+                      type: int
+                      expr: _col0
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: +-
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col1
+                      type: int
+                      expr: _col0
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: +-
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: -- Insert data into the bucketed table by selecting from another bucketed table
 -- This should be a map-reduce operation
@@ -567,18 +735,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (and (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)) (= (. (TOK_TABLE_OR_COL a) key2) (. (TOK_TABLE_OR_COL b) key2))))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key2)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value)) value)) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL a) ds) '1') (= (. (TOK_TABLE_OR_COL b) ds) '1'))))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table3) (TOK_PARTSPEC (TOK_PARTVAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) key2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) value)))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        subq1:b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        subq1:b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         subq1:a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -619,6 +815,8 @@ STAGE PLANS:
                         type: int
                         expr: _col2
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -645,6 +843,144 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        subq1:a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        subq1:a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        subq1:b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col1
+                      type: int
+                      expr: _col0
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: +-
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        subq1:a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col1
+                      type: int
+                      expr: _col0
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: +-
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table3
+
 
 PREHOOK: query: -- Insert data into the bucketed table by selecting from another bucketed table
 -- This should be a map-only operation
@@ -1173,18 +1509,46 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME test_table1) a) (TOK_TABREF (TOK_TABNAME test_table2) b) (and (= (. (TOK_TABLE_OR_COL a) key) (. (TOK_TABLE_OR_COL b) key)) (= (. (TOK_TABLE_OR_COL a) key2) (. (TOK_TABLE_OR_COL b) key2))))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) key2)) (TOK_SELEXPR (TOK_FUNCTION concat (. (TOK_TABLE_OR_COL a) value) (. (TOK_TABLE_OR_COL b) value)) value)) (TOK_WHERE (and (= (. (TOK_TABLE_OR_COL a) ds) '1') (= (. (TOK_TABLE_OR_COL b) ds) '1'))))) subq1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) key2) k1) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) key) k2) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq1) value))))) subq2)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME test_table4) (TOK_PARTSPEC (TOK_PART
 VAL ds '1')))) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq2) k2)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq2) k1)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL subq2) value)))))
 
 STAGE DEPENDENCIES:
-  Stage-1 is a root stage
-  Stage-0 depends on stages: Stage-1
+  Stage-6 is a root stage , consists of Stage-7, Stage-8, Stage-1
+  Stage-7 has a backup stage: Stage-1
+  Stage-4 depends on stages: Stage-7
+  Stage-0 depends on stages: Stage-1, Stage-4, Stage-5
   Stage-2 depends on stages: Stage-0
+  Stage-8 has a backup stage: Stage-1
+  Stage-5 depends on stages: Stage-8
+  Stage-1
 
 STAGE PLANS:
-  Stage: Stage-1
+  Stage: Stage-6
+    Conditional Operator
+
+  Stage: Stage-7
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        subq2:subq1:b 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        subq2:subq1:b 
+          TableScan
+            alias: b
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 0
+
+  Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
         subq2:subq1:a 
           TableScan
             alias: a
-            Sorted Merge Bucket Map Join Operator
+            Map Join Operator
               condition map:
                    Inner Join 0 to 1
               condition expressions:
@@ -1225,6 +1589,8 @@ STAGE PLANS:
                         type: int
                         expr: _col2
                         type: string
+      Local Work:
+        Map Reduce Local Work
       Reduce Operator Tree:
         Extract
           File Output Operator
@@ -1251,4 +1617,142 @@ STAGE PLANS:
   Stage: Stage-2
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce Local Work
+      Alias -> Map Local Tables:
+        subq2:subq1:a 
+          Fetch Operator
+            limit: -1
+      Alias -> Map Local Operator Tree:
+        subq2:subq1:a 
+          TableScan
+            alias: a
+            HashTable Sink Operator
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              Position of Big Table: 1
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        subq2:subq1:b 
+          TableScan
+            alias: b
+            Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 1
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: _col1
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: --
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Local Work:
+        Map Reduce Local Work
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table4
+
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        subq2:subq1:a 
+          TableScan
+            alias: a
+            Sorted Merge Bucket Map Join Operator
+              condition map:
+                   Inner Join 0 to 1
+              condition expressions:
+                0 {key} {key2} {value}
+                1 {value}
+              handleSkewJoin: false
+              keys:
+                0 [Column[key], Column[key2]]
+                1 [Column[key], Column[key2]]
+              outputColumnNames: _col0, _col1, _col2, _col8
+              Position of Big Table: 0
+              Select Operator
+                expressions:
+                      expr: _col0
+                      type: int
+                      expr: _col1
+                      type: int
+                      expr: concat(_col2, _col8)
+                      type: string
+                outputColumnNames: _col0, _col1, _col2
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  sort order: --
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                  tag: -1
+                  value expressions:
+                        expr: _col0
+                        type: int
+                        expr: _col1
+                        type: int
+                        expr: _col2
+                        type: string
+      Reduce Operator Tree:
+        Extract
+          File Output Operator
+            compressed: false
+            GlobalTableId: 1
+            table:
+                input format: org.apache.hadoop.mapred.TextInputFormat
+                output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                name: default.test_table4
+
 

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_8.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_8.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_8.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/groupby_sort_8.q.out Fri Apr 26 04:59:50 2013
@@ -27,12 +27,14 @@ POSTHOOK: Output: default@t1@ds=1
 POSTHOOK: Lineage: t1 PARTITION(ds=1).key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ]
 POSTHOOK: Lineage: t1 PARTITION(ds=1).val SIMPLE [(t1)t1.FieldSchema(name:val, type:string, comment:null), ]
 PREHOOK: query: -- The plan is not converted to a map-side, since although the sorting columns and grouping
--- columns match, the user is issueing a distinct
+-- columns match, the user is issueing a distinct.
+-- However, after HIVE-4310, partial aggregation is performed on the mapper
 EXPLAIN
 select count(distinct key) from T1
 PREHOOK: type: QUERY
 POSTHOOK: query: -- The plan is not converted to a map-side, since although the sorting columns and grouping
--- columns match, the user is issueing a distinct
+-- columns match, the user is issueing a distinct.
+-- However, after HIVE-4310, partial aggregation is performed on the mapper
 EXPLAIN
 select count(distinct key) from T1
 POSTHOOK: type: QUERY
@@ -78,6 +80,90 @@ STAGE PLANS:
       Reduce Operator Tree:
         Group By Operator
           aggregations:
+                expr: count(VALUE._col0)
+          bucketGroup: false
+          mode: mergepartial
+          outputColumnNames: _col0
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: bigint
+            outputColumnNames: _col0
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: select count(distinct key) from T1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t1@ds=1
+#### A masked pattern was here ####
+POSTHOOK: query: select count(distinct key) from T1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t1@ds=1
+#### A masked pattern was here ####
+POSTHOOK: Lineage: t1 PARTITION(ds=1).key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: t1 PARTITION(ds=1).val SIMPLE [(t1)t1.FieldSchema(name:val, type:string, comment:null), ]
+5
+PREHOOK: query: -- In testmode, the plan is not changed
+EXPLAIN
+select count(distinct key) from T1
+PREHOOK: type: QUERY
+POSTHOOK: query: -- In testmode, the plan is not changed
+EXPLAIN
+select count(distinct key) from T1
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: t1 PARTITION(ds=1).key SIMPLE [(t1)t1.FieldSchema(name:key, type:string, comment:null), ]
+POSTHOOK: Lineage: t1 PARTITION(ds=1).val SIMPLE [(t1)t1.FieldSchema(name:val, type:string, comment:null), ]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME T1))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_TABLE_OR_COL key))))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        t1 
+          TableScan
+            alias: t1
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+              outputColumnNames: key
+              Group By Operator
+                aggregations:
+                      expr: count(DISTINCT key)
+                bucketGroup: false
+                keys:
+                      expr: key
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: bigint
+      Reduce Operator Tree:
+        Group By Operator
+          aggregations:
                 expr: count(DISTINCT KEY._col0:0._col0)
           bucketGroup: false
           mode: mergepartial

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view.q.out Fri Apr 26 04:59:50 2013
@@ -34,16 +34,21 @@ STAGE PLANS:
             alias: src
             Lateral View Forward
               Select Operator
-                SELECT * : (no compute)
+                expressions:
+                      expr: key
+                      type: string
+                      expr: value
+                      type: string
+                outputColumnNames: key, value
                 Lateral View Join Operator
-                  outputColumnNames: _col0, _col1, _col2
+                  outputColumnNames: _col0, _col1, _col4
                   Select Operator
                     expressions:
                           expr: _col0
                           type: string
                           expr: _col1
                           type: string
-                          expr: _col2
+                          expr: _col4
                           type: int
                     outputColumnNames: _col0, _col1, _col2
                     Reduce Output Operator
@@ -69,14 +74,14 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col0, _col1, _col2
+                    outputColumnNames: _col0, _col1, _col4
                     Select Operator
                       expressions:
                             expr: _col0
                             type: string
                             expr: _col1
                             type: string
-                            expr: _col2
+                            expr: _col4
                             type: int
                       outputColumnNames: _col0, _col1, _col2
                       Reduce Output Operator
@@ -160,10 +165,10 @@ STAGE PLANS:
             Lateral View Forward
               Select Operator
                 Lateral View Join Operator
-                  outputColumnNames: _col2
+                  outputColumnNames: _col4
                   Select Operator
                     expressions:
-                          expr: _col2
+                          expr: _col4
                           type: int
                     outputColumnNames: _col0
                     Limit
@@ -181,10 +186,10 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col2
+                    outputColumnNames: _col4
                     Select Operator
                       expressions:
-                            expr: _col2
+                            expr: _col4
                             type: int
                       outputColumnNames: _col0
                       Limit
@@ -222,20 +227,20 @@ STAGE PLANS:
             Lateral View Forward
               Select Operator
                 Lateral View Join Operator
-                  outputColumnNames: _col2
+                  outputColumnNames: _col4
                   Lateral View Forward
                     Select Operator
                       expressions:
-                            expr: _col2
+                            expr: _col4
                             type: int
-                      outputColumnNames: _col2
+                      outputColumnNames: _col4
                       Lateral View Join Operator
-                        outputColumnNames: _col2, _col3
+                        outputColumnNames: _col4, _col5
                         Select Operator
                           expressions:
-                                expr: _col2
+                                expr: _col4
                                 type: int
-                                expr: _col3
+                                expr: _col5
                                 type: string
                           outputColumnNames: _col0, _col1
                           Limit
@@ -253,12 +258,12 @@ STAGE PLANS:
                       UDTF Operator
                         function name: explode
                         Lateral View Join Operator
-                          outputColumnNames: _col2, _col3
+                          outputColumnNames: _col4, _col5
                           Select Operator
                             expressions:
-                                  expr: _col2
+                                  expr: _col4
                                   type: int
-                                  expr: _col3
+                                  expr: _col5
                                   type: string
                             outputColumnNames: _col0, _col1
                             Limit
@@ -276,20 +281,20 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col2
+                    outputColumnNames: _col4
                     Lateral View Forward
                       Select Operator
                         expressions:
-                              expr: _col2
+                              expr: _col4
                               type: int
-                        outputColumnNames: _col2
+                        outputColumnNames: _col4
                         Lateral View Join Operator
-                          outputColumnNames: _col2, _col3
+                          outputColumnNames: _col4, _col5
                           Select Operator
                             expressions:
-                                  expr: _col2
+                                  expr: _col4
                                   type: int
-                                  expr: _col3
+                                  expr: _col5
                                   type: string
                             outputColumnNames: _col0, _col1
                             Limit
@@ -307,12 +312,12 @@ STAGE PLANS:
                         UDTF Operator
                           function name: explode
                           Lateral View Join Operator
-                            outputColumnNames: _col2, _col3
+                            outputColumnNames: _col4, _col5
                             Select Operator
                               expressions:
-                                    expr: _col2
+                                    expr: _col4
                                     type: int
-                                    expr: _col3
+                                    expr: _col5
                                     type: string
                               outputColumnNames: _col0, _col1
                               Limit
@@ -350,14 +355,14 @@ STAGE PLANS:
             Lateral View Forward
               Select Operator
                 Lateral View Join Operator
-                  outputColumnNames: _col2
+                  outputColumnNames: _col4
                   Lateral View Forward
                     Select Operator
                       Lateral View Join Operator
-                        outputColumnNames: _col3
+                        outputColumnNames: _col5
                         Select Operator
                           expressions:
-                                expr: _col3
+                                expr: _col5
                                 type: int
                           outputColumnNames: _col0
                           Limit
@@ -369,16 +374,16 @@ STAGE PLANS:
                                   output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                     Select Operator
                       expressions:
-                            expr: _col2
+                            expr: _col4
                             type: array<int>
                       outputColumnNames: _col0
                       UDTF Operator
                         function name: explode
                         Lateral View Join Operator
-                          outputColumnNames: _col3
+                          outputColumnNames: _col5
                           Select Operator
                             expressions:
-                                  expr: _col3
+                                  expr: _col5
                                   type: int
                             outputColumnNames: _col0
                             Limit
@@ -396,14 +401,14 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col2
+                    outputColumnNames: _col4
                     Lateral View Forward
                       Select Operator
                         Lateral View Join Operator
-                          outputColumnNames: _col3
+                          outputColumnNames: _col5
                           Select Operator
                             expressions:
-                                  expr: _col3
+                                  expr: _col5
                                   type: int
                             outputColumnNames: _col0
                             Limit
@@ -415,16 +420,16 @@ STAGE PLANS:
                                     output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
                       Select Operator
                         expressions:
-                              expr: _col2
+                              expr: _col4
                               type: array<int>
                         outputColumnNames: _col0
                         UDTF Operator
                           function name: explode
                           Lateral View Join Operator
-                            outputColumnNames: _col3
+                            outputColumnNames: _col5
                             Select Operator
                               expressions:
-                                    expr: _col3
+                                    expr: _col5
                                     type: int
                               outputColumnNames: _col0
                               Limit
@@ -524,10 +529,10 @@ STAGE PLANS:
             Lateral View Forward
               Select Operator
                 Lateral View Join Operator
-                  outputColumnNames: _col1
+                  outputColumnNames: _col3
                   Select Operator
                     expressions:
-                          expr: _col1
+                          expr: _col3
                           type: int
                     outputColumnNames: _col0
                     Limit
@@ -545,10 +550,10 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col1
+                    outputColumnNames: _col3
                     Select Operator
                       expressions:
-                            expr: _col1
+                            expr: _col3
                             type: int
                       outputColumnNames: _col0
                       Limit

Modified: hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view_ppd.q.out
URL: http://svn.apache.org/viewvc/hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view_ppd.q.out?rev=1476039&r1=1476038&r2=1476039&view=diff
==============================================================================
--- hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view_ppd.q.out (original)
+++ hive/branches/HIVE-4115/ql/src/test/results/clientpositive/lateral_view_ppd.q.out Fri Apr 26 04:59:50 2013
@@ -27,12 +27,12 @@ STAGE PLANS:
                         type: string
                   outputColumnNames: value
                   Lateral View Join Operator
-                    outputColumnNames: _col1, _col2
+                    outputColumnNames: _col1, _col4
                     Select Operator
                       expressions:
                             expr: _col1
                             type: string
-                            expr: _col2
+                            expr: _col4
                             type: int
                       outputColumnNames: _col0, _col1
                       File Output Operator
@@ -49,12 +49,12 @@ STAGE PLANS:
                   UDTF Operator
                     function name: explode
                     Lateral View Join Operator
-                      outputColumnNames: _col1, _col2
+                      outputColumnNames: _col1, _col4
                       Select Operator
                         expressions:
                               expr: _col1
                               type: string
-                              expr: _col2
+                              expr: _col4
                               type: int
                         outputColumnNames: _col0, _col1
                         File Output Operator
@@ -110,18 +110,23 @@ STAGE PLANS:
                   type: boolean
               Lateral View Forward
                 Select Operator
-                  SELECT * : (no compute)
+                  expressions:
+                        expr: key
+                        type: string
+                        expr: value
+                        type: string
+                  outputColumnNames: key, value
                   Lateral View Join Operator
-                    outputColumnNames: _col0, _col1, _col2
+                    outputColumnNames: _col0, _col1, _col4
                     Filter Operator
                       predicate:
-                          expr: ((_col0 = '0') and (_col2 = 1))
+                          expr: ((_col0 = '0') and (_col4 = 1))
                           type: boolean
                       Select Operator
                         expressions:
                               expr: _col1
                               type: string
-                              expr: _col2
+                              expr: _col4
                               type: int
                         outputColumnNames: _col0, _col1
                         File Output Operator
@@ -138,16 +143,16 @@ STAGE PLANS:
                   UDTF Operator
                     function name: explode
                     Lateral View Join Operator
-                      outputColumnNames: _col0, _col1, _col2
+                      outputColumnNames: _col0, _col1, _col4
                       Filter Operator
                         predicate:
-                            expr: ((_col0 = '0') and (_col2 = 1))
+                            expr: ((_col0 = '0') and (_col4 = 1))
                             type: boolean
                         Select Operator
                           expressions:
                                 expr: _col1
                                 type: string
-                                expr: _col2
+                                expr: _col4
                                 type: int
                           outputColumnNames: _col0, _col1
                           File Output Operator
@@ -198,12 +203,12 @@ STAGE PLANS:
                       type: string
                 outputColumnNames: value
                 Lateral View Join Operator
-                  outputColumnNames: _col1, _col4
+                  outputColumnNames: _col1, _col6
                   Select Operator
                     expressions:
                           expr: _col1
                           type: string
-                          expr: _col4
+                          expr: _col6
                           type: int
                     outputColumnNames: _col0, _col1
                     Limit
@@ -221,12 +226,12 @@ STAGE PLANS:
                 UDTF Operator
                   function name: explode
                   Lateral View Join Operator
-                    outputColumnNames: _col1, _col4
+                    outputColumnNames: _col1, _col6
                     Select Operator
                       expressions:
                             expr: _col1
                             type: string
-                            expr: _col4
+                            expr: _col6
                             type: int
                       outputColumnNames: _col0, _col1
                       Limit
@@ -293,22 +298,22 @@ STAGE PLANS:
                         type: string
                   outputColumnNames: value
                   Lateral View Join Operator
-                    outputColumnNames: _col1, _col2
+                    outputColumnNames: _col1, _col4
                     Lateral View Forward
                       Select Operator
                         expressions:
                               expr: _col1
                               type: string
-                              expr: _col2
+                              expr: _col4
                               type: int
-                        outputColumnNames: _col1, _col2
+                        outputColumnNames: _col1, _col4
                         Lateral View Join Operator
-                          outputColumnNames: _col1, _col2, _col3
+                          outputColumnNames: _col1, _col4, _col5
                           Select Operator
                             expressions:
                                   expr: _col1
                                   type: string
-                                  expr: _col2
+                                  expr: _col4
                                   type: int
                             outputColumnNames: _col0, _col1
                             File Output Operator
@@ -325,12 +330,12 @@ STAGE PLANS:
                         UDTF Operator
                           function name: explode
                           Lateral View Join Operator
-                            outputColumnNames: _col1, _col2, _col3
+                            outputColumnNames: _col1, _col4, _col5
                             Select Operator
                               expressions:
                                     expr: _col1
                                     type: string
-                                    expr: _col2
+                                    expr: _col4
                                     type: int
                               outputColumnNames: _col0, _col1
                               File Output Operator
@@ -347,22 +352,22 @@ STAGE PLANS:
                   UDTF Operator
                     function name: explode
                     Lateral View Join Operator
-                      outputColumnNames: _col1, _col2
+                      outputColumnNames: _col1, _col4
                       Lateral View Forward
                         Select Operator
                           expressions:
                                 expr: _col1
                                 type: string
-                                expr: _col2
+                                expr: _col4
                                 type: int
-                          outputColumnNames: _col1, _col2
+                          outputColumnNames: _col1, _col4
                           Lateral View Join Operator
-                            outputColumnNames: _col1, _col2, _col3
+                            outputColumnNames: _col1, _col4, _col5
                             Select Operator
                               expressions:
                                     expr: _col1
                                     type: string
-                                    expr: _col2
+                                    expr: _col4
                                     type: int
                               outputColumnNames: _col0, _col1
                               File Output Operator
@@ -379,12 +384,12 @@ STAGE PLANS:
                           UDTF Operator
                             function name: explode
                             Lateral View Join Operator
-                              outputColumnNames: _col1, _col2, _col3
+                              outputColumnNames: _col1, _col4, _col5
                               Select Operator
                                 expressions:
                                       expr: _col1
                                       type: string
-                                      expr: _col2
+                                      expr: _col4
                                       type: int
                                 outputColumnNames: _col0, _col1
                                 File Output Operator