hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pxi...@apache.org
Subject [1/2] hive git commit: HIVE-14861: Support precedence for set operator using parentheses (Pengcheng Xiong, reviewed by Ashutosh Chauhan)
Date Fri, 07 Oct 2016 20:53:55 GMT
Repository: hive
Updated Branches:
  refs/heads/master 15039c05b -> 2435e702d


http://git-wip-us.apache.org/repos/asf/hive/blob/2435e702/ql/src/test/results/clientpositive/tez/explainanalyze_2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/tez/explainanalyze_2.q.out b/ql/src/test/results/clientpositive/tez/explainanalyze_2.q.out
index 37fc7d3..0cbddde 100644
--- a/ql/src/test/results/clientpositive/tez/explainanalyze_2.q.out
+++ b/ql/src/test/results/clientpositive/tez/explainanalyze_2.q.out
@@ -380,143 +380,141 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Map 14 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE)
-Reducer 16 <- Map 15 (SIMPLE_EDGE), Map 17 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
-Reducer 8 <- Map 12 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
-Reducer 9 <- Map 13 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+Reducer 10 <- Reducer 9 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 11 (SIMPLE_EDGE)
+Reducer 3 <- Map 12 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 14 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Map 15 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Map 16 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
+Reducer 8 <- Map 17 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
-      Reducer 5
-      File Output Operator [FS_55]
-        Limit [LIM_54] (rows=24/0 width=285)
+      Reducer 10
+      File Output Operator [FS_53]
+        Limit [LIM_52] (rows=100/0 width=18)
           Number of rows:100
-          Select Operator [SEL_53] (rows=24/0 width=285)
+          Select Operator [SEL_51] (rows=550/0 width=18)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-          <-Reducer 4 [SIMPLE_EDGE]
-            SHUFFLE [RS_52]
-              Group By Operator [GBY_50] (rows=24/0 width=285)
+          <-Reducer 9 [SIMPLE_EDGE]
+            SHUFFLE [RS_50]
+              Group By Operator [GBY_48] (rows=550/0 width=18)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(VALUE._col0)","count(VALUE._col1)","count(VALUE._col2)"],keys:KEY._col0, KEY._col1, KEY._col2
-              <-Reducer 3 [SIMPLE_EDGE]
-                SHUFFLE [RS_49]
+              <-Reducer 8 [SIMPLE_EDGE]
+                SHUFFLE [RS_47]
                   PartitionCols:_col0, _col1, _col2
-                  Group By Operator [GBY_48] (rows=24/0 width=285)
-                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col13)","count(_col21)","count(_col3)"],keys:_col12, _col20, _col2
-                    Select Operator [SEL_47] (rows=650/0 width=534)
-                      Output:["_col12","_col20","_col2","_col13","_col21","_col3"]
-                      Merge Join Operator [MERGEJOIN_97] (rows=650/0 width=534)
-                        Conds:RS_44._col1, _col3=RS_45._col15, _col17(Inner),Output:["_col2","_col3","_col12","_col13","_col20","_col21"]
-                      <-Reducer 11 [SIMPLE_EDGE]
-                        SHUFFLE [RS_45]
-                          PartitionCols:_col15, _col17
-                          Select Operator [SEL_40] (rows=190/0 width=447)
-                            Output:["_col14","_col15","_col17","_col6","_col7"]
-                            Merge Join Operator [MERGEJOIN_96] (rows=190/0 width=447)
-                              Conds:RS_37._col6, _col4=RS_38._col4, _col2(Inner),Output:["_col2","_col3","_col14","_col15","_col17"]
-                            <-Reducer 10 [SIMPLE_EDGE]
-                              SHUFFLE [RS_37]
-                                PartitionCols:_col6, _col4
-                                Merge Join Operator [MERGEJOIN_94] (rows=40/0 width=352)
-                                  Conds:RS_34._col3=RS_35._col1(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                <-Map 14 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_35]
-                                    PartitionCols:_col1
-                                    Select Operator [SEL_17] (rows=2/0 width=180)
-                                      Output:["_col1"]
-                                      Filter Operator [FIL_88] (rows=2/0 width=175)
-                                        predicate:((key = 'src1key') and value is not null)
-                                        TableScan [TS_15] (rows=25/25 width=175)
-                                          default@src1,src1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                                <-Reducer 9 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_34]
-                                    PartitionCols:_col3
-                                    Merge Join Operator [MERGEJOIN_93] (rows=40/0 width=352)
-                                      Conds:RS_31._col2=RS_32._col0(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                    <-Map 13 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_32]
-                                        PartitionCols:_col0
-                                        Select Operator [SEL_14] (rows=2/0 width=178)
-                                          Output:["_col0"]
-                                          Filter Operator [FIL_87] (rows=2/0 width=178)
-                                            predicate:((value = 'd1value') and key is not null)
-                                            TableScan [TS_12] (rows=500/500 width=178)
-                                              default@src,d1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                                    <-Reducer 8 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_31]
-                                        PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_92] (rows=40/0 width=352)
-                                          Conds:RS_28._col1=RS_29._col3(Inner),Output:["_col2","_col3","_col4","_col6"]
-                                        <-Map 12 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_29]
-                                            PartitionCols:_col3
-                                            Select Operator [SEL_11] (rows=8/0 width=531)
-                                              Output:["_col0","_col1","_col2","_col3","_col4"]
-                                              Filter Operator [FIL_86] (rows=8/0 width=534)
-                                                predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
-                                                TableScan [TS_9] (rows=85/85 width=534)
-                                                  default@ss,ss,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v1","k2","v2","k3","v3"]
-                                        <-Map 7 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_28]
-                                            PartitionCols:_col1
-                                            Select Operator [SEL_8] (rows=10/0 width=185)
-                                              Output:["_col1"]
-                                              Filter Operator [FIL_85] (rows=10/0 width=178)
-                                                predicate:((key = 'srcpartkey') and value is not null)
-                                                TableScan [TS_6] (rows=2000/2000 width=178)
-                                                  default@srcpart,srcpart,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                            <-Reducer 16 [SIMPLE_EDGE]
-                              SHUFFLE [RS_38]
-                                PartitionCols:_col4, _col2
-                                Merge Join Operator [MERGEJOIN_95] (rows=19/0 width=356)
-                                  Conds:RS_24._col0=RS_25._col0(Inner),Output:["_col2","_col3","_col4","_col5"]
-                                <-Map 15 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_24]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_20] (rows=8/0 width=531)
-                                      Output:["_col0","_col2","_col3","_col4","_col5"]
-                                      Filter Operator [FIL_89] (rows=8/0 width=534)
-                                        predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
-                                        TableScan [TS_18] (rows=85/85 width=534)
-                                          default@sr,sr,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v1","k2","v2","k3","v3"]
-                                <-Map 17 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_25]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_23] (rows=500/0 width=178)
-                                      Output:["_col0"]
-                                      Filter Operator [FIL_90] (rows=500/0 width=178)
-                                        predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                        TableScan [TS_21] (rows=500/500 width=178)
-                                          default@src,d2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
-                      <-Reducer 2 [SIMPLE_EDGE]
-                        SHUFFLE [RS_44]
-                          PartitionCols:_col1, _col3
-                          Merge Join Operator [MERGEJOIN_91] (rows=414/0 width=269)
-                            Conds:RS_41._col0=RS_42._col0(Inner),Output:["_col1","_col2","_col3"]
-                          <-Map 1 [SIMPLE_EDGE]
-                            SHUFFLE [RS_41]
-                              PartitionCols:_col0
-                              Select Operator [SEL_2] (rows=170/170 width=356)
-                                Output:["_col0","_col1","_col2","_col3"]
-                                Filter Operator [FIL_83] (rows=170/170 width=356)
-                                  predicate:(v2 is not null and v3 is not null and k1 is not null)
-                                  TableScan [TS_0] (rows=170/170 width=356)
-                                    default@cs,cs,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v2","k3","v3"]
-                          <-Map 6 [SIMPLE_EDGE]
-                            SHUFFLE [RS_42]
-                              PartitionCols:_col0
-                              Select Operator [SEL_5] (rows=500/0 width=178)
-                                Output:["_col0"]
-                                Filter Operator [FIL_84] (rows=500/0 width=178)
-                                  predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
-                                  TableScan [TS_3] (rows=500/500 width=178)
-                                    default@src,d3,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                  Group By Operator [GBY_46] (rows=1100/0 width=18)
+                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["count(_col1)","count(_col9)","count(_col15)"],keys:_col0, _col8, _col14
+                    Select Operator [SEL_45] (rows=1100/0 width=18)
+                      Output:["_col0","_col8","_col14","_col1","_col9","_col15"]
+                      Merge Join Operator [MERGEJOIN_103] (rows=1100/0 width=18)
+                        Conds:RS_42._col3=RS_43._col1(Inner),Output:["_col0","_col1","_col8","_col9","_col14","_col15"]
+                      <-Map 17 [SIMPLE_EDGE]
+                        SHUFFLE [RS_43]
+                          PartitionCols:_col1
+                          Select Operator [SEL_23] (rows=1000/0 width=18)
+                            Output:["_col1"]
+                            Filter Operator [FIL_96] (rows=1000/0 width=18)
+                              predicate:((key = 'srcpartkey') and value is not null)
+                              TableScan [TS_21] (rows=2000/2000 width=18)
+                                default@srcpart,srcpart,Tbl:COMPLETE,Col:NONE,Output:["key","value"]
+                      <-Reducer 7 [SIMPLE_EDGE]
+                        SHUFFLE [RS_42]
+                          PartitionCols:_col3
+                          Merge Join Operator [MERGEJOIN_102] (rows=129/0 width=625)
+                            Conds:RS_39._col1=RS_40._col1(Inner),Output:["_col0","_col1","_col3","_col8","_col9","_col14","_col15"]
+                          <-Map 16 [SIMPLE_EDGE]
+                            SHUFFLE [RS_40]
+                              PartitionCols:_col1
+                              Select Operator [SEL_20] (rows=2/0 width=180)
+                                Output:["_col1"]
+                                Filter Operator [FIL_95] (rows=2/0 width=175)
+                                  predicate:((key = 'src1key') and value is not null)
+                                  TableScan [TS_18] (rows=25/25 width=175)
+                                    default@src1,src1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                          <-Reducer 6 [SIMPLE_EDGE]
+                            SHUFFLE [RS_39]
+                              PartitionCols:_col1
+                              Merge Join Operator [MERGEJOIN_101] (rows=129/0 width=625)
+                                Conds:RS_36._col12=RS_37._col0(Inner),Output:["_col0","_col1","_col3","_col8","_col9","_col14","_col15"]
+                              <-Map 15 [SIMPLE_EDGE]
+                                SHUFFLE [RS_37]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_17] (rows=500/0 width=178)
+                                    Output:["_col0"]
+                                    Filter Operator [FIL_94] (rows=500/0 width=178)
+                                      predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                      TableScan [TS_15] (rows=500/500 width=178)
+                                        default@src,d3,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                              <-Reducer 5 [SIMPLE_EDGE]
+                                SHUFFLE [RS_36]
+                                  PartitionCols:_col12
+                                  Merge Join Operator [MERGEJOIN_100] (rows=53/0 width=712)
+                                    Conds:RS_33._col6=RS_34._col0(Inner),Output:["_col0","_col1","_col3","_col8","_col9","_col12","_col14","_col15"]
+                                  <-Map 14 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_34]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_14] (rows=500/0 width=178)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_93] (rows=500/0 width=178)
+                                          predicate:((value) IN ('2000Q1', '2000Q2', '2000Q3') and key is not null)
+                                          TableScan [TS_12] (rows=500/500 width=178)
+                                            default@src,d2,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                                  <-Reducer 4 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_33]
+                                      PartitionCols:_col6
+                                      Merge Join Operator [MERGEJOIN_99] (rows=22/0 width=799)
+                                        Conds:RS_30._col0=RS_31._col0(Inner),Output:["_col0","_col1","_col3","_col6","_col8","_col9","_col12","_col14","_col15"]
+                                      <-Map 13 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_31]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_11] (rows=2/0 width=178)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_92] (rows=2/0 width=178)
+                                              predicate:((value = 'd1value') and key is not null)
+                                              TableScan [TS_9] (rows=500/500 width=178)
+                                                default@src,d1,Tbl:COMPLETE,Col:COMPLETE,Output:["key","value"]
+                                      <-Reducer 3 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_30]
+                                          PartitionCols:_col0
+                                          Merge Join Operator [MERGEJOIN_98] (rows=22/0 width=799)
+                                            Conds:RS_27._col9, _col11=RS_28._col1, _col3(Inner),Output:["_col0","_col1","_col3","_col6","_col8","_col9","_col12","_col14","_col15"]
+                                          <-Map 12 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_28]
+                                              PartitionCols:_col1, _col3
+                                              Select Operator [SEL_8] (rows=170/170 width=356)
+                                                Output:["_col0","_col1","_col2","_col3"]
+                                                Filter Operator [FIL_91] (rows=170/170 width=356)
+                                                  predicate:(v2 is not null and v3 is not null and k1 is not null)
+                                                  TableScan [TS_6] (rows=170/170 width=356)
+                                                    default@cs,cs,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v2","k3","v3"]
+                                          <-Reducer 2 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_27]
+                                              PartitionCols:_col9, _col11
+                                              Merge Join Operator [MERGEJOIN_97] (rows=16/0 width=625)
+                                                Conds:RS_24._col2, _col4=RS_25._col2, _col4(Inner),Output:["_col0","_col1","_col3","_col6","_col8","_col9","_col11"]
+                                              <-Map 1 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_24]
+                                                  PartitionCols:_col2, _col4
+                                                  Select Operator [SEL_2] (rows=8/0 width=531)
+                                                    Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                    Filter Operator [FIL_89] (rows=8/0 width=534)
+                                                      predicate:((v3 = 'ssv3') and k2 is not null and k3 is not null and k1 is not null and v1 is not null and v2 is not null)
+                                                      TableScan [TS_0] (rows=85/85 width=534)
+                                                        default@ss,ss,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v1","k2","v2","k3","v3"]
+                                              <-Map 11 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_25]
+                                                  PartitionCols:_col2, _col4
+                                                  Select Operator [SEL_5] (rows=8/0 width=531)
+                                                    Output:["_col0","_col2","_col3","_col4","_col5"]
+                                                    Filter Operator [FIL_90] (rows=8/0 width=534)
+                                                      predicate:((v1 = 'srv1') and k2 is not null and k3 is not null and v2 is not null and v3 is not null and k1 is not null)
+                                                      TableScan [TS_3] (rows=85/85 width=534)
+                                                        default@sr,sr,Tbl:COMPLETE,Col:COMPLETE,Output:["k1","v1","k2","v2","k3","v3"]
 
 PREHOOK: query: SELECT x.key, z.value, y.value
 FROM src1 x JOIN src y ON (x.key = y.key) 
@@ -3426,11 +3424,15 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 25/25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
                         Statistics: Num rows: 525/525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 525/525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
         Map 11 
             Map Operator Tree:
                 TableScan
@@ -3443,11 +3445,15 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
                         Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
         Map 12 
             Map Operator Tree:
                 TableScan
@@ -3460,11 +3466,15 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
                         Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
         Map 13 
             Map Operator Tree:
                 TableScan
@@ -3505,45 +3515,49 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 25/25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col1 (type: string)
-                          1 _col1 (type: string)
-                        outputColumnNames: _col0, _col6
-                        input vertices:
-                          0 Map 20
-                        Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Select Operator
-                          expressions: _col0 (type: string), _col6 (type: string)
-                          outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
+                        Statistics: Num rows: 1525/1525 Data size: 16127 Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 _col1 (type: string)
+                            1 _col1 (type: string)
+                          outputColumnNames: _col0, _col6
+                          input vertices:
+                            0 Map 20
                           Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.a
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.b
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.c
+                          HybridGraceHashJoin: true
+                          Select Operator
+                            expressions: _col0 (type: string), _col6 (type: string)
+                            outputColumnNames: _col0, _col1
+                            Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.a
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.b
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.c
         Map 17 
             Map Operator Tree:
                 TableScan
@@ -3556,45 +3570,49 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col1 (type: string)
-                          1 _col1 (type: string)
-                        outputColumnNames: _col0, _col6
-                        input vertices:
-                          0 Map 20
-                        Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Select Operator
-                          expressions: _col0 (type: string), _col6 (type: string)
-                          outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
+                        Statistics: Num rows: 1525/1525 Data size: 16127 Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 _col1 (type: string)
+                            1 _col1 (type: string)
+                          outputColumnNames: _col0, _col6
+                          input vertices:
+                            0 Map 20
                           Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.a
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.b
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.c
+                          HybridGraceHashJoin: true
+                          Select Operator
+                            expressions: _col0 (type: string), _col6 (type: string)
+                            outputColumnNames: _col0, _col1
+                            Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.a
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.b
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.c
         Map 18 
             Map Operator Tree:
                 TableScan
@@ -3607,45 +3625,49 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col1 (type: string)
-                          1 _col1 (type: string)
-                        outputColumnNames: _col0, _col6
-                        input vertices:
-                          0 Map 20
-                        Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Select Operator
-                          expressions: _col0 (type: string), _col6 (type: string)
-                          outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
+                        Statistics: Num rows: 1525/1525 Data size: 16127 Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 _col1 (type: string)
+                            1 _col1 (type: string)
+                          outputColumnNames: _col0, _col6
+                          input vertices:
+                            0 Map 20
                           Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.a
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.b
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.c
+                          HybridGraceHashJoin: true
+                          Select Operator
+                            expressions: _col0 (type: string), _col6 (type: string)
+                            outputColumnNames: _col0, _col1
+                            Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.a
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.b
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.c
         Map 19 
             Map Operator Tree:
                 TableScan
@@ -3658,45 +3680,49 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Map Join Operator
-                        condition map:
-                             Inner Join 0 to 1
-                        keys:
-                          0 _col1 (type: string)
-                          1 _col1 (type: string)
-                        outputColumnNames: _col0, _col6
-                        input vertices:
-                          0 Map 20
-                        Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                        HybridGraceHashJoin: true
-                        Select Operator
-                          expressions: _col0 (type: string), _col6 (type: string)
-                          outputColumnNames: _col0, _col1
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
+                        Statistics: Num rows: 1525/1525 Data size: 16127 Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 _col1 (type: string)
+                            1 _col1 (type: string)
+                          outputColumnNames: _col0, _col6
+                          input vertices:
+                            0 Map 20
                           Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.a
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.b
-                          File Output Operator
-                            compressed: false
-                            Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
-                            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.c
+                          HybridGraceHashJoin: true
+                          Select Operator
+                            expressions: _col0 (type: string), _col6 (type: string)
+                            outputColumnNames: _col0, _col1
+                            Statistics: Num rows: 1677/820 Data size: 17739 Basic stats: COMPLETE Column stats: NONE
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.a
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.b
+                            File Output Operator
+                              compressed: false
+                              Statistics: Num rows: 3409/6411 Data size: 36062 Basic stats: COMPLETE Column stats: NONE
+                              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.c
         Map 20 
             Map Operator Tree:
                 TableScan
@@ -3766,11 +3792,15 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 500/500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
                         Statistics: Num rows: 525/525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 525/525 Data size: 5503 Basic stats: COMPLETE Column stats: NONE
         Map 6 
             Map Operator Tree:
                 TableScan
@@ -3822,11 +3852,15 @@ STAGE PLANS:
                       expressions: value (type: string)
                       outputColumnNames: _col1
                       Statistics: Num rows: 25/25 Data size: 191 Basic stats: COMPLETE Column stats: NONE
-                      Reduce Output Operator
-                        key expressions: _col1 (type: string)
-                        sort order: +
-                        Map-reduce partition columns: _col1 (type: string)
+                      Select Operator
+                        expressions: _col1 (type: string)
+                        outputColumnNames: _col1
                         Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: string)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: string)
+                          Statistics: Num rows: 1025/1025 Data size: 10815 Basic stats: COMPLETE Column stats: NONE
         Reducer 10 
             Reduce Operator Tree:
               Merge Join Operator
@@ -4632,15 +4666,15 @@ Stage-4
           Dependency Collection{}
             Stage-2
               Reducer 4
-              File Output Operator [FS_18]
+              File Output Operator [FS_20]
                 table:{"name:":"default.dest1"}
-                Group By Operator [GBY_16] (rows=1/310 width=96)
+                Group By Operator [GBY_18] (rows=1/310 width=96)
                   Output:["_col0","_col1"],aggregations:["count(DISTINCT KEY._col1:0._col0)"],keys:KEY._col0
                 <-Union 3 [SIMPLE_EDGE]
                   <-Map 6 [CONTAINS]
-                    Reduce Output Operator [RS_15]
+                    Reduce Output Operator [RS_17]
                       PartitionCols:_col0
-                      Group By Operator [GBY_14] (rows=1/619 width=280)
+                      Group By Operator [GBY_16] (rows=1/619 width=280)
                         Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, substr(_col1, 5)
                         Select Operator [SEL_9] (rows=501/501 width=272)
                           Output:["_col0","_col1"]
@@ -4648,29 +4682,29 @@ Stage-4
                             Output:["_col0","_col1"]
                             TableScan [TS_6] (rows=500/500 width=10)
                               Output:["key","value"]
-                    Reduce Output Operator [RS_21]
+                    Reduce Output Operator [RS_23]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_20] (rows=1/619 width=464)
+                      Group By Operator [GBY_22] (rows=1/619 width=464)
                         Output:["_col0","_col1","_col2","_col3"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, _col1, substr(_col1, 5)
                          Please refer to the previous Select Operator [SEL_9]
                   <-Map 7 [CONTAINS]
-                    Reduce Output Operator [RS_15]
+                    Reduce Output Operator [RS_17]
                       PartitionCols:_col0
-                      Group By Operator [GBY_14] (rows=1/619 width=280)
+                      Group By Operator [GBY_16] (rows=1/619 width=280)
                         Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, substr(_col1, 5)
-                        Select Operator [SEL_11] (rows=500/500 width=10)
+                        Select Operator [SEL_12] (rows=500/500 width=10)
                           Output:["_col0","_col1"]
-                          TableScan [TS_10] (rows=500/500 width=10)
+                          TableScan [TS_11] (rows=500/500 width=10)
                             Output:["key","value"]
-                    Reduce Output Operator [RS_21]
+                    Reduce Output Operator [RS_23]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_20] (rows=1/619 width=464)
+                      Group By Operator [GBY_22] (rows=1/619 width=464)
                         Output:["_col0","_col1","_col2","_col3"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, _col1, substr(_col1, 5)
-                         Please refer to the previous Select Operator [SEL_11]
+                         Please refer to the previous Select Operator [SEL_12]
                   <-Reducer 2 [CONTAINS]
-                    Reduce Output Operator [RS_15]
+                    Reduce Output Operator [RS_17]
                       PartitionCols:_col0
-                      Group By Operator [GBY_14] (rows=1/619 width=280)
+                      Group By Operator [GBY_16] (rows=1/619 width=280)
                         Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, substr(_col1, 5)
                         Select Operator [SEL_9] (rows=501/501 width=272)
                           Output:["_col0","_col1"]
@@ -4685,15 +4719,15 @@ Stage-4
                                   Select Operator [SEL_1] (rows=500/500 width=10)
                                     TableScan [TS_0] (rows=500/500 width=10)
                                       default@src,s1,Tbl:COMPLETE,Col:COMPLETE
-                    Reduce Output Operator [RS_21]
+                    Reduce Output Operator [RS_23]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_20] (rows=1/619 width=464)
+                      Group By Operator [GBY_22] (rows=1/619 width=464)
                         Output:["_col0","_col1","_col2","_col3"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, _col1, substr(_col1, 5)
                          Please refer to the previous Select Operator [SEL_9]
               Reducer 5
-              File Output Operator [FS_24]
+              File Output Operator [FS_26]
                 table:{"name:":"default.dest2"}
-                Group By Operator [GBY_22] (rows=1/310 width=280)
+                Group By Operator [GBY_24] (rows=1/310 width=280)
                   Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT KEY._col2:0._col0)"],keys:KEY._col0, KEY._col1
                 <- Please refer to the previous Union 3 [SIMPLE_EDGE]
 Stage-5
@@ -4764,15 +4798,15 @@ Stage-4
           Dependency Collection{}
             Stage-2
               Reducer 4
-              File Output Operator [FS_14]
+              File Output Operator [FS_15]
                 table:{"name:":"default.dest1"}
-                Group By Operator [GBY_12] (rows=1/310 width=96)
+                Group By Operator [GBY_13] (rows=1/310 width=96)
                   Output:["_col0","_col1"],aggregations:["count(DISTINCT KEY._col1:0._col0)"],keys:KEY._col0
                 <-Union 3 [SIMPLE_EDGE]
                   <-Map 6 [CONTAINS]
-                    Reduce Output Operator [RS_11]
+                    Reduce Output Operator [RS_12]
                       PartitionCols:_col0
-                      Group By Operator [GBY_10] (rows=1/310 width=280)
+                      Group By Operator [GBY_11] (rows=1/310 width=280)
                         Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, substr(_col1, 5)
                         Select Operator [SEL_9] (rows=501/501 width=11)
                           Output:["_col0","_col1"]
@@ -4780,17 +4814,15 @@ Stage-4
                             Output:["_col0","_col1"]
                             TableScan [TS_6] (rows=500/500 width=10)
                               Output:["key","value"]
-                    Reduce Output Operator [RS_17]
+                    Reduce Output Operator [RS_18]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_16] (rows=1/310 width=464)
+                      Group By Operator [GBY_17] (rows=1/310 width=464)
                         Output:["_col0","_col1","_col2","_col3"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, _col1, substr(_col1, 5)
-                        Select Operator [SEL_15] (rows=501/501 width=11)
-                          Output:["_col0","_col1"]
-                           Please refer to the previous Select Operator [SEL_7]
+                         Please refer to the previous Select Operator [SEL_9]
                   <-Reducer 2 [CONTAINS]
-                    Reduce Output Operator [RS_11]
+                    Reduce Output Operator [RS_12]
                       PartitionCols:_col0
-                      Group By Operator [GBY_10] (rows=1/310 width=280)
+                      Group By Operator [GBY_11] (rows=1/310 width=280)
                         Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, substr(_col1, 5)
                         Select Operator [SEL_9] (rows=501/501 width=11)
                           Output:["_col0","_col1"]
@@ -4805,17 +4837,15 @@ Stage-4
                                   Select Operator [SEL_1] (rows=500/500 width=10)
                                     TableScan [TS_0] (rows=500/500 width=10)
                                       default@src,s1,Tbl:COMPLETE,Col:COMPLETE
-                    Reduce Output Operator [RS_17]
+                    Reduce Output Operator [RS_18]
                       PartitionCols:_col0, _col1
-                      Group By Operator [GBY_16] (rows=1/310 width=464)
+                      Group By Operator [GBY_17] (rows=1/310 width=464)
                         Output:["_col0","_col1","_col2","_col3"],aggregations:["count(DISTINCT substr(_col1, 5))"],keys:_col0, _col1, substr(_col1, 5)
-                        Select Operator [SEL_15] (rows=501/501 width=11)
-                          Output:["_col0","_col1"]
-                           Please refer to the previous Select Operator [SEL_5]
+                         Please refer to the previous Select Operator [SEL_9]
               Reducer 5
-              File Output Operator [FS_20]
+              File Output Operator [FS_21]
                 table:{"name:":"default.dest2"}
-                Group By Operator [GBY_18] (rows=1/310 width=280)
+                Group By Operator [GBY_19] (rows=1/310 width=280)
                   Output:["_col0","_col1","_col2"],aggregations:["count(DISTINCT KEY._col2:0._col0)"],keys:KEY._col0, KEY._col1
                 <- Please refer to the previous Union 3 [SIMPLE_EDGE]
 Stage-5

http://git-wip-us.apache.org/repos/asf/hive/blob/2435e702/ql/src/test/results/clientpositive/union_offcbo.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/union_offcbo.q.out b/ql/src/test/results/clientpositive/union_offcbo.q.out
index 2c4c0de..cb6a4a5 100644
--- a/ql/src/test/results/clientpositive/union_offcbo.q.out
+++ b/ql/src/test/results/clientpositive/union_offcbo.q.out
@@ -985,37 +985,45 @@ STAGE PLANS:
           TableScan
             Union
               Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Filter Operator
-                predicate: (_col7 <> 'RET') (type: boolean)
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+              Select Operator
+                expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6, _col7
+                Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                Filter Operator
+                  predicate: (_col7 <> 'RET') (type: boolean)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                    table:
-                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                      table:
+                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           TableScan
             Union
               Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Filter Operator
-                predicate: (_col7 <> 'RET') (type: boolean)
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+              Select Operator
+                expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6, _col7
+                Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                Filter Operator
+                  predicate: (_col7 <> 'RET') (type: boolean)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                    table:
-                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                      table:
+                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-4
     Map Reduce
@@ -1328,37 +1336,45 @@ STAGE PLANS:
           TableScan
             Union
               Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Filter Operator
-                predicate: (_col7 <> 'RET') (type: boolean)
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+              Select Operator
+                expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6, _col7
+                Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                Filter Operator
+                  predicate: (_col7 <> 'RET') (type: boolean)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                    table:
-                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                      table:
+                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
           TableScan
             Union
               Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-              Filter Operator
-                predicate: (_col7 <> 'RET') (type: boolean)
-                Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                Select Operator
-                  expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
-                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
+              Select Operator
+                expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                outputColumnNames: _col0, _col1, _col2, _col4, _col5, _col6, _col7
+                Statistics: Num rows: 2 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                Filter Operator
+                  predicate: (_col7 <> 'RET') (type: boolean)
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                  File Output Operator
-                    compressed: false
+                  Select Operator
+                    expressions: _col0 (type: bigint), _col1 (type: string), _col2 (type: bigint), CASE WHEN ((_col7 = 'A_INS')) THEN ('2015-11-21') ELSE ('2015-11-20') END (type: string), _col4 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                    table:
-                        input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                        output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                        serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+                    File Output Operator
+                      compressed: false
+                      Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                      table:
+                          input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                          serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
 
   Stage: Stage-4
     Map Reduce

http://git-wip-us.apache.org/repos/asf/hive/blob/2435e702/ql/src/test/results/clientpositive/union_paren.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/union_paren.q.out b/ql/src/test/results/clientpositive/union_paren.q.out
new file mode 100644
index 0000000..2c96092
--- /dev/null
+++ b/ql/src/test/results/clientpositive/union_paren.q.out
@@ -0,0 +1,260 @@
+PREHOOK: query: explain select * from src union all select * from src
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select * from src union all select * from src
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Map Operator Tree:
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Union
+                Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+          TableScan
+            alias: src
+            Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+            Select Operator
+              expressions: key (type: string), value (type: string)
+              outputColumnNames: _col0, _col1
+              Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
+              Union
+                Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+
+PREHOOK: query: create table t1(c int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t1
+POSTHOOK: query: create table t1(c int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t1
+PREHOOK: query: insert into t1 values (1),(1),(2)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__1
+PREHOOK: Output: default@t1
+POSTHOOK: query: insert into t1 values (1),(1),(2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__1
+POSTHOOK: Output: default@t1
+POSTHOOK: Lineage: t1.c EXPRESSION [(values__tmp__table__1)values__tmp__table__1.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: create table t2(c int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t2
+POSTHOOK: query: create table t2(c int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t2
+PREHOOK: query: insert into t2 values (2),(1),(2)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__2
+PREHOOK: Output: default@t2
+POSTHOOK: query: insert into t2 values (2),(1),(2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__2
+POSTHOOK: Output: default@t2
+POSTHOOK: Lineage: t2.c EXPRESSION [(values__tmp__table__2)values__tmp__table__2.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: create table t3(c int)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t3
+POSTHOOK: query: create table t3(c int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t3
+PREHOOK: query: insert into t3 values (2),(3),(2)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@values__tmp__table__3
+PREHOOK: Output: default@t3
+POSTHOOK: query: insert into t3 values (2),(3),(2)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@values__tmp__table__3
+POSTHOOK: Output: default@t3
+POSTHOOK: Lineage: t3.c EXPRESSION [(values__tmp__table__3)values__tmp__table__3.FieldSchema(name:tmp_values_col1, type:string, comment:), ]
+PREHOOK: query: (select * from t1) union all select * from t2 union select * from t3 order by c
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Input: default@t3
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from t1) union all select * from t2 union select * from t3 order by c
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Input: default@t3
+#### A masked pattern was here ####
+1
+2
+3
+PREHOOK: query: (select * from t1) union all (select * from t2 union select * from t3) order by c
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Input: default@t3
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from t1) union all (select * from t2 union select * from t3) order by c
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Input: default@t3
+#### A masked pattern was here ####
+1
+1
+1
+2
+2
+3
+PREHOOK: query: (select * from src order by key limit 1)
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from src order by key limit 1)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: (select * from src) union all select * from src order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from src) union all select * from src order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: (select * from src limit 1) union all select * from src order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from src limit 1) union all select * from src order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: ((select * from src)) union all select * from src order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: ((select * from src)) union all select * from src order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: select * from src union all ((select * from src)) order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from src union all ((select * from src)) order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: select * from src union all ((select * from src limit 1)) order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from src union all ((select * from src limit 1)) order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: select * from src union all (select * from src) order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select * from src union all (select * from src) order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: (select * from src order by key) union all (select * from src) order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from src order by key) union all (select * from src) order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: (select * from src order by key) union all (select * from src limit 1) order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: (select * from src order by key) union all (select * from src limit 1) order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	val_0
+PREHOOK: query: select count(*) from (select key from src union select key from src)cool_cust
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: select count(*) from (select key from src union select key from src)cool_cust
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+309
+PREHOOK: query: --similar tpcds q14
+
+with  cross_items as
+ (select key, k
+ from src,
+ (select iss.key k
+ from src iss
+ union all
+ select ics.key k
+ from src ics
+ ) x
+ where key = k
+)
+select * from cross_items order by key limit 1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+#### A masked pattern was here ####
+POSTHOOK: query: --similar tpcds q14
+
+with  cross_items as
+ (select key, k
+ from src,
+ (select iss.key k
+ from src iss
+ union all
+ select ics.key k
+ from src ics
+ ) x
+ where key = k
+)
+select * from cross_items order by key limit 1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+#### A masked pattern was here ####
+0	0

http://git-wip-us.apache.org/repos/asf/hive/blob/2435e702/ql/src/test/results/clientpositive/union_ppr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/union_ppr.q.out b/ql/src/test/results/clientpositive/union_ppr.q.out
index 9763679..d346010 100644
--- a/ql/src/test/results/clientpositive/union_ppr.q.out
+++ b/ql/src/test/results/clientpositive/union_ppr.q.out
@@ -174,8 +174,8 @@ STAGE PLANS:
               name: default.srcpart
             name: default.srcpart
       Truncated Path -> Alias:
-        /srcpart/ds=2008-04-08/hr=11 [null-subquery1:a-subquery1:x, null-subquery2:a-subquery2:y]
-        /srcpart/ds=2008-04-08/hr=12 [null-subquery1:a-subquery1:x, null-subquery2:a-subquery2:y]
+        /srcpart/ds=2008-04-08/hr=11 [a-subquery1:_u1-subquery1:x, a-subquery2:_u1-subquery2:y]
+        /srcpart/ds=2008-04-08/hr=12 [a-subquery1:_u1-subquery1:x, a-subquery2:_u1-subquery2:y]
       Needs Tagging: false
       Reduce Operator Tree:
         Select Operator


Mime
View raw message