You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by px...@apache.org on 2017/05/31 00:01:11 UTC

[04/15] hive git commit: HIVE-16764: Support numeric as same as decimal (Pengcheng Xiong, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/86b18772/ql/src/test/results/clientpositive/perf/query75.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query75.q.out b/ql/src/test/results/clientpositive/perf/query75.q.out
index 55da3a2..d399567 100644
--- a/ql/src/test/results/clientpositive/perf/query75.q.out
+++ b/ql/src/test/results/clientpositive/perf/query75.q.out
@@ -1,377 +1,533 @@
-PREHOOK: query: explain WITH all_sales AS ( SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,SUM(sales_cnt) AS sales_cnt ,SUM(sales_amt) AS sales_amt FROM (SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt ,cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt FROM catalog_sales JOIN item ON i_item_sk=cs_item_sk JOIN date_dim ON d_date_sk=cs_sold_date_sk LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number AND cs_item_sk=cr_item_sk) WHERE i_category='Sports' UNION ALL SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt ,ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt FROM store_sales JOIN item ON i_item_sk=ss_item_sk JOIN date_dim ON d_date_sk=ss_sold_date_sk LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number AND ss_item_sk=sr_item_sk) WHERE i_category='Sports' UNION AL
 L SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt ,ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt FROM web_sales JOIN item ON i_item_sk=ws_item_sk JOIN date_dim ON d_date_sk=ws_sold_date_sk LEFT JOIN web_returns ON (ws_order_number=wr_order_number AND ws_item_sk=wr_item_sk) WHERE i_category='Sports') sales_detail GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id) SELECT prev_yr.d_year AS prev_year ,curr_yr.d_year AS year ,curr_yr.i_brand_id ,curr_yr.i_class_id ,curr_yr.i_category_id ,curr_yr.i_manufact_id ,prev_yr.sales_cnt AS prev_yr_cnt ,curr_yr.sales_cnt AS curr_yr_cnt ,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff ,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff FROM all_sales curr_yr, all_sales prev_yr WHERE curr_yr.i_brand_id=prev_yr.i_brand_id AND curr_yr.i_class_id=prev_yr.i_class_id AND curr_yr.i_category_id=prev_yr.i_category_id AND curr_yr.i_manu
 fact_id=prev_yr.i_manufact_id AND curr_yr.d_year=2002 AND prev_yr.d_year=2002-1 AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9 ORDER BY sales_cnt_diff limit 100
+PREHOOK: query: explain
+WITH all_sales AS (
+ SELECT d_year
+       ,i_brand_id
+       ,i_class_id
+       ,i_category_id
+       ,i_manufact_id
+       ,SUM(sales_cnt) AS sales_cnt
+       ,SUM(sales_amt) AS sales_amt
+ FROM (SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt
+             ,cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt
+       FROM catalog_sales JOIN item ON i_item_sk=cs_item_sk
+                          JOIN date_dim ON d_date_sk=cs_sold_date_sk
+                          LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number 
+                                                    AND cs_item_sk=cr_item_sk)
+       WHERE i_category='Sports'
+       UNION
+       SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt
+             ,ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt
+       FROM store_sales JOIN item ON i_item_sk=ss_item_sk
+                        JOIN date_dim ON d_date_sk=ss_sold_date_sk
+                        LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number 
+                                                AND ss_item_sk=sr_item_sk)
+       WHERE i_category='Sports'
+       UNION
+       SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt
+             ,ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt
+       FROM web_sales JOIN item ON i_item_sk=ws_item_sk
+                      JOIN date_dim ON d_date_sk=ws_sold_date_sk
+                      LEFT JOIN web_returns ON (ws_order_number=wr_order_number 
+                                            AND ws_item_sk=wr_item_sk)
+       WHERE i_category='Sports') sales_detail
+ GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id)
+ SELECT  prev_yr.d_year AS prev_year
+                          ,curr_yr.d_year AS year
+                          ,curr_yr.i_brand_id
+                          ,curr_yr.i_class_id
+                          ,curr_yr.i_category_id
+                          ,curr_yr.i_manufact_id
+                          ,prev_yr.sales_cnt AS prev_yr_cnt
+                          ,curr_yr.sales_cnt AS curr_yr_cnt
+                          ,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff
+                          ,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff
+ FROM all_sales curr_yr, all_sales prev_yr
+ WHERE curr_yr.i_brand_id=prev_yr.i_brand_id
+   AND curr_yr.i_class_id=prev_yr.i_class_id
+   AND curr_yr.i_category_id=prev_yr.i_category_id
+   AND curr_yr.i_manufact_id=prev_yr.i_manufact_id
+   AND curr_yr.d_year=2002
+   AND prev_yr.d_year=2002-1
+   AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9
+ ORDER BY sales_cnt_diff
+ limit 100
 PREHOOK: type: QUERY
-POSTHOOK: query: explain WITH all_sales AS ( SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,SUM(sales_cnt) AS sales_cnt ,SUM(sales_amt) AS sales_amt FROM (SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt ,cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt FROM catalog_sales JOIN item ON i_item_sk=cs_item_sk JOIN date_dim ON d_date_sk=cs_sold_date_sk LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number AND cs_item_sk=cr_item_sk) WHERE i_category='Sports' UNION ALL SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt ,ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt FROM store_sales JOIN item ON i_item_sk=ss_item_sk JOIN date_dim ON d_date_sk=ss_sold_date_sk LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number AND ss_item_sk=sr_item_sk) WHERE i_category='Sports' UNION A
 LL SELECT d_year ,i_brand_id ,i_class_id ,i_category_id ,i_manufact_id ,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt ,ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt FROM web_sales JOIN item ON i_item_sk=ws_item_sk JOIN date_dim ON d_date_sk=ws_sold_date_sk LEFT JOIN web_returns ON (ws_order_number=wr_order_number AND ws_item_sk=wr_item_sk) WHERE i_category='Sports') sales_detail GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id) SELECT prev_yr.d_year AS prev_year ,curr_yr.d_year AS year ,curr_yr.i_brand_id ,curr_yr.i_class_id ,curr_yr.i_category_id ,curr_yr.i_manufact_id ,prev_yr.sales_cnt AS prev_yr_cnt ,curr_yr.sales_cnt AS curr_yr_cnt ,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff ,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff FROM all_sales curr_yr, all_sales prev_yr WHERE curr_yr.i_brand_id=prev_yr.i_brand_id AND curr_yr.i_class_id=prev_yr.i_class_id AND curr_yr.i_category_id=prev_yr.i_category_id AND curr_yr.i_man
 ufact_id=prev_yr.i_manufact_id AND curr_yr.d_year=2002 AND prev_yr.d_year=2002-1 AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9 ORDER BY sales_cnt_diff limit 100
+POSTHOOK: query: explain
+WITH all_sales AS (
+ SELECT d_year
+       ,i_brand_id
+       ,i_class_id
+       ,i_category_id
+       ,i_manufact_id
+       ,SUM(sales_cnt) AS sales_cnt
+       ,SUM(sales_amt) AS sales_amt
+ FROM (SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt
+             ,cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt
+       FROM catalog_sales JOIN item ON i_item_sk=cs_item_sk
+                          JOIN date_dim ON d_date_sk=cs_sold_date_sk
+                          LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number 
+                                                    AND cs_item_sk=cr_item_sk)
+       WHERE i_category='Sports'
+       UNION
+       SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt
+             ,ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt
+       FROM store_sales JOIN item ON i_item_sk=ss_item_sk
+                        JOIN date_dim ON d_date_sk=ss_sold_date_sk
+                        LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number 
+                                                AND ss_item_sk=sr_item_sk)
+       WHERE i_category='Sports'
+       UNION
+       SELECT d_year
+             ,i_brand_id
+             ,i_class_id
+             ,i_category_id
+             ,i_manufact_id
+             ,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt
+             ,ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt
+       FROM web_sales JOIN item ON i_item_sk=ws_item_sk
+                      JOIN date_dim ON d_date_sk=ws_sold_date_sk
+                      LEFT JOIN web_returns ON (ws_order_number=wr_order_number 
+                                            AND ws_item_sk=wr_item_sk)
+       WHERE i_category='Sports') sales_detail
+ GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id)
+ SELECT  prev_yr.d_year AS prev_year
+                          ,curr_yr.d_year AS year
+                          ,curr_yr.i_brand_id
+                          ,curr_yr.i_class_id
+                          ,curr_yr.i_category_id
+                          ,curr_yr.i_manufact_id
+                          ,prev_yr.sales_cnt AS prev_yr_cnt
+                          ,curr_yr.sales_cnt AS curr_yr_cnt
+                          ,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff
+                          ,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff
+ FROM all_sales curr_yr, all_sales prev_yr
+ WHERE curr_yr.i_brand_id=prev_yr.i_brand_id
+   AND curr_yr.i_class_id=prev_yr.i_class_id
+   AND curr_yr.i_category_id=prev_yr.i_category_id
+   AND curr_yr.i_manufact_id=prev_yr.i_manufact_id
+   AND curr_yr.d_year=2002
+   AND prev_yr.d_year=2002-1
+   AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9
+ ORDER BY sales_cnt_diff
+ limit 100
 POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Map 27 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 11 <- Map 28 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE), Union 12 (CONTAINS)
-Reducer 13 <- Union 12 (SIMPLE_EDGE)
-Reducer 15 <- Map 14 (SIMPLE_EDGE), Map 29 (SIMPLE_EDGE)
-Reducer 16 <- Map 27 (SIMPLE_EDGE), Reducer 15 (SIMPLE_EDGE)
-Reducer 17 <- Map 30 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE), Union 5 (CONTAINS)
-Reducer 18 <- Map 14 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
-Reducer 19 <- Map 27 (SIMPLE_EDGE), Reducer 18 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE)
-Reducer 20 <- Map 32 (SIMPLE_EDGE), Reducer 19 (SIMPLE_EDGE), Union 5 (CONTAINS)
-Reducer 21 <- Map 14 (SIMPLE_EDGE), Map 29 (SIMPLE_EDGE)
-Reducer 22 <- Map 27 (SIMPLE_EDGE), Reducer 21 (SIMPLE_EDGE)
-Reducer 23 <- Map 30 (SIMPLE_EDGE), Reducer 22 (SIMPLE_EDGE), Union 12 (CONTAINS)
-Reducer 24 <- Map 14 (SIMPLE_EDGE), Map 31 (SIMPLE_EDGE)
-Reducer 25 <- Map 27 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
-Reducer 26 <- Map 32 (SIMPLE_EDGE), Reducer 25 (SIMPLE_EDGE), Union 12 (CONTAINS)
-Reducer 3 <- Map 27 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 28 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE), Union 5 (CONTAINS)
-Reducer 6 <- Union 5 (SIMPLE_EDGE)
-Reducer 7 <- Reducer 13 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
-Reducer 9 <- Map 1 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE)
+Reducer 10 <- Reducer 9 (SIMPLE_EDGE)
+Reducer 11 <- Map 1 (SIMPLE_EDGE), Map 18 (SIMPLE_EDGE)
+Reducer 12 <- Map 31 (SIMPLE_EDGE), Reducer 11 (SIMPLE_EDGE)
+Reducer 13 <- Map 32 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE), Union 14 (CONTAINS)
+Reducer 15 <- Union 14 (SIMPLE_EDGE), Union 16 (CONTAINS)
+Reducer 17 <- Union 16 (SIMPLE_EDGE)
+Reducer 19 <- Map 18 (SIMPLE_EDGE), Map 33 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 18 (SIMPLE_EDGE)
+Reducer 20 <- Map 31 (SIMPLE_EDGE), Reducer 19 (SIMPLE_EDGE)
+Reducer 21 <- Map 34 (SIMPLE_EDGE), Reducer 20 (SIMPLE_EDGE), Union 5 (CONTAINS)
+Reducer 22 <- Map 18 (SIMPLE_EDGE), Map 35 (SIMPLE_EDGE)
+Reducer 23 <- Map 31 (SIMPLE_EDGE), Reducer 22 (SIMPLE_EDGE)
+Reducer 24 <- Map 36 (SIMPLE_EDGE), Reducer 23 (SIMPLE_EDGE), Union 7 (CONTAINS)
+Reducer 25 <- Map 18 (SIMPLE_EDGE), Map 33 (SIMPLE_EDGE)
+Reducer 26 <- Map 31 (SIMPLE_EDGE), Reducer 25 (SIMPLE_EDGE)
+Reducer 27 <- Map 34 (SIMPLE_EDGE), Reducer 26 (SIMPLE_EDGE), Union 14 (CONTAINS)
+Reducer 28 <- Map 18 (SIMPLE_EDGE), Map 35 (SIMPLE_EDGE)
+Reducer 29 <- Map 31 (SIMPLE_EDGE), Reducer 28 (SIMPLE_EDGE)
+Reducer 3 <- Map 31 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 30 <- Map 36 (SIMPLE_EDGE), Reducer 29 (SIMPLE_EDGE), Union 16 (CONTAINS)
+Reducer 4 <- Map 32 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE), Union 5 (CONTAINS)
+Reducer 6 <- Union 5 (SIMPLE_EDGE), Union 7 (CONTAINS)
+Reducer 8 <- Union 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 17 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
-      Reducer 8
-      File Output Operator [FS_157]
-        Select Operator [SEL_156] (rows=100 width=108)
+      Reducer 10
+      File Output Operator [FS_179]
+        Select Operator [SEL_178] (rows=100 width=111)
           Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-          Limit [LIM_155] (rows=100 width=108)
+          Limit [LIM_177] (rows=100 width=111)
             Number of rows:100
-            Select Operator [SEL_154] (rows=245965926 width=108)
+            Select Operator [SEL_176] (rows=70276244 width=111)
               Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-            <-Reducer 7 [SIMPLE_EDGE]
-              SHUFFLE [RS_153]
-                Select Operator [SEL_152] (rows=245965926 width=108)
+            <-Reducer 9 [SIMPLE_EDGE]
+              SHUFFLE [RS_175]
+                Select Operator [SEL_174] (rows=70276244 width=111)
                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                  Filter Operator [FIL_151] (rows=245965926 width=108)
+                  Filter Operator [FIL_173] (rows=70276244 width=111)
                     predicate:((CAST( _col10 AS decimal(17,2)) / CAST( _col4 AS decimal(17,2))) < 0.9)
-                    Merge Join Operator [MERGEJOIN_260] (rows=737897778 width=108)
-                      Conds:RS_148._col0, _col1, _col2, _col3=RS_149._col0, _col1, _col2, _col3(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col10","_col11"]
-                    <-Reducer 13 [SIMPLE_EDGE]
-                      SHUFFLE [RS_149]
+                    Merge Join Operator [MERGEJOIN_282] (rows=210828734 width=111)
+                      Conds:RS_170._col0, _col1, _col2, _col3=RS_171._col0, _col1, _col2, _col3(Inner),Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col10","_col11"]
+                    <-Reducer 17 [SIMPLE_EDGE]
+                      SHUFFLE [RS_171]
                         PartitionCols:_col0, _col1, _col2, _col3
-                        Group By Operator [GBY_146] (rows=670816148 width=108)
-                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
-                        <-Union 12 [SIMPLE_EDGE]
-                          <-Reducer 11 [CONTAINS]
-                            Reduce Output Operator [RS_145]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_144] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_95] (rows=383314495 width=135)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_253] (rows=383314495 width=135)
-                                    Conds:RS_92._col1, _col2=RS_93._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 28 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_93]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_85] (rows=28798881 width=106)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_233] (rows=28798881 width=106)
-                                          predicate:cr_item_sk is not null
-                                          TableScan [TS_9] (rows=28798881 width=106)
-                                            default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_item_sk","cr_order_number","cr_return_quantity","cr_return_amount"]
-                                  <-Reducer 10 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_92]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_252] (rows=348467716 width=135)
-                                        Conds:RS_89._col1=RS_90._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_90]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_82] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_232] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                              TableScan [TS_6] (rows=462000 width=1436)
-                                                default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_brand_id","i_class_id","i_category_id","i_category","i_manufact_id"]
-                                      <-Reducer 9 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_89]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_251] (rows=316788826 width=135)
-                                            Conds:RS_86._col0=RS_87._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_87]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_79] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_231] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2002) and d_date_sk is not null)
-                                                  TableScan [TS_3] (rows=73049 width=1119)
-                                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                                          <-Map 1 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_86]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_76] (rows=287989836 width=135)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_230] (rows=287989836 width=135)
-                                                  predicate:(cs_item_sk is not null and cs_sold_date_sk is not null)
-                                                  TableScan [TS_0] (rows=287989836 width=135)
-                                                    default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_item_sk","cs_order_number","cs_quantity","cs_ext_sales_price"]
-                          <-Reducer 23 [CONTAINS]
-                            Reduce Output Operator [RS_145]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_144] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_117] (rows=766650239 width=88)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_256] (rows=766650239 width=88)
-                                    Conds:RS_114._col1, _col2=RS_115._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 30 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_115]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_107] (rows=57591150 width=77)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_237] (rows=57591150 width=77)
-                                          predicate:sr_item_sk is not null
-                                          TableScan [TS_31] (rows=57591150 width=77)
-                                            default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_item_sk","sr_ticket_number","sr_return_quantity","sr_return_amt"]
-                                  <-Reducer 22 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_114]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_255] (rows=696954748 width=88)
-                                        Conds:RS_111._col1=RS_112._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_112]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_104] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_236] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                               Please refer to the previous TableScan [TS_6]
-                                      <-Reducer 21 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_111]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_254] (rows=633595212 width=88)
-                                            Conds:RS_108._col0=RS_109._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_109]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_101] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_235] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2002) and d_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_3]
-                                          <-Map 29 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_108]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_98] (rows=575995635 width=88)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_234] (rows=575995635 width=88)
-                                                  predicate:(ss_item_sk is not null and ss_sold_date_sk is not null)
-                                                  TableScan [TS_22] (rows=575995635 width=88)
-                                                    default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_ticket_number","ss_quantity","ss_ext_sales_price"]
-                          <-Reducer 26 [CONTAINS]
-                            Reduce Output Operator [RS_145]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_144] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_141] (rows=191667562 width=135)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_259] (rows=191667562 width=135)
-                                    Conds:RS_138._col1, _col2=RS_139._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 32 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_139]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_131] (rows=14398467 width=92)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_241] (rows=14398467 width=92)
-                                          predicate:wr_item_sk is not null
-                                          TableScan [TS_55] (rows=14398467 width=92)
-                                            default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_item_sk","wr_order_number","wr_return_quantity","wr_return_amt"]
-                                  <-Reducer 25 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_138]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_258] (rows=174243235 width=135)
-                                        Conds:RS_135._col1=RS_136._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_136]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_128] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_240] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                               Please refer to the previous TableScan [TS_6]
-                                      <-Reducer 24 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_135]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_257] (rows=158402938 width=135)
-                                            Conds:RS_132._col0=RS_133._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_133]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_125] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_239] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2002) and d_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_3]
-                                          <-Map 31 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_132]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_122] (rows=144002668 width=135)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_238] (rows=144002668 width=135)
-                                                  predicate:(ws_item_sk is not null and ws_sold_date_sk is not null)
-                                                  TableScan [TS_46] (rows=144002668 width=135)
-                                                    default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_sold_date_sk","ws_item_sk","ws_order_number","ws_quantity","ws_ext_sales_price"]
-                    <-Reducer 6 [SIMPLE_EDGE]
-                      SHUFFLE [RS_148]
+                        Group By Operator [GBY_168] (rows=191662482 width=111)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
+                          Group By Operator [GBY_163] (rows=383324964 width=111)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
+                          <-Union 16 [SIMPLE_EDGE]
+                            <-Reducer 15 [CONTAINS]
+                              Reduce Output Operator [RS_162]
+                                PartitionCols:_col0, _col1, _col2, _col3
+                                Group By Operator [GBY_161] (rows=766649929 width=111)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                  Group By Operator [GBY_134] (rows=574982367 width=103)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
+                                  <-Union 14 [SIMPLE_EDGE]
+                                    <-Reducer 13 [CONTAINS]
+                                      Reduce Output Operator [RS_133]
+                                        PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
+                                        Group By Operator [GBY_132] (rows=1149964734 width=103)
+                                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                          Select Operator [SEL_106] (rows=383314495 width=135)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                            Merge Join Operator [MERGEJOIN_275] (rows=383314495 width=135)
+                                              Conds:RS_103._col1, _col2=RS_104._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                            <-Map 32 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_104]
+                                                PartitionCols:_col0, _col1
+                                                Select Operator [SEL_96] (rows=28798881 width=106)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_255] (rows=28798881 width=106)
+                                                    predicate:cr_item_sk is not null
+                                                    TableScan [TS_9] (rows=28798881 width=106)
+                                                      default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_item_sk","cr_order_number","cr_return_quantity","cr_return_amount"]
+                                            <-Reducer 12 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_103]
+                                                PartitionCols:_col1, _col2
+                                                Merge Join Operator [MERGEJOIN_274] (rows=348467716 width=135)
+                                                  Conds:RS_100._col1=RS_101._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                                <-Map 31 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_101]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_93] (rows=231000 width=1436)
+                                                      Output:["_col0","_col1","_col2","_col3","_col5"]
+                                                      Filter Operator [FIL_254] (rows=231000 width=1436)
+                                                        predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                        TableScan [TS_6] (rows=462000 width=1436)
+                                                          default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_brand_id","i_class_id","i_category_id","i_category","i_manufact_id"]
+                                                <-Reducer 11 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_100]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_273] (rows=316788826 width=135)
+                                                      Conds:RS_97._col0=RS_98._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                                    <-Map 18 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_98]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_90] (rows=36524 width=1119)
+                                                          Output:["_col0"]
+                                                          Filter Operator [FIL_253] (rows=36524 width=1119)
+                                                            predicate:((d_year = 2002) and d_date_sk is not null)
+                                                            TableScan [TS_3] (rows=73049 width=1119)
+                                                              default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
+                                                    <-Map 1 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_97]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_87] (rows=287989836 width=135)
+                                                          Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                          Filter Operator [FIL_252] (rows=287989836 width=135)
+                                                            predicate:(cs_item_sk is not null and cs_sold_date_sk is not null)
+                                                            TableScan [TS_0] (rows=287989836 width=135)
+                                                              default@catalog_sales,catalog_sales,Tbl:COMPLETE,Col:NONE,Output:["cs_sold_date_sk","cs_item_sk","cs_order_number","cs_quantity","cs_ext_sales_price"]
+                                    <-Reducer 27 [CONTAINS]
+                                      Reduce Output Operator [RS_133]
+                                        PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
+                                        Group By Operator [GBY_132] (rows=1149964734 width=103)
+                                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                          Select Operator [SEL_128] (rows=766650239 width=88)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                            Merge Join Operator [MERGEJOIN_278] (rows=766650239 width=88)
+                                              Conds:RS_125._col1, _col2=RS_126._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                            <-Map 34 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_126]
+                                                PartitionCols:_col0, _col1
+                                                Select Operator [SEL_118] (rows=57591150 width=77)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_259] (rows=57591150 width=77)
+                                                    predicate:sr_item_sk is not null
+                                                    TableScan [TS_31] (rows=57591150 width=77)
+                                                      default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_item_sk","sr_ticket_number","sr_return_quantity","sr_return_amt"]
+                                            <-Reducer 26 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_125]
+                                                PartitionCols:_col1, _col2
+                                                Merge Join Operator [MERGEJOIN_277] (rows=696954748 width=88)
+                                                  Conds:RS_122._col1=RS_123._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                                <-Map 31 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_123]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_115] (rows=231000 width=1436)
+                                                      Output:["_col0","_col1","_col2","_col3","_col5"]
+                                                      Filter Operator [FIL_258] (rows=231000 width=1436)
+                                                        predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                         Please refer to the previous TableScan [TS_6]
+                                                <-Reducer 25 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_122]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_276] (rows=633595212 width=88)
+                                                      Conds:RS_119._col0=RS_120._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                                    <-Map 18 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_120]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_112] (rows=36524 width=1119)
+                                                          Output:["_col0"]
+                                                          Filter Operator [FIL_257] (rows=36524 width=1119)
+                                                            predicate:((d_year = 2002) and d_date_sk is not null)
+                                                             Please refer to the previous TableScan [TS_3]
+                                                    <-Map 33 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_119]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_109] (rows=575995635 width=88)
+                                                          Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                          Filter Operator [FIL_256] (rows=575995635 width=88)
+                                                            predicate:(ss_item_sk is not null and ss_sold_date_sk is not null)
+                                                            TableScan [TS_22] (rows=575995635 width=88)
+                                                              default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_ticket_number","ss_quantity","ss_ext_sales_price"]
+                            <-Reducer 30 [CONTAINS]
+                              Reduce Output Operator [RS_162]
+                                PartitionCols:_col0, _col1, _col2, _col3
+                                Group By Operator [GBY_161] (rows=766649929 width=111)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                  Select Operator [SEL_157] (rows=191667562 width=135)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                    Merge Join Operator [MERGEJOIN_281] (rows=191667562 width=135)
+                                      Conds:RS_154._col1, _col2=RS_155._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                    <-Map 36 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_155]
+                                        PartitionCols:_col0, _col1
+                                        Select Operator [SEL_147] (rows=14398467 width=92)
+                                          Output:["_col0","_col1","_col2","_col3"]
+                                          Filter Operator [FIL_263] (rows=14398467 width=92)
+                                            predicate:wr_item_sk is not null
+                                            TableScan [TS_60] (rows=14398467 width=92)
+                                              default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_item_sk","wr_order_number","wr_return_quantity","wr_return_amt"]
+                                    <-Reducer 29 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_154]
+                                        PartitionCols:_col1, _col2
+                                        Merge Join Operator [MERGEJOIN_280] (rows=174243235 width=135)
+                                          Conds:RS_151._col1=RS_152._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                        <-Map 31 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_152]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_144] (rows=231000 width=1436)
+                                              Output:["_col0","_col1","_col2","_col3","_col5"]
+                                              Filter Operator [FIL_262] (rows=231000 width=1436)
+                                                predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                 Please refer to the previous TableScan [TS_6]
+                                        <-Reducer 28 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_151]
+                                            PartitionCols:_col1
+                                            Merge Join Operator [MERGEJOIN_279] (rows=158402938 width=135)
+                                              Conds:RS_148._col0=RS_149._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                            <-Map 18 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_149]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_141] (rows=36524 width=1119)
+                                                  Output:["_col0"]
+                                                  Filter Operator [FIL_261] (rows=36524 width=1119)
+                                                    predicate:((d_year = 2002) and d_date_sk is not null)
+                                                     Please refer to the previous TableScan [TS_3]
+                                            <-Map 35 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_148]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_138] (rows=144002668 width=135)
+                                                  Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                  Filter Operator [FIL_260] (rows=144002668 width=135)
+                                                    predicate:(ws_item_sk is not null and ws_sold_date_sk is not null)
+                                                    TableScan [TS_51] (rows=144002668 width=135)
+                                                      default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_sold_date_sk","ws_item_sk","ws_order_number","ws_quantity","ws_ext_sales_price"]
+                    <-Reducer 8 [SIMPLE_EDGE]
+                      SHUFFLE [RS_170]
                         PartitionCols:_col0, _col1, _col2, _col3
-                        Group By Operator [GBY_72] (rows=670816148 width=108)
-                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3
-                        <-Union 5 [SIMPLE_EDGE]
-                          <-Reducer 17 [CONTAINS]
-                            Reduce Output Operator [RS_71]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_70] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_43] (rows=766650239 width=88)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_247] (rows=766650239 width=88)
-                                    Conds:RS_40._col1, _col2=RS_41._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 30 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_41]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_33] (rows=57591150 width=77)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_225] (rows=57591150 width=77)
-                                          predicate:sr_item_sk is not null
-                                           Please refer to the previous TableScan [TS_31]
-                                  <-Reducer 16 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_40]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_246] (rows=696954748 width=88)
-                                        Conds:RS_37._col1=RS_38._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_38]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_30] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_224] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                               Please refer to the previous TableScan [TS_6]
-                                      <-Reducer 15 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_37]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_245] (rows=633595212 width=88)
-                                            Conds:RS_34._col0=RS_35._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_35]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_27] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_223] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2001) and d_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_3]
-                                          <-Map 29 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_34]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_24] (rows=575995635 width=88)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_222] (rows=575995635 width=88)
-                                                  predicate:(ss_item_sk is not null and ss_sold_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_22]
-                          <-Reducer 20 [CONTAINS]
-                            Reduce Output Operator [RS_71]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_70] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_67] (rows=191667562 width=135)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_250] (rows=191667562 width=135)
-                                    Conds:RS_64._col1, _col2=RS_65._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 32 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_65]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_57] (rows=14398467 width=92)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_229] (rows=14398467 width=92)
-                                          predicate:wr_item_sk is not null
-                                           Please refer to the previous TableScan [TS_55]
-                                  <-Reducer 19 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_64]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_249] (rows=174243235 width=135)
-                                        Conds:RS_61._col1=RS_62._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_62]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_54] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_228] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                               Please refer to the previous TableScan [TS_6]
-                                      <-Reducer 18 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_61]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_248] (rows=158402938 width=135)
-                                            Conds:RS_58._col0=RS_59._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_59]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_51] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_227] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2001) and d_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_3]
-                                          <-Map 31 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_58]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_48] (rows=144002668 width=135)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_226] (rows=144002668 width=135)
-                                                  predicate:(ws_item_sk is not null and ws_sold_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_46]
-                          <-Reducer 4 [CONTAINS]
-                            Reduce Output Operator [RS_71]
-                              PartitionCols:_col0, _col1, _col2, _col3
-                              Group By Operator [GBY_70] (rows=1341632296 width=108)
-                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
-                                Select Operator [SEL_21] (rows=383314495 width=135)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                                  Merge Join Operator [MERGEJOIN_244] (rows=383314495 width=135)
-                                    Conds:RS_18._col1, _col2=RS_19._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
-                                  <-Map 28 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_19]
-                                      PartitionCols:_col0, _col1
-                                      Select Operator [SEL_11] (rows=28798881 width=106)
-                                        Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_221] (rows=28798881 width=106)
-                                          predicate:cr_item_sk is not null
-                                           Please refer to the previous TableScan [TS_9]
-                                  <-Reducer 3 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_18]
-                                      PartitionCols:_col1, _col2
-                                      Merge Join Operator [MERGEJOIN_243] (rows=348467716 width=135)
-                                        Conds:RS_15._col1=RS_16._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
-                                      <-Map 27 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_16]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_8] (rows=231000 width=1436)
-                                            Output:["_col0","_col1","_col2","_col3","_col5"]
-                                            Filter Operator [FIL_220] (rows=231000 width=1436)
-                                              predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
-                                               Please refer to the previous TableScan [TS_6]
-                                      <-Reducer 2 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_15]
-                                          PartitionCols:_col1
-                                          Merge Join Operator [MERGEJOIN_242] (rows=316788826 width=135)
-                                            Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
-                                          <-Map 14 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_13]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_5] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_219] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2001) and d_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_3]
-                                          <-Map 1 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_12]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_2] (rows=287989836 width=135)
-                                                Output:["_col0","_col1","_col2","_col3","_col4"]
-                                                Filter Operator [FIL_218] (rows=287989836 width=135)
-                                                  predicate:(cs_item_sk is not null and cs_sold_date_sk is not null)
-                                                   Please refer to the previous TableScan [TS_0]
+                        Group By Operator [GBY_83] (rows=191662482 width=111)
+                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col4)","sum(_col5)"],keys:_col0, _col1, _col2, _col3
+                          Group By Operator [GBY_78] (rows=383324964 width=111)
+                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
+                          <-Union 7 [SIMPLE_EDGE]
+                            <-Reducer 24 [CONTAINS]
+                              Reduce Output Operator [RS_77]
+                                PartitionCols:_col0, _col1, _col2, _col3
+                                Group By Operator [GBY_76] (rows=766649929 width=111)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                  Select Operator [SEL_72] (rows=191667562 width=135)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                    Merge Join Operator [MERGEJOIN_272] (rows=191667562 width=135)
+                                      Conds:RS_69._col1, _col2=RS_70._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                    <-Map 36 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_70]
+                                        PartitionCols:_col0, _col1
+                                        Select Operator [SEL_62] (rows=14398467 width=92)
+                                          Output:["_col0","_col1","_col2","_col3"]
+                                          Filter Operator [FIL_251] (rows=14398467 width=92)
+                                            predicate:wr_item_sk is not null
+                                             Please refer to the previous TableScan [TS_60]
+                                    <-Reducer 23 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_69]
+                                        PartitionCols:_col1, _col2
+                                        Merge Join Operator [MERGEJOIN_271] (rows=174243235 width=135)
+                                          Conds:RS_66._col1=RS_67._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                        <-Map 31 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_67]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_59] (rows=231000 width=1436)
+                                              Output:["_col0","_col1","_col2","_col3","_col5"]
+                                              Filter Operator [FIL_250] (rows=231000 width=1436)
+                                                predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                 Please refer to the previous TableScan [TS_6]
+                                        <-Reducer 22 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_66]
+                                            PartitionCols:_col1
+                                            Merge Join Operator [MERGEJOIN_270] (rows=158402938 width=135)
+                                              Conds:RS_63._col0=RS_64._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                            <-Map 18 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_64]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_56] (rows=36524 width=1119)
+                                                  Output:["_col0"]
+                                                  Filter Operator [FIL_249] (rows=36524 width=1119)
+                                                    predicate:((d_year = 2001) and d_date_sk is not null)
+                                                     Please refer to the previous TableScan [TS_3]
+                                            <-Map 35 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_63]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_53] (rows=144002668 width=135)
+                                                  Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                  Filter Operator [FIL_248] (rows=144002668 width=135)
+                                                    predicate:(ws_item_sk is not null and ws_sold_date_sk is not null)
+                                                     Please refer to the previous TableScan [TS_51]
+                            <-Reducer 6 [CONTAINS]
+                              Reduce Output Operator [RS_77]
+                                PartitionCols:_col0, _col1, _col2, _col3
+                                Group By Operator [GBY_76] (rows=766649929 width=111)
+                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                  Group By Operator [GBY_49] (rows=574982367 width=103)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
+                                  <-Union 5 [SIMPLE_EDGE]
+                                    <-Reducer 21 [CONTAINS]
+                                      Reduce Output Operator [RS_48]
+                                        PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
+                                        Group By Operator [GBY_47] (rows=1149964734 width=103)
+                                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                          Select Operator [SEL_43] (rows=766650239 width=88)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                            Merge Join Operator [MERGEJOIN_269] (rows=766650239 width=88)
+                                              Conds:RS_40._col1, _col2=RS_41._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                            <-Map 34 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_41]
+                                                PartitionCols:_col0, _col1
+                                                Select Operator [SEL_33] (rows=57591150 width=77)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_247] (rows=57591150 width=77)
+                                                    predicate:sr_item_sk is not null
+                                                     Please refer to the previous TableScan [TS_31]
+                                            <-Reducer 20 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_40]
+                                                PartitionCols:_col1, _col2
+                                                Merge Join Operator [MERGEJOIN_268] (rows=696954748 width=88)
+                                                  Conds:RS_37._col1=RS_38._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                                <-Map 31 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_38]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_30] (rows=231000 width=1436)
+                                                      Output:["_col0","_col1","_col2","_col3","_col5"]
+                                                      Filter Operator [FIL_246] (rows=231000 width=1436)
+                                                        predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                         Please refer to the previous TableScan [TS_6]
+                                                <-Reducer 19 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_37]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_267] (rows=633595212 width=88)
+                                                      Conds:RS_34._col0=RS_35._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                                    <-Map 18 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_35]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_27] (rows=36524 width=1119)
+                                                          Output:["_col0"]
+                                                          Filter Operator [FIL_245] (rows=36524 width=1119)
+                                                            predicate:((d_year = 2001) and d_date_sk is not null)
+                                                             Please refer to the previous TableScan [TS_3]
+                                                    <-Map 33 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_34]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_24] (rows=575995635 width=88)
+                                                          Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                          Filter Operator [FIL_244] (rows=575995635 width=88)
+                                                            predicate:(ss_item_sk is not null and ss_sold_date_sk is not null)
+                                                             Please refer to the previous TableScan [TS_22]
+                                    <-Reducer 4 [CONTAINS]
+                                      Reduce Output Operator [RS_48]
+                                        PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
+                                        Group By Operator [GBY_47] (rows=1149964734 width=103)
+                                          Output:["_col0","_col1","_col2","_col3","_col4","_col5"],keys:_col0, _col1, _col2, _col3, _col4, _col5
+                                          Select Operator [SEL_21] (rows=383314495 width=135)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                            Merge Join Operator [MERGEJOIN_266] (rows=383314495 width=135)
+                                              Conds:RS_18._col1, _col2=RS_19._col0, _col1(Left Outer),Output:["_col3","_col4","_col8","_col9","_col10","_col12","_col15","_col16"]
+                                            <-Map 32 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_19]
+                                                PartitionCols:_col0, _col1
+                                                Select Operator [SEL_11] (rows=28798881 width=106)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_243] (rows=28798881 width=106)
+                                                    predicate:cr_item_sk is not null
+                                                     Please refer to the previous TableScan [TS_9]
+                                            <-Reducer 3 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_18]
+                                                PartitionCols:_col1, _col2
+                                                Merge Join Operator [MERGEJOIN_265] (rows=348467716 width=135)
+                                                  Conds:RS_15._col1=RS_16._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col8","_col9","_col10","_col12"]
+                                                <-Map 31 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_16]
+                                                    PartitionCols:_col0
+                                                    Select Operator [SEL_8] (rows=231000 width=1436)
+                                                      Output:["_col0","_col1","_col2","_col3","_col5"]
+                                                      Filter Operator [FIL_242] (rows=231000 width=1436)
+                                                        predicate:((i_category = 'Sports') and i_item_sk is not null and i_brand_id is not null and i_class_id is not null and i_category_id is not null and i_manufact_id is not null)
+                                                         Please refer to the previous TableScan [TS_6]
+                                                <-Reducer 2 [SIMPLE_EDGE]
+                                                  SHUFFLE [RS_15]
+                                                    PartitionCols:_col1
+                                                    Merge Join Operator [MERGEJOIN_264] (rows=316788826 width=135)
+                                                      Conds:RS_12._col0=RS_13._col0(Inner),Output:["_col1","_col2","_col3","_col4"]
+                                                    <-Map 18 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_13]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_5] (rows=36524 width=1119)
+                                                          Output:["_col0"]
+                                                          Filter Operator [FIL_241] (rows=36524 width=1119)
+                                                            predicate:((d_year = 2001) and d_date_sk is not null)
+                                                             Please refer to the previous TableScan [TS_3]
+                                                    <-Map 1 [SIMPLE_EDGE]
+                                                      SHUFFLE [RS_12]
+                                                        PartitionCols:_col0
+                                                        Select Operator [SEL_2] (rows=287989836 width=135)
+                                                          Output:["_col0","_col1","_col2","_col3","_col4"]
+                                                          Filter Operator [FIL_240] (rows=287989836 width=135)
+                                                            predicate:(cs_item_sk is not null and cs_sold_date_sk is not null)
+                                                             Please refer to the previous TableScan [TS_0]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/86b18772/ql/src/test/results/clientpositive/perf/query76.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query76.q.out b/ql/src/test/results/clientpositive/perf/query76.q.out
index 19243db..dcd5004 100644
--- a/ql/src/test/results/clientpositive/perf/query76.q.out
+++ b/ql/src/test/results/clientpositive/perf/query76.q.out
@@ -1,6 +1,48 @@
-PREHOOK: query: explain select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM ( SELECT 'store' as channel, 'ss_addr_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price FROM store_sales, item, date_dim WHERE ss_addr_sk IS NULL AND store_sales.ss_sold_date_sk=date_dim.d_date_sk AND store_sales.ss_item_sk=item.i_item_sk UNION ALL SELECT 'web' as channel, 'ws_web_page_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price FROM web_sales, item, date_dim WHERE ws_web_page_sk IS NULL AND web_sales.ws_sold_date_sk=date_dim.d_date_sk AND web_sales.ws_item_sk=item.i_item_sk UNION ALL SELECT 'catalog' as channel, 'cs_warehouse_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price FROM catalog_sales, item, date_dim WHERE cs_warehouse_sk IS NULL AND catalog_sales.cs_sold_date_sk=date_dim.d_date_sk AND catalog_sales.cs_item_sk=item.i_item_sk) foo GROUP BY channel, col_name, d_
 year, d_qoy, i_category ORDER BY channel, col_name, d_year, d_qoy, i_category limit 100
+PREHOOK: query: explain
+select  channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
+        SELECT 'store' as channel, 'ss_addr_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
+         FROM store_sales, item, date_dim
+         WHERE ss_addr_sk IS NULL
+           AND ss_sold_date_sk=d_date_sk
+           AND ss_item_sk=i_item_sk
+        UNION ALL
+        SELECT 'web' as channel, 'ws_web_page_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
+         FROM web_sales, item, date_dim
+         WHERE ws_web_page_sk IS NULL
+           AND ws_sold_date_sk=d_date_sk
+           AND ws_item_sk=i_item_sk
+        UNION ALL
+        SELECT 'catalog' as channel, 'cs_warehouse_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
+         FROM catalog_sales, item, date_dim
+         WHERE cs_warehouse_sk IS NULL
+           AND cs_sold_date_sk=d_date_sk
+           AND cs_item_sk=i_item_sk) foo
+GROUP BY channel, col_name, d_year, d_qoy, i_category
+ORDER BY channel, col_name, d_year, d_qoy, i_category
+limit 100
 PREHOOK: type: QUERY
-POSTHOOK: query: explain select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM ( SELECT 'store' as channel, 'ss_addr_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price FROM store_sales, item, date_dim WHERE ss_addr_sk IS NULL AND store_sales.ss_sold_date_sk=date_dim.d_date_sk AND store_sales.ss_item_sk=item.i_item_sk UNION ALL SELECT 'web' as channel, 'ws_web_page_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price FROM web_sales, item, date_dim WHERE ws_web_page_sk IS NULL AND web_sales.ws_sold_date_sk=date_dim.d_date_sk AND web_sales.ws_item_sk=item.i_item_sk UNION ALL SELECT 'catalog' as channel, 'cs_warehouse_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price FROM catalog_sales, item, date_dim WHERE cs_warehouse_sk IS NULL AND catalog_sales.cs_sold_date_sk=date_dim.d_date_sk AND catalog_sales.cs_item_sk=item.i_item_sk) foo GROUP BY channel, col_name, d
 _year, d_qoy, i_category ORDER BY channel, col_name, d_year, d_qoy, i_category limit 100
+POSTHOOK: query: explain
+select  channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
+        SELECT 'store' as channel, 'ss_addr_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
+         FROM store_sales, item, date_dim
+         WHERE ss_addr_sk IS NULL
+           AND ss_sold_date_sk=d_date_sk
+           AND ss_item_sk=i_item_sk
+        UNION ALL
+        SELECT 'web' as channel, 'ws_web_page_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
+         FROM web_sales, item, date_dim
+         WHERE ws_web_page_sk IS NULL
+           AND ws_sold_date_sk=d_date_sk
+           AND ws_item_sk=i_item_sk
+        UNION ALL
+        SELECT 'catalog' as channel, 'cs_warehouse_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
+         FROM catalog_sales, item, date_dim
+         WHERE cs_warehouse_sk IS NULL
+           AND cs_sold_date_sk=d_date_sk
+           AND cs_item_sk=i_item_sk) foo
+GROUP BY channel, col_name, d_year, d_qoy, i_category
+ORDER BY channel, col_name, d_year, d_qoy, i_category
+limit 100
 POSTHOOK: type: QUERY
 Plan optimized by CBO.