You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by he...@apache.org on 2011/12/09 00:25:11 UTC

svn commit: r1212182 [3/5] - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/exec/ java/org/apache/hadoop/hive/ql/optimizer/ test/queries/clientpositive/ test/results/clientpositive/

Modified: hive/trunk/ql/src/test/results/clientpositive/union12.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union12.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union12.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union12.q.out Thu Dec  8 23:25:10 2011
@@ -81,81 +81,78 @@ STAGE PLANS:
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-56-25_019_376395372604357845/-mr-10002 
-          TableScan
-            Union
+        file:/tmp/njain/hive_2011-12-07_18-03-10_228_8410433153782064994/-mr-10002 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+              outputColumnNames: _col0, _col1
               Select Operator
                 expressions:
                       expr: _col0
                       type: string
-                      expr: _col1
-                      type: bigint
+                      expr: UDFToInteger(_col1)
+                      type: int
                 outputColumnNames: _col0, _col1
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                        expr: UDFToInteger(_col1)
-                        type: int
-                  outputColumnNames: _col0, _col1
-                  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.tmptable
-        file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-56-25_019_376395372604357845/-mr-10004 
-          TableScan
-            Union
+                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.tmptable
+        file:/tmp/njain/hive_2011-12-07_18-03-10_228_8410433153782064994/-mr-10004 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+              outputColumnNames: _col0, _col1
               Select Operator
                 expressions:
                       expr: _col0
                       type: string
-                      expr: _col1
-                      type: bigint
+                      expr: UDFToInteger(_col1)
+                      type: int
                 outputColumnNames: _col0, _col1
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                        expr: UDFToInteger(_col1)
-                        type: int
-                  outputColumnNames: _col0, _col1
-                  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.tmptable
-        file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-56-25_019_376395372604357845/-mr-10005 
-          TableScan
-            Union
+                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.tmptable
+        file:/tmp/njain/hive_2011-12-07_18-03-10_228_8410433153782064994/-mr-10005 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: bigint
+              outputColumnNames: _col0, _col1
               Select Operator
                 expressions:
                       expr: _col0
                       type: string
-                      expr: _col1
-                      type: bigint
+                      expr: UDFToInteger(_col1)
+                      type: int
                 outputColumnNames: _col0, _col1
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                        expr: UDFToInteger(_col1)
-                        type: int
-                  outputColumnNames: _col0, _col1
-                  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.tmptable
+                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.tmptable
 
   Stage: Stage-6
     Conditional Operator
@@ -164,7 +161,7 @@ STAGE PLANS:
     Move Operator
       files:
           hdfs directory: true
-          destination: pfile:/Users/njain/hive/hive2/build/ql/scratchdir/hive_2011-11-11_10-56-25_019_376395372604357845/-ext-10000
+          destination: pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-03-10_228_8410433153782064994/-ext-10000
 
   Stage: Stage-0
     Move Operator
@@ -182,7 +179,7 @@ STAGE PLANS:
   Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
-        pfile:/Users/njain/hive/hive2/build/ql/scratchdir/hive_2011-11-11_10-56-25_019_376395372604357845/-ext-10003 
+        pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-03-10_228_8410433153782064994/-ext-10003 
             File Output Operator
               compressed: false
               GlobalTableId: 0
@@ -300,11 +297,11 @@ POSTHOOK: Lineage: tmptable.value EXPRES
 PREHOOK: query: select * from tmptable x sort by x.key
 PREHOOK: type: QUERY
 PREHOOK: Input: default@tmptable
-PREHOOK: Output: file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-56-59_422_9146371764111979198/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-24_504_2428324100622025728/-mr-10000
 POSTHOOK: query: select * from tmptable x sort by x.key
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@tmptable
-POSTHOOK: Output: file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-56-59_422_9146371764111979198/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-24_504_2428324100622025728/-mr-10000
 POSTHOOK: Lineage: tmptable.key EXPRESSION []
 POSTHOOK: Lineage: tmptable.value EXPRESSION [(src)s1.null, (src1)s2.null, (srcbucket)s3.null, ]
 tst1	500

Modified: hive/trunk/ql/src/test/results/clientpositive/union14.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union14.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union14.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union14.q.out Thu Dec  8 23:25:10 2011
@@ -18,143 +18,154 @@ ABSTRACT SYNTAX TREE:
   (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_UNION (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src1) s2)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL s2) key) key) (TOK_SELEXPR (. (TOK_TABLE_OR_COL s2) value) value)))) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src) s1)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR 'tst1' key) (TOK_SELEXPR (TOK_FUNCTION TOK_STRING (TOK_FUNCTION count 1)) value))))) unionsrc)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL unionsrc) key)) (TOK_SELEXPR (TOK_FUNCTION count 1))) (TOK_GROUPBY (. (TOK_TABLE_OR_COL unionsrc) key))))
 
 STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-2 depends on stages: Stage-1, Stage-3
   Stage-3 is a root stage
-  Stage-2 depends on stages: Stage-3
   Stage-0 is a root stage
 
 STAGE PLANS:
-  Stage: Stage-3
+  Stage: Stage-1
     Map Reduce
       Alias -> Map Operator Tree:
-        null-subquery2:unionsrc-subquery2:s1 
+        null-subquery1:unionsrc-subquery1:s2 
           TableScan
-            alias: s1
+            alias: s2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-2
+    Map Reduce
+      Alias -> Map Operator Tree:
+        file:/tmp/njain/hive_2011-12-07_18-03-27_983_5817128832919821487/-mr-10002 
+          Union
             Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+              outputColumnNames: _col0
               Group By Operator
                 aggregations:
                       expr: count(1)
                 bucketGroup: false
+                keys:
+                      expr: _col0
+                      type: string
                 mode: hash
-                outputColumnNames: _col0
+                outputColumnNames: _col0, _col1
                 Reduce Output Operator
-                  sort order: 
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: string
                   tag: -1
                   value expressions:
+                        expr: _col1
+                        type: bigint
+        file:/tmp/njain/hive_2011-12-07_18-03-27_983_5817128832919821487/-mr-10003 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+              outputColumnNames: _col0
+              Group By Operator
+                aggregations:
+                      expr: count(1)
+                bucketGroup: false
+                keys:
+                      expr: _col0
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
                         expr: _col0
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col1
                         type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
                 expr: count(VALUE._col0)
           bucketGroup: false
+          keys:
+                expr: KEY._col0
+                type: string
           mode: mergepartial
-          outputColumnNames: _col0
+          outputColumnNames: _col0, _col1
           Select Operator
             expressions:
-                  expr: 'tst1'
-                  type: string
-                  expr: UDFToString(_col0)
+                  expr: _col0
                   type: string
+                  expr: _col1
+                  type: bigint
             outputColumnNames: _col0, _col1
             File Output Operator
               compressed: false
               GlobalTableId: 0
               table:
-                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 
-  Stage: Stage-2
+  Stage: Stage-3
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-57-10_782_8545995354441159380/-mr-10002 
-          TableScan
-            Union
-              Select Operator
-                expressions:
-                      expr: _col0
-                      type: string
-                outputColumnNames: _col0
-                Group By Operator
-                  aggregations:
-                        expr: count(1)
-                  bucketGroup: false
-                  keys:
-                        expr: _col0
-                        type: string
-                  mode: hash
-                  outputColumnNames: _col0, _col1
-                  Reduce Output Operator
-                    key expressions:
-                          expr: _col0
-                          type: string
-                    sort order: +
-                    Map-reduce partition columns:
-                          expr: _col0
-                          type: string
-                    tag: -1
-                    value expressions:
-                          expr: _col1
-                          type: bigint
-        null-subquery1:unionsrc-subquery1:s2 
+        null-subquery2:unionsrc-subquery2:s1 
           TableScan
-            alias: s2
+            alias: s1
             Select Operator
-              expressions:
-                    expr: key
-                    type: string
-                    expr: value
-                    type: string
-              outputColumnNames: _col0, _col1
-              Union
-                Select Operator
-                  expressions:
+              Group By Operator
+                aggregations:
+                      expr: count(1)
+                bucketGroup: false
+                mode: hash
+                outputColumnNames: _col0
+                Reduce Output Operator
+                  sort order: 
+                  tag: -1
+                  value expressions:
                         expr: _col0
-                        type: string
-                  outputColumnNames: _col0
-                  Group By Operator
-                    aggregations:
-                          expr: count(1)
-                    bucketGroup: false
-                    keys:
-                          expr: _col0
-                          type: string
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Reduce Output Operator
-                      key expressions:
-                            expr: _col0
-                            type: string
-                      sort order: +
-                      Map-reduce partition columns:
-                            expr: _col0
-                            type: string
-                      tag: -1
-                      value expressions:
-                            expr: _col1
-                            type: bigint
+                        type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
                 expr: count(VALUE._col0)
           bucketGroup: false
-          keys:
-                expr: KEY._col0
-                type: string
           mode: mergepartial
-          outputColumnNames: _col0, _col1
+          outputColumnNames: _col0
           Select Operator
             expressions:
-                  expr: _col0
+                  expr: 'tst1'
+                  type: string
+                  expr: UDFToString(_col0)
                   type: string
-                  expr: _col1
-                  type: bigint
             outputColumnNames: _col0, _col1
             File Output Operator
               compressed: false
               GlobalTableId: 0
               table:
-                  input format: org.apache.hadoop.mapred.TextInputFormat
-                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
 
   Stage: Stage-0
     Fetch Operator
@@ -168,7 +179,7 @@ PREHOOK: query: select unionsrc.key, cou
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
-PREHOOK: Output: file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-57-10_879_8932885890935655590/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-28_088_661726235931648241/-mr-10000
 POSTHOOK: query: select unionsrc.key, count(1) FROM (select s2.key as key, s2.value as value from src1 s2
                                         UNION  ALL  
                                       select 'tst1' as key, cast(count(1) as string) as value from src s1) 
@@ -176,7 +187,7 @@ POSTHOOK: query: select unionsrc.key, co
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
-POSTHOOK: Output: file:/var/folders/bZ/bZe+iKfoFTuPoShRd6dy6-tOU9Y/-Tmp-/njain/hive_2011-11-11_10-57-10_879_8932885890935655590/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-28_088_661726235931648241/-mr-10000
 	10
 128	1
 146	1

Modified: hive/trunk/ql/src/test/results/clientpositive/union15.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union15.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union15.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union15.q.out Thu Dec  8 23:25:10 2011
@@ -21,7 +21,9 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1
+  Stage-2 depends on stages: Stage-1, Stage-3, Stage-4
+  Stage-3 is a root stage
+  Stage-4 is a root stage
   Stage-0 is a root stage
 
 STAGE PLANS:
@@ -68,109 +70,90 @@ STAGE PLANS:
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-44-21_507_2125703197567872880/-mr-10002 
-          TableScan
-            Union
-              Select Operator
-                expressions:
+        file:/tmp/njain/hive_2011-12-07_18-03-37_668_492706794491473988/-mr-10002 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+              outputColumnNames: _col0
+              Group By Operator
+                aggregations:
+                      expr: count(1)
+                bucketGroup: false
+                keys:
                       expr: _col0
                       type: string
-                outputColumnNames: _col0
-                Group By Operator
-                  aggregations:
-                        expr: count(1)
-                  bucketGroup: false
-                  keys:
-                        expr: _col0
-                        type: string
-                  mode: hash
-                  outputColumnNames: _col0, _col1
-                  Reduce Output Operator
-                    key expressions:
-                          expr: _col0
-                          type: string
-                    sort order: +
-                    Map-reduce partition columns:
-                          expr: _col0
-                          type: string
-                    tag: -1
-                    value expressions:
-                          expr: _col1
-                          type: bigint
-        null-subquery1-subquery2:unionsrc-subquery1-subquery2:s2 
-          TableScan
-            alias: s2
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: bigint
+        file:/tmp/njain/hive_2011-12-07_18-03-37_668_492706794491473988/-mr-10003 
+          Union
             Select Operator
               expressions:
-                    expr: key
+                    expr: _col0
                     type: string
-                    expr: value
-                    type: string
-              outputColumnNames: _col0, _col1
-              Union
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                  outputColumnNames: _col0
-                  Group By Operator
-                    aggregations:
-                          expr: count(1)
-                    bucketGroup: false
-                    keys:
-                          expr: _col0
-                          type: string
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Reduce Output Operator
-                      key expressions:
-                            expr: _col0
-                            type: string
-                      sort order: +
-                      Map-reduce partition columns:
-                            expr: _col0
-                            type: string
-                      tag: -1
-                      value expressions:
-                            expr: _col1
-                            type: bigint
-        null-subquery2:unionsrc-subquery2:s3 
-          TableScan
-            alias: s3
+              outputColumnNames: _col0
+              Group By Operator
+                aggregations:
+                      expr: count(1)
+                bucketGroup: false
+                keys:
+                      expr: _col0
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: bigint
+        file:/tmp/njain/hive_2011-12-07_18-03-37_668_492706794491473988/-mr-10004 
+          Union
             Select Operator
               expressions:
-                    expr: key
+                    expr: _col0
                     type: string
-                    expr: value
-                    type: string
-              outputColumnNames: _col0, _col1
-              Union
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                  outputColumnNames: _col0
-                  Group By Operator
-                    aggregations:
-                          expr: count(1)
-                    bucketGroup: false
-                    keys:
-                          expr: _col0
-                          type: string
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Reduce Output Operator
-                      key expressions:
-                            expr: _col0
-                            type: string
-                      sort order: +
-                      Map-reduce partition columns:
-                            expr: _col0
-                            type: string
-                      tag: -1
-                      value expressions:
-                            expr: _col1
-                            type: bigint
+              outputColumnNames: _col0
+              Group By Operator
+                aggregations:
+                      expr: count(1)
+                bucketGroup: false
+                keys:
+                      expr: _col0
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
+                        expr: _col0
+                        type: string
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
@@ -195,6 +178,46 @@ STAGE PLANS:
                   input format: org.apache.hadoop.mapred.TextInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 
+  Stage: Stage-3
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery1-subquery2:unionsrc-subquery1-subquery2:s2 
+          TableScan
+            alias: s2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-4
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc-subquery2:s3 
+          TableScan
+            alias: s3
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
   Stage: Stage-0
     Fetch Operator
       limit: -1
@@ -208,7 +231,7 @@ PREHOOK: query: select unionsrc.key, cou
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Input: default@src1
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-21_627_586305899053312380/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-37_794_191359379207326828/-mr-10000
 POSTHOOK: query: select unionsrc.key, count(1) FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
                                         UNION  ALL  
                                             select s2.key as key, s2.value as value from src1 s2
@@ -217,7 +240,7 @@ POSTHOOK: query: select unionsrc.key, co
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Input: default@src1
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-21_627_586305899053312380/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-03-37_794_191359379207326828/-mr-10000
 	20
 128	2
 146	2

Modified: hive/trunk/ql/src/test/results/clientpositive/union17.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union17.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union17.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union17.q.out Thu Dec  8 23:25:10 2011
@@ -31,13 +31,14 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-2 is a root stage
-  Stage-3 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-2, Stage-8
   Stage-4 depends on stages: Stage-3
   Stage-0 depends on stages: Stage-4
   Stage-5 depends on stages: Stage-0
   Stage-6 depends on stages: Stage-3
   Stage-1 depends on stages: Stage-6
   Stage-7 depends on stages: Stage-1
+  Stage-8 is a root stage
 
 STAGE PLANS:
   Stage: Stage-2
@@ -83,48 +84,38 @@ STAGE PLANS:
   Stage: Stage-3
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-44-33_959_6338494989611388938/-mr-10004 
-          TableScan
-            Union
-              Reduce Output Operator
-                key expressions:
-                      expr: substr(_col1, 5)
-                      type: string
-                sort order: +
-                Map-reduce partition columns:
-                      expr: substr(_col1, 5)
-                      type: string
-                tag: -1
-                value expressions:
-                      expr: _col0
-                      type: string
-                      expr: _col1
-                      type: string
-        null-subquery2:unionsrc-subquery2:s2 
-          TableScan
-            alias: s2
-            Select Operator
-              expressions:
-                    expr: key
+        file:/tmp/njain/hive_2011-12-07_18-03-50_661_6509786186647589223/-mr-10004 
+          Union
+            Reduce Output Operator
+              key expressions:
+                    expr: substr(_col1, 5)
                     type: string
-                    expr: value
+              sort order: +
+              Map-reduce partition columns:
+                    expr: substr(_col1, 5)
+                    type: string
+              tag: -1
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+        file:/tmp/njain/hive_2011-12-07_18-03-50_661_6509786186647589223/-mr-10007 
+          Union
+            Reduce Output Operator
+              key expressions:
+                    expr: substr(_col1, 5)
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: substr(_col1, 5)
+                    type: string
+              tag: -1
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
                     type: string
-              outputColumnNames: _col0, _col1
-              Union
-                Reduce Output Operator
-                  key expressions:
-                        expr: substr(_col1, 5)
-                        type: string
-                  sort order: +
-                  Map-reduce partition columns:
-                        expr: substr(_col1, 5)
-                        type: string
-                  tag: -1
-                  value expressions:
-                        expr: _col0
-                        type: string
-                        expr: _col1
-                        type: string
       Reduce Operator Tree:
         Forward
           Group By Operator
@@ -163,7 +154,7 @@ STAGE PLANS:
   Stage: Stage-4
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-44-33_959_6338494989611388938/-mr-10005 
+        file:/tmp/njain/hive_2011-12-07_18-03-50_661_6509786186647589223/-mr-10005 
             Reduce Output Operator
               key expressions:
                     expr: _col0
@@ -218,7 +209,7 @@ STAGE PLANS:
   Stage: Stage-6
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-44-33_959_6338494989611388938/-mr-10006 
+        file:/tmp/njain/hive_2011-12-07_18-03-50_661_6509786186647589223/-mr-10006 
             Reduce Output Operator
               key expressions:
                     expr: _col0
@@ -278,6 +269,26 @@ STAGE PLANS:
   Stage: Stage-7
     Stats-Aggr Operator
 
+  Stage: Stage-8
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc-subquery2:s2 
+          TableScan
+            alias: s2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
 
 PREHOOK: query: FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
                          UNION  ALL  
@@ -305,11 +316,11 @@ POSTHOOK: Lineage: dest2.val2 EXPRESSION
 PREHOOK: query: SELECT DEST1.* FROM DEST1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-49_359_8447037142158352093/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-08_648_6904408471110189565/-mr-10000
 POSTHOOK: query: SELECT DEST1.* FROM DEST1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-49_359_8447037142158352093/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-08_648_6904408471110189565/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
@@ -628,11 +639,11 @@ tst1	1
 PREHOOK: query: SELECT DEST2.* FROM DEST2
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest2
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-49_536_8596475375635774367/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-08_883_4325419205851366019/-mr-10000
 POSTHOOK: query: SELECT DEST2.* FROM DEST2
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest2
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-44-49_536_8596475375635774367/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-08_883_4325419205851366019/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]

Modified: hive/trunk/ql/src/test/results/clientpositive/union18.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union18.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union18.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union18.q.out Thu Dec  8 23:25:10 2011
@@ -31,7 +31,7 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-2 is a root stage
-  Stage-3 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-2, Stage-12
   Stage-7 depends on stages: Stage-3 , consists of Stage-6, Stage-5
   Stage-6
   Stage-0 depends on stages: Stage-6, Stage-5
@@ -42,6 +42,7 @@ STAGE DEPENDENCIES:
   Stage-1 depends on stages: Stage-10, Stage-9
   Stage-8 depends on stages: Stage-1
   Stage-9
+  Stage-12 is a root stage
 
 STAGE PLANS:
   Stage: Stage-2
@@ -87,84 +88,74 @@ STAGE PLANS:
   Stage: Stage-3
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-44-50_145_1216043361112817214/-mr-10004 
-          TableScan
-            Union
-              Select Operator
-                expressions:
-                      expr: _col0
-                      type: string
-                      expr: _col1
-                      type: string
-                outputColumnNames: _col0, _col1
-                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.dest1
-              Select Operator
-                expressions:
-                      expr: _col0
-                      type: string
-                      expr: _col1
-                      type: string
-                      expr: _col1
-                      type: string
-                outputColumnNames: _col0, _col1, _col2
-                File Output Operator
-                  compressed: false
-                  GlobalTableId: 2
-                  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.dest2
-        null-subquery2:unionsrc-subquery2:s2 
-          TableScan
-            alias: s2
+        file:/tmp/njain/hive_2011-12-07_18-04-09_626_3143271523364813511/-mr-10004 
+          Union
             Select Operator
               expressions:
-                    expr: key
+                    expr: _col0
                     type: string
-                    expr: value
+                    expr: _col1
                     type: string
               outputColumnNames: _col0, _col1
-              Union
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                        expr: _col1
-                        type: string
-                  outputColumnNames: _col0, _col1
-                  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.dest1
-                Select Operator
-                  expressions:
-                        expr: _col0
-                        type: string
-                        expr: _col1
-                        type: string
-                        expr: _col1
-                        type: string
-                  outputColumnNames: _col0, _col1, _col2
-                  File Output Operator
-                    compressed: false
-                    GlobalTableId: 2
-                    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.dest2
+              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.dest1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1, _col2
+              File Output Operator
+                compressed: false
+                GlobalTableId: 2
+                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.dest2
+        file:/tmp/njain/hive_2011-12-07_18-04-09_626_3143271523364813511/-mr-10007 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1
+              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.dest1
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1, _col2
+              File Output Operator
+                compressed: false
+                GlobalTableId: 2
+                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.dest2
 
   Stage: Stage-7
     Conditional Operator
@@ -173,7 +164,7 @@ STAGE PLANS:
     Move Operator
       files:
           hdfs directory: true
-          destination: pfile:/data/users/njain/hive_commit1/build/ql/scratchdir/hive_2011-11-11_18-44-50_145_1216043361112817214/-ext-10000
+          destination: pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-04-09_626_3143271523364813511/-ext-10000
 
   Stage: Stage-0
     Move Operator
@@ -191,7 +182,7 @@ STAGE PLANS:
   Stage: Stage-5
     Map Reduce
       Alias -> Map Operator Tree:
-        pfile:/data/users/njain/hive_commit1/build/ql/scratchdir/hive_2011-11-11_18-44-50_145_1216043361112817214/-ext-10005 
+        pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-04-09_626_3143271523364813511/-ext-10005 
             File Output Operator
               compressed: false
               GlobalTableId: 0
@@ -208,7 +199,7 @@ STAGE PLANS:
     Move Operator
       files:
           hdfs directory: true
-          destination: pfile:/data/users/njain/hive_commit1/build/ql/scratchdir/hive_2011-11-11_18-44-50_145_1216043361112817214/-ext-10002
+          destination: pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-04-09_626_3143271523364813511/-ext-10002
 
   Stage: Stage-1
     Move Operator
@@ -226,7 +217,7 @@ STAGE PLANS:
   Stage: Stage-9
     Map Reduce
       Alias -> Map Operator Tree:
-        pfile:/data/users/njain/hive_commit1/build/ql/scratchdir/hive_2011-11-11_18-44-50_145_1216043361112817214/-ext-10006 
+        pfile:/data/users/njain/hive_commit2/build/ql/scratchdir/hive_2011-12-07_18-04-09_626_3143271523364813511/-ext-10006 
             File Output Operator
               compressed: false
               GlobalTableId: 0
@@ -236,6 +227,26 @@ STAGE PLANS:
                   serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
                   name: default.dest2
 
+  Stage: Stage-12
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc-subquery2:s2 
+          TableScan
+            alias: s2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
 
 PREHOOK: query: FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
                          UNION  ALL  
@@ -263,11 +274,11 @@ POSTHOOK: Lineage: dest2.val2 EXPRESSION
 PREHOOK: query: SELECT DEST1.* FROM DEST1 SORT BY DEST1.key, DEST1.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-05_088_4825286294412544717/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-23_740_603654379243514671/-mr-10000
 POSTHOOK: query: SELECT DEST1.* FROM DEST1 SORT BY DEST1.key, DEST1.value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-05_088_4825286294412544717/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-23_740_603654379243514671/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
@@ -777,11 +788,11 @@ tst1	500
 PREHOOK: query: SELECT DEST2.* FROM DEST2 SORT BY DEST2.key, DEST2.val1, DEST2.val2
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest2
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-08_648_6682422004742420258/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-26_980_2715436732076711130/-mr-10000
 POSTHOOK: query: SELECT DEST2.* FROM DEST2 SORT BY DEST2.key, DEST2.val1, DEST2.val2
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest2
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-08_648_6682422004742420258/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-26_980_2715436732076711130/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]

Modified: hive/trunk/ql/src/test/results/clientpositive/union19.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union19.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union19.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union19.q.out Thu Dec  8 23:25:10 2011
@@ -31,11 +31,12 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-2 is a root stage
-  Stage-3 depends on stages: Stage-2
+  Stage-3 depends on stages: Stage-2, Stage-6
   Stage-0 depends on stages: Stage-3
   Stage-4 depends on stages: Stage-0
   Stage-1 depends on stages: Stage-3
   Stage-5 depends on stages: Stage-1
+  Stage-6 is a root stage
 
 STAGE PLANS:
   Stage: Stage-2
@@ -81,110 +82,100 @@ STAGE PLANS:
   Stage: Stage-3
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-45-12_312_7781375403068710979/-mr-10004 
-          TableScan
-            Union
-              Select Operator
-                expressions:
+        file:/tmp/njain/hive_2011-12-07_18-04-33_197_8409668105765066267/-mr-10004 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1
+              Group By Operator
+                aggregations:
+                      expr: count(_col1)
+                bucketGroup: false
+                keys:
                       expr: _col0
                       type: string
-                      expr: _col1
-                      type: string
+                mode: hash
                 outputColumnNames: _col0, _col1
-                Group By Operator
-                  aggregations:
-                        expr: count(_col1)
-                  bucketGroup: false
-                  keys:
+                Reduce Output Operator
+                  key expressions:
                         expr: _col0
                         type: string
-                  mode: hash
-                  outputColumnNames: _col0, _col1
-                  Reduce Output Operator
-                    key expressions:
-                          expr: _col0
-                          type: string
-                    sort order: +
-                    Map-reduce partition columns:
-                          expr: _col0
-                          type: string
-                    tag: -1
-                    value expressions:
-                          expr: _col1
-                          type: bigint
-              Select Operator
-                expressions:
-                      expr: _col0
-                      type: string
-                      expr: _col1
-                      type: string
-                      expr: _col1
-                      type: string
-                outputColumnNames: _col0, _col1, _col2
-                File Output Operator
-                  compressed: false
-                  GlobalTableId: 2
-                  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.dest2
-        null-subquery2:unionsrc-subquery2:s2 
-          TableScan
-            alias: s2
+                  sort order: +
+                  Map-reduce partition columns:
+                        expr: _col0
+                        type: string
+                  tag: -1
+                  value expressions:
+                        expr: _col1
+                        type: bigint
             Select Operator
               expressions:
-                    expr: key
+                    expr: _col0
                     type: string
-                    expr: value
+                    expr: _col1
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1, _col2
+              File Output Operator
+                compressed: false
+                GlobalTableId: 2
+                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.dest2
+        file:/tmp/njain/hive_2011-12-07_18-04-33_197_8409668105765066267/-mr-10005 
+          Union
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
                     type: string
               outputColumnNames: _col0, _col1
-              Union
-                Select Operator
-                  expressions:
+              Group By Operator
+                aggregations:
+                      expr: count(_col1)
+                bucketGroup: false
+                keys:
+                      expr: _col0
+                      type: string
+                mode: hash
+                outputColumnNames: _col0, _col1
+                Reduce Output Operator
+                  key expressions:
                         expr: _col0
                         type: string
-                        expr: _col1
-                        type: string
-                  outputColumnNames: _col0, _col1
-                  Group By Operator
-                    aggregations:
-                          expr: count(_col1)
-                    bucketGroup: false
-                    keys:
-                          expr: _col0
-                          type: string
-                    mode: hash
-                    outputColumnNames: _col0, _col1
-                    Reduce Output Operator
-                      key expressions:
-                            expr: _col0
-                            type: string
-                      sort order: +
-                      Map-reduce partition columns:
-                            expr: _col0
-                            type: string
-                      tag: -1
-                      value expressions:
-                            expr: _col1
-                            type: bigint
-                Select Operator
-                  expressions:
+                  sort order: +
+                  Map-reduce partition columns:
                         expr: _col0
                         type: string
+                  tag: -1
+                  value expressions:
                         expr: _col1
-                        type: string
-                        expr: _col1
-                        type: string
-                  outputColumnNames: _col0, _col1, _col2
-                  File Output Operator
-                    compressed: false
-                    GlobalTableId: 2
-                    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.dest2
+                        type: bigint
+            Select Operator
+              expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+                    expr: _col1
+                    type: string
+              outputColumnNames: _col0, _col1, _col2
+              File Output Operator
+                compressed: false
+                GlobalTableId: 2
+                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.dest2
       Reduce Operator Tree:
         Group By Operator
           aggregations:
@@ -237,6 +228,26 @@ STAGE PLANS:
   Stage: Stage-5
     Stats-Aggr Operator
 
+  Stage: Stage-6
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc-subquery2:s2 
+          TableScan
+            alias: s2
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              File Output Operator
+                compressed: false
+                GlobalTableId: 0
+                table:
+                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
 
 PREHOOK: query: FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
                          UNION  ALL  
@@ -264,11 +275,11 @@ POSTHOOK: Lineage: dest2.val2 EXPRESSION
 PREHOOK: query: SELECT DEST1.* FROM DEST1 SORT BY DEST1.key, DEST1.value
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest1
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-21_613_4288475577316753396/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-54_471_8662048643353835173/-mr-10000
 POSTHOOK: query: SELECT DEST1.* FROM DEST1 SORT BY DEST1.key, DEST1.value
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest1
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-21_613_4288475577316753396/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-54_471_8662048643353835173/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
@@ -587,11 +598,11 @@ tst1	1
 PREHOOK: query: SELECT DEST2.* FROM DEST2 SORT BY DEST2.key, DEST2.val1, DEST2.val2
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest2
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-24_769_1643306397793328945/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-57_634_6401136136299268271/-mr-10000
 POSTHOOK: query: SELECT DEST2.* FROM DEST2 SORT BY DEST2.key, DEST2.val1, DEST2.val2
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest2
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-24_769_1643306397793328945/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-04-57_634_6401136136299268271/-mr-10000
 POSTHOOK: Lineage: dest1.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]
 POSTHOOK: Lineage: dest1.value EXPRESSION [(src)s1.null, (src)s2.FieldSchema(name:value, type:string, comment:default), ]
 POSTHOOK: Lineage: dest2.key EXPRESSION [(src)s2.FieldSchema(name:key, type:string, comment:default), ]

Modified: hive/trunk/ql/src/test/results/clientpositive/union20.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union20.q.out?rev=1212182&r1=1212181&r2=1212182&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union20.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union20.q.out Thu Dec  8 23:25:10 2011
@@ -29,9 +29,11 @@ ABSTRACT SYNTAX TREE:
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
-  Stage-2 depends on stages: Stage-1, Stage-5
+  Stage-2 depends on stages: Stage-1, Stage-3, Stage-5
+  Stage-3 is a root stage
+  Stage-4 is a root stage
+  Stage-5 depends on stages: Stage-4, Stage-6
   Stage-6 is a root stage
-  Stage-5 depends on stages: Stage-6
   Stage-0 is a root stage
 
 STAGE PLANS:
@@ -93,52 +95,38 @@ STAGE PLANS:
                     type: string
                     expr: _col1
                     type: string
-        file:/tmp/njain/hive_2011-11-11_18-45-31_836_8101530069181152276/-mr-10002 
-          TableScan
-            Union
-              Reduce Output Operator
-                key expressions:
-                      expr: _col0
-                      type: string
-                sort order: +
-                Map-reduce partition columns:
-                      expr: _col0
-                      type: string
-                tag: 1
-                value expressions:
-                      expr: _col0
-                      type: string
-                      expr: _col1
-                      type: string
-        null-subquery2:unionsrc2-subquery2:s4 
-          TableScan
-            alias: s4
-            Filter Operator
-              predicate:
-                  expr: (key < 10)
-                  type: boolean
-              Select Operator
-                expressions:
-                      expr: key
-                      type: string
-                      expr: value
-                      type: string
-                outputColumnNames: _col0, _col1
-                Union
-                  Reduce Output Operator
-                    key expressions:
-                          expr: _col0
-                          type: string
-                    sort order: +
-                    Map-reduce partition columns:
-                          expr: _col0
-                          type: string
-                    tag: 1
-                    value expressions:
-                          expr: _col0
-                          type: string
-                          expr: _col1
-                          type: string
+        file:/tmp/njain/hive_2011-12-07_18-05-02_524_3478183075357722431/-mr-10002 
+          Union
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: string
+              tag: 1
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
+        file:/tmp/njain/hive_2011-12-07_18-05-02_524_3478183075357722431/-mr-10003 
+          Union
+            Reduce Output Operator
+              key expressions:
+                    expr: _col0
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: _col0
+                    type: string
+              tag: 1
+              value expressions:
+                    expr: _col0
+                    type: string
+                    expr: _col1
+                    type: string
       Reduce Operator Tree:
         Join Operator
           condition map:
@@ -166,6 +154,74 @@ STAGE PLANS:
                   input format: org.apache.hadoop.mapred.TextInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
 
+  Stage: Stage-3
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc2-subquery2:s4 
+          TableScan
+            alias: s4
+            Filter Operator
+              predicate:
+                  expr: (key < 10)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: value
+                      type: string
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+                  table:
+                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-4
+    Map Reduce
+      Alias -> Map Operator Tree:
+        null-subquery2:unionsrc1-subquery2:s2 
+          TableScan
+            alias: s2
+            Filter Operator
+              predicate:
+                  expr: (key < 10)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: value
+                      type: string
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+                  table:
+                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
+  Stage: Stage-5
+    Map Reduce
+      Alias -> Map Operator Tree:
+        file:/tmp/njain/hive_2011-12-07_18-05-02_524_3478183075357722431/-mr-10004 
+          Union
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+        file:/tmp/njain/hive_2011-12-07_18-05-02_524_3478183075357722431/-mr-10006 
+          Union
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+
   Stage: Stage-6
     Map Reduce
       Alias -> Map Operator Tree:
@@ -206,40 +262,6 @@ STAGE PLANS:
                   input format: org.apache.hadoop.mapred.SequenceFileInputFormat
                   output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
 
-  Stage: Stage-5
-    Map Reduce
-      Alias -> Map Operator Tree:
-        file:/tmp/njain/hive_2011-11-11_18-45-31_836_8101530069181152276/-mr-10004 
-          TableScan
-            Union
-              File Output Operator
-                compressed: false
-                GlobalTableId: 0
-                table:
-                    input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                    output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-        null-subquery2:unionsrc1-subquery2:s2 
-          TableScan
-            alias: s2
-            Filter Operator
-              predicate:
-                  expr: (key < 10)
-                  type: boolean
-              Select Operator
-                expressions:
-                      expr: key
-                      type: string
-                      expr: value
-                      type: string
-                outputColumnNames: _col0, _col1
-                Union
-                  File Output Operator
-                    compressed: false
-                    GlobalTableId: 0
-                    table:
-                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-
   Stage: Stage-0
     Fetch Operator
       limit: -1
@@ -256,7 +278,7 @@ JOIN 
 ON (unionsrc1.key = unionsrc2.key)
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
-PREHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-31_982_246659288493998228/-mr-10000
+PREHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-05-02_728_8213800151047927461/-mr-10000
 POSTHOOK: query: SELECT unionsrc1.key, unionsrc1.value, unionsrc2.key, unionsrc2.value
 FROM (select 'tst1' as key, cast(count(1) as string) as value from src s1
                          UNION  ALL  
@@ -268,7 +290,7 @@ JOIN 
 ON (unionsrc1.key = unionsrc2.key)
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
-POSTHOOK: Output: file:/tmp/njain/hive_2011-11-11_18-45-31_982_246659288493998228/-mr-10000
+POSTHOOK: Output: file:/tmp/njain/hive_2011-12-07_18-05-02_728_8213800151047927461/-mr-10000
 0	val_0	0	val_0
 0	val_0	0	val_0
 0	val_0	0	val_0