You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sz...@apache.org on 2015/04/23 04:34:33 UTC

[24/44] hive git commit: HIVE-9569: Enable more unit tests for UNION ALL [Spark Branch] (Chao via Xuefu) adding missing new files from previous commit

http://git-wip-us.apache.org/repos/asf/hive/blob/556e55ee/ql/src/test/results/clientpositive/spark/union24.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/union24.q.out b/ql/src/test/results/clientpositive/spark/union24.q.out
new file mode 100644
index 0000000..22ec159
--- /dev/null
+++ b/ql/src/test/results/clientpositive/spark/union24.q.out
@@ -0,0 +1,1649 @@
+PREHOOK: query: -- SORT_QUERY_RESULTS
+
+create table src2 as select key, count(1) as count from src group by key
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src2
+POSTHOOK: query: -- SORT_QUERY_RESULTS
+
+create table src2 as select key, count(1) as count from src group by key
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src2
+PREHOOK: query: create table src3 as select * from src2
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src3
+POSTHOOK: query: create table src3 as select * from src2
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src3
+PREHOOK: query: create table src4 as select * from src2
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src4
+POSTHOOK: query: create table src4 as select * from src2
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src4
+PREHOOK: query: create table src5 as select * from src2
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@src5
+POSTHOOK: query: create table src5 as select * from src2
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@src5
+PREHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select key, count from src4  where key < 10
+  union all
+  select key, count(1) as count from src5 where key < 10 group by key
+)s
+PREHOOK: type: QUERY
+POSTHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select key, count from src4  where key < 10
+  union all
+  select key, count(1) as count from src5 where key < 10 group by key
+)s
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_SUBQUERY
+         TOK_UNIONALL
+            TOK_UNIONALL
+               TOK_UNIONALL
+                  TOK_QUERY
+                     TOK_FROM
+                        TOK_TABREF
+                           TOK_TABNAME
+                              src2
+                     TOK_INSERT
+                        TOK_DESTINATION
+                           TOK_DIR
+                              TOK_TMP_FILE
+                        TOK_SELECT
+                           TOK_SELEXPR
+                              TOK_TABLE_OR_COL
+                                 key
+                           TOK_SELEXPR
+                              TOK_TABLE_OR_COL
+                                 count
+                        TOK_WHERE
+                           <
+                              TOK_TABLE_OR_COL
+                                 key
+                              10
+                  TOK_QUERY
+                     TOK_FROM
+                        TOK_TABREF
+                           TOK_TABNAME
+                              src3
+                     TOK_INSERT
+                        TOK_DESTINATION
+                           TOK_DIR
+                              TOK_TMP_FILE
+                        TOK_SELECT
+                           TOK_SELEXPR
+                              TOK_TABLE_OR_COL
+                                 key
+                           TOK_SELEXPR
+                              TOK_TABLE_OR_COL
+                                 count
+                        TOK_WHERE
+                           <
+                              TOK_TABLE_OR_COL
+                                 key
+                              10
+               TOK_QUERY
+                  TOK_FROM
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src4
+                  TOK_INSERT
+                     TOK_DESTINATION
+                        TOK_DIR
+                           TOK_TMP_FILE
+                     TOK_SELECT
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              key
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              count
+                     TOK_WHERE
+                        <
+                           TOK_TABLE_OR_COL
+                              key
+                           10
+            TOK_QUERY
+               TOK_FROM
+                  TOK_TABREF
+                     TOK_TABNAME
+                        src5
+               TOK_INSERT
+                  TOK_DESTINATION
+                     TOK_DIR
+                        TOK_TMP_FILE
+                  TOK_SELECT
+                     TOK_SELEXPR
+                        TOK_TABLE_OR_COL
+                           key
+                     TOK_SELEXPR
+                        TOK_FUNCTION
+                           count
+                           1
+                        count
+                  TOK_WHERE
+                     <
+                        TOK_TABLE_OR_COL
+                           key
+                        10
+                  TOK_GROUPBY
+                     TOK_TABLE_OR_COL
+                        key
+         s
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               key
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               count
+
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 5 <- Map 4 (GROUP, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src2
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src2
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src2
+                    numFiles 2
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src2 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src2
+                      numFiles 2
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src2 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src2
+                  name: default.src2
+            Truncated Path -> Alias:
+              /src2 [src2]
+        Map 2 
+            Map Operator Tree:
+                TableScan
+                  alias: src3
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src3
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src3
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src3 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src3
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src3 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src3
+                  name: default.src3
+            Truncated Path -> Alias:
+              /src3 [src3]
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: src4
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src4
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src4
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src4 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src4
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src4 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src4
+                  name: default.src4
+            Truncated Path -> Alias:
+              /src4 [src4]
+        Map 4 
+            Map Operator Tree:
+                TableScan
+                  alias: src5
+                  Statistics: Num rows: 309 Data size: 1482 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: count(1)
+                      keys: key (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: string)
+                        Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                        tag: -1
+                        value expressions: _col1 (type: bigint)
+                        auto parallelism: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src5
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src5
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src5 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src5
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src5 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src5
+                  name: default.src5
+            Truncated Path -> Alias:
+              /src5 [src5]
+        Reducer 5 
+            Needs Tagging: false
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1
+                        columns.types string:bigint
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select key, count from src4  where key < 10
+  union all
+  select key, count(1) as count from src5 where key < 10 group by key
+)s
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src2
+PREHOOK: Input: default@src3
+PREHOOK: Input: default@src4
+PREHOOK: Input: default@src5
+#### A masked pattern was here ####
+POSTHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select key, count from src4  where key < 10
+  union all
+  select key, count(1) as count from src5 where key < 10 group by key
+)s
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src2
+POSTHOOK: Input: default@src3
+POSTHOOK: Input: default@src4
+POSTHOOK: Input: default@src5
+#### A masked pattern was here ####
+0	1
+0	3
+0	3
+0	3
+2	1
+2	1
+2	1
+2	1
+4	1
+4	1
+4	1
+4	1
+5	1
+5	3
+5	3
+5	3
+8	1
+8	1
+8	1
+8	1
+9	1
+9	1
+9	1
+9	1
+PREHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, b.count as count from src4 a join src5 b on a.key=b.key where a.key < 10
+)s
+PREHOOK: type: QUERY
+POSTHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, b.count as count from src4 a join src5 b on a.key=b.key where a.key < 10
+)s
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_SUBQUERY
+         TOK_UNIONALL
+            TOK_UNIONALL
+               TOK_QUERY
+                  TOK_FROM
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src2
+                  TOK_INSERT
+                     TOK_DESTINATION
+                        TOK_DIR
+                           TOK_TMP_FILE
+                     TOK_SELECT
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              key
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              count
+                     TOK_WHERE
+                        <
+                           TOK_TABLE_OR_COL
+                              key
+                           10
+               TOK_QUERY
+                  TOK_FROM
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src3
+                  TOK_INSERT
+                     TOK_DESTINATION
+                        TOK_DIR
+                           TOK_TMP_FILE
+                     TOK_SELECT
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              key
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              count
+                     TOK_WHERE
+                        <
+                           TOK_TABLE_OR_COL
+                              key
+                           10
+            TOK_QUERY
+               TOK_FROM
+                  TOK_JOIN
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src4
+                        a
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src5
+                        b
+                     =
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        .
+                           TOK_TABLE_OR_COL
+                              b
+                           key
+               TOK_INSERT
+                  TOK_DESTINATION
+                     TOK_DIR
+                        TOK_TMP_FILE
+                  TOK_SELECT
+                     TOK_SELEXPR
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        key
+                     TOK_SELEXPR
+                        .
+                           TOK_TABLE_OR_COL
+                              b
+                           count
+                        count
+                  TOK_WHERE
+                     <
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        10
+         s
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               key
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               count
+
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (PARTITION-LEVEL SORT, 2), Map 5 (PARTITION-LEVEL SORT, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src2
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src2
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src2
+                    numFiles 2
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src2 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src2
+                      numFiles 2
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src2 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src2
+                  name: default.src2
+            Truncated Path -> Alias:
+              /src2 [src2]
+        Map 2 
+            Map Operator Tree:
+                TableScan
+                  alias: src3
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src3
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src3
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src3 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src3
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src3 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src3
+                  name: default.src3
+            Truncated Path -> Alias:
+              /src3 [src3]
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: a
+                  Statistics: Num rows: 309 Data size: 1482 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                      tag: 0
+                      auto parallelism: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src4
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src4
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src4 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src4
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src4 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src4
+                  name: default.src4
+            Truncated Path -> Alias:
+              /src4 [a]
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: b
+                  Statistics: Num rows: 309 Data size: 1482 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                      tag: 1
+                      value expressions: count (type: bigint)
+                      auto parallelism: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src5
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src5
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src5 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src5
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src5 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src5
+                  name: default.src5
+            Truncated Path -> Alias:
+              /src5 [b]
+        Reducer 4 
+            Needs Tagging: true
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                outputColumnNames: _col0, _col6
+                Select Operator
+                  expressions: _col0 (type: string), _col6 (type: bigint)
+                  outputColumnNames: _col0, _col1
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+#### A masked pattern was here ####
+                    NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                        properties:
+                          columns _col0,_col1
+                          columns.types string:bigint
+                          escape.delim \
+                          hive.serialization.extend.additional.nesting.levels true
+                          serialization.format 1
+                          serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    TotalFiles: 1
+                    GatherStats: false
+                    MultiFileSpray: false
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, b.count as count from src4 a join src5 b on a.key=b.key where a.key < 10
+)s
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src2
+PREHOOK: Input: default@src3
+PREHOOK: Input: default@src4
+PREHOOK: Input: default@src5
+#### A masked pattern was here ####
+POSTHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, b.count as count from src4 a join src5 b on a.key=b.key where a.key < 10
+)s
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src2
+POSTHOOK: Input: default@src3
+POSTHOOK: Input: default@src4
+POSTHOOK: Input: default@src5
+#### A masked pattern was here ####
+0	3
+0	3
+0	3
+2	1
+2	1
+2	1
+4	1
+4	1
+4	1
+5	3
+5	3
+5	3
+8	1
+8	1
+8	1
+9	1
+9	1
+9	1
+PREHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, count(1) as count from src4 a join src5 b on a.key=b.key where a.key < 10 group by a.key
+)s
+PREHOOK: type: QUERY
+POSTHOOK: query: explain extended
+select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, count(1) as count from src4 a join src5 b on a.key=b.key where a.key < 10 group by a.key
+)s
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  
+TOK_QUERY
+   TOK_FROM
+      TOK_SUBQUERY
+         TOK_UNIONALL
+            TOK_UNIONALL
+               TOK_QUERY
+                  TOK_FROM
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src2
+                  TOK_INSERT
+                     TOK_DESTINATION
+                        TOK_DIR
+                           TOK_TMP_FILE
+                     TOK_SELECT
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              key
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              count
+                     TOK_WHERE
+                        <
+                           TOK_TABLE_OR_COL
+                              key
+                           10
+               TOK_QUERY
+                  TOK_FROM
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src3
+                  TOK_INSERT
+                     TOK_DESTINATION
+                        TOK_DIR
+                           TOK_TMP_FILE
+                     TOK_SELECT
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              key
+                        TOK_SELEXPR
+                           TOK_TABLE_OR_COL
+                              count
+                     TOK_WHERE
+                        <
+                           TOK_TABLE_OR_COL
+                              key
+                           10
+            TOK_QUERY
+               TOK_FROM
+                  TOK_JOIN
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src4
+                        a
+                     TOK_TABREF
+                        TOK_TABNAME
+                           src5
+                        b
+                     =
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        .
+                           TOK_TABLE_OR_COL
+                              b
+                           key
+               TOK_INSERT
+                  TOK_DESTINATION
+                     TOK_DIR
+                        TOK_TMP_FILE
+                  TOK_SELECT
+                     TOK_SELEXPR
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        key
+                     TOK_SELEXPR
+                        TOK_FUNCTION
+                           count
+                           1
+                        count
+                  TOK_WHERE
+                     <
+                        .
+                           TOK_TABLE_OR_COL
+                              a
+                           key
+                        10
+                  TOK_GROUPBY
+                     .
+                        TOK_TABLE_OR_COL
+                           a
+                        key
+         s
+   TOK_INSERT
+      TOK_DESTINATION
+         TOK_DIR
+            TOK_TMP_FILE
+      TOK_SELECT
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               key
+         TOK_SELEXPR
+            .
+               TOK_TABLE_OR_COL
+                  s
+               count
+
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 4 <- Map 3 (PARTITION-LEVEL SORT, 2), Map 6 (PARTITION-LEVEL SORT, 2)
+        Reducer 5 <- Reducer 4 (GROUP, 2)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: src2
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src2
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src2
+                    numFiles 2
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src2 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src2
+                      numFiles 2
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src2 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src2
+                  name: default.src2
+            Truncated Path -> Alias:
+              /src2 [src2]
+        Map 2 
+            Map Operator Tree:
+                TableScan
+                  alias: src3
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Select Operator
+                      expressions: key (type: string), count (type: bigint)
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+#### A masked pattern was here ####
+                        NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                            properties:
+                              columns _col0,_col1
+                              columns.types string:bigint
+                              escape.delim \
+                              hive.serialization.extend.additional.nesting.levels true
+                              serialization.format 1
+                              serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                            serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                        TotalFiles: 1
+                        GatherStats: false
+                        MultiFileSpray: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src3
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src3
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src3 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src3
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src3 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src3
+                  name: default.src3
+            Truncated Path -> Alias:
+              /src3 [src3]
+        Map 3 
+            Map Operator Tree:
+                TableScan
+                  alias: a
+                  Statistics: Num rows: 309 Data size: 1482 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                      tag: 0
+                      auto parallelism: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src4
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src4
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src4 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src4
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src4 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src4
+                  name: default.src4
+            Truncated Path -> Alias:
+              /src4 [a]
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: b
+                  Statistics: Num rows: 309 Data size: 1482 Basic stats: COMPLETE Column stats: NONE
+                  GatherStats: false
+                  Filter Operator
+                    isSamplingPred: false
+                    predicate: (key < 10) (type: boolean)
+                    Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: key (type: string)
+                      sort order: +
+                      Map-reduce partition columns: key (type: string)
+                      Statistics: Num rows: 103 Data size: 494 Basic stats: COMPLETE Column stats: NONE
+                      tag: 1
+                      auto parallelism: false
+            Path -> Alias:
+#### A masked pattern was here ####
+            Path -> Partition:
+#### A masked pattern was here ####
+                Partition
+                  base file name: src5
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  properties:
+                    COLUMN_STATS_ACCURATE true
+                    bucket_count -1
+                    columns key,count
+                    columns.comments 
+                    columns.types string:bigint
+#### A masked pattern was here ####
+                    name default.src5
+                    numFiles 1
+                    numRows 309
+                    rawDataSize 1482
+                    serialization.ddl struct src5 { string key, i64 count}
+                    serialization.format 1
+                    serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    totalSize 1791
+#### A masked pattern was here ####
+                  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                
+                    input format: org.apache.hadoop.mapred.TextInputFormat
+                    output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                    properties:
+                      COLUMN_STATS_ACCURATE true
+                      bucket_count -1
+                      columns key,count
+                      columns.comments 
+                      columns.types string:bigint
+#### A masked pattern was here ####
+                      name default.src5
+                      numFiles 1
+                      numRows 309
+                      rawDataSize 1482
+                      serialization.ddl struct src5 { string key, i64 count}
+                      serialization.format 1
+                      serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      totalSize 1791
+#### A masked pattern was here ####
+                    serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    name: default.src5
+                  name: default.src5
+            Truncated Path -> Alias:
+              /src5 [b]
+        Reducer 4 
+            Needs Tagging: true
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 key (type: string)
+                  1 key (type: string)
+                outputColumnNames: _col0
+                Statistics: Num rows: 113 Data size: 543 Basic stats: COMPLETE Column stats: NONE
+                Group By Operator
+                  aggregations: count(1)
+                  keys: _col0 (type: string)
+                  mode: hash
+                  outputColumnNames: _col0, _col1
+                  Statistics: Num rows: 113 Data size: 543 Basic stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col0 (type: string)
+                    Statistics: Num rows: 113 Data size: 543 Basic stats: COMPLETE Column stats: NONE
+                    tag: -1
+                    value expressions: _col1 (type: bigint)
+                    auto parallelism: false
+        Reducer 5 
+            Needs Tagging: false
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: count(VALUE._col0)
+                keys: KEY._col0 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1
+                File Output Operator
+                  compressed: false
+                  GlobalTableId: 0
+#### A masked pattern was here ####
+                  NumFilesPerFileSink: 1
+#### A masked pattern was here ####
+                  table:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                      properties:
+                        columns _col0,_col1
+                        columns.types string:bigint
+                        escape.delim \
+                        hive.serialization.extend.additional.nesting.levels true
+                        serialization.format 1
+                        serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                  TotalFiles: 1
+                  GatherStats: false
+                  MultiFileSpray: false
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, count(1) as count from src4 a join src5 b on a.key=b.key where a.key < 10 group by a.key
+)s
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src2
+PREHOOK: Input: default@src3
+PREHOOK: Input: default@src4
+PREHOOK: Input: default@src5
+#### A masked pattern was here ####
+POSTHOOK: query: select s.key, s.count from (
+  select key, count from src2  where key < 10
+  union all
+  select key, count from src3  where key < 10
+  union all
+  select a.key as key, count(1) as count from src4 a join src5 b on a.key=b.key where a.key < 10 group by a.key
+)s
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src2
+POSTHOOK: Input: default@src3
+POSTHOOK: Input: default@src4
+POSTHOOK: Input: default@src5
+#### A masked pattern was here ####
+0	1
+0	3
+0	3
+2	1
+2	1
+2	1
+4	1
+4	1
+4	1
+5	1
+5	3
+5	3
+8	1
+8	1
+8	1
+9	1
+9	1
+9	1