http://git-wip-us.apache.org/repos/asf/hive/blob/86b18772/ql/src/test/results/clientpositive/perf/query54.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query54.q.out 
b/ql/src/test/results/clientpositive/perf/query54.q.out
index e1f5135..3cbcbe3 100644
--- a/ql/src/test/results/clientpositive/perf/query54.q.out
+++ b/ql/src/test/results/clientpositive/perf/query54.q.out
@@ -1,175 +1,396 @@
-PREHOOK: query: explain with my_customers as ( select c_customer_sk , 
c_current_addr_sk from ( select cs_sold_date_sk sold_date_sk, 
cs_bill_customer_sk customer_sk, cs_item_sk item_sk from catalog_sales union 
all select ws_sold_date_sk sold_date_sk, ws_bill_customer_sk customer_sk, 
ws_item_sk item_sk from web_sales ) cs_or_ws_sales, item, date_dim, customer 
where sold_date_sk = d_date_sk and item_sk = i_item_sk and i_category = 
'Jewelry' and i_class = 'football' and c_customer_sk = 
cs_or_ws_sales.customer_sk and d_moy = 3 and d_year = 2000 group by 
c_customer_sk , c_current_addr_sk ) , my_revenue as ( select c_customer_sk, 
sum(ss_ext_sales_price) as revenue from my_customers, store_sales, 
customer_address, store, date_dim where c_current_addr_sk = ca_address_sk and 
ca_county = s_county and ca_state = s_state and ss_sold_date_sk = d_date_sk and 
c_customer_sk = ss_customer_sk and d_month_seq between (1203) and (1205) group 
by c_customer_sk ) , segments as (select cast((revenue/50) as 
 int) as segment from my_revenue ) select segment, count(*) as num_customers, 
segment*50 as segment_base from segments group by segment order by segment, 
num_customers limit 100
+Warning: Shuffle Join MERGEJOIN[191][tables = [$hdt$_1, $hdt$_2]] in Stage 
'Reducer 3' is a cross product
+Warning: Shuffle Join MERGEJOIN[188][tables = [$hdt$_1, $hdt$_2, $hdt$_3, 
$hdt$_0, $hdt$_4]] in Stage 'Reducer 12' is a cross product
+Warning: Shuffle Join MERGEJOIN[190][tables = [$hdt$_1, $hdt$_2, $hdt$_3, 
$hdt$_0, $hdt$_4, $hdt$_5, $hdt$_6]] in Stage 'Reducer 14' is a cross product
+Warning: Shuffle Join MERGEJOIN[192][tables = [$hdt$_1, $hdt$_2, $hdt$_0]] in 
Stage 'Reducer 4' is a cross product
+PREHOOK: query: explain
+with my_customers as (
+ select distinct c_customer_sk
+        , c_current_addr_sk
+ from   
+        ( select cs_sold_date_sk sold_date_sk,
+                 cs_bill_customer_sk customer_sk,
+                 cs_item_sk item_sk
+          from   catalog_sales
+          union all
+          select ws_sold_date_sk sold_date_sk,
+                 ws_bill_customer_sk customer_sk,
+                 ws_item_sk item_sk
+          from   web_sales
+         ) cs_or_ws_sales,
+         item,
+         date_dim,
+         customer
+ where   sold_date_sk = d_date_sk
+         and item_sk = i_item_sk
+         and i_category = 'Jewelry'
+         and i_class = 'consignment'
+         and c_customer_sk = cs_or_ws_sales.customer_sk
+         and d_moy = 3
+         and d_year = 1999
+ )
+ , my_revenue as (
+ select c_customer_sk,
+        sum(ss_ext_sales_price) as revenue
+ from   my_customers,
+        store_sales,
+        customer_address,
+        store,
+        date_dim
+ where  c_current_addr_sk = ca_address_sk
+        and ca_county = s_county
+        and ca_state = s_state
+        and ss_sold_date_sk = d_date_sk
+        and c_customer_sk = ss_customer_sk
+        and d_month_seq between (select distinct d_month_seq+1
+                                 from   date_dim where d_year = 1999 and d_moy 
= 3)
+                           and  (select distinct d_month_seq+3
+                                 from   date_dim where d_year = 1999 and d_moy 
= 3)
+ group by c_customer_sk
+ )
+ , segments as
+ (select cast((revenue/50) as int) as segment
+  from   my_revenue
+ )
+  select  segment, count(*) as num_customers, segment*50 as segment_base
+ from segments
+ group by segment
+ order by segment, num_customers
+ limit 100
 PREHOOK: type: QUERY
-POSTHOOK: query: explain with my_customers as ( select c_customer_sk , 
c_current_addr_sk from ( select cs_sold_date_sk sold_date_sk, 
cs_bill_customer_sk customer_sk, cs_item_sk item_sk from catalog_sales union 
all select ws_sold_date_sk sold_date_sk, ws_bill_customer_sk customer_sk, 
ws_item_sk item_sk from web_sales ) cs_or_ws_sales, item, date_dim, customer 
where sold_date_sk = d_date_sk and item_sk = i_item_sk and i_category = 
'Jewelry' and i_class = 'football' and c_customer_sk = 
cs_or_ws_sales.customer_sk and d_moy = 3 and d_year = 2000 group by 
c_customer_sk , c_current_addr_sk ) , my_revenue as ( select c_customer_sk, 
sum(ss_ext_sales_price) as revenue from my_customers, store_sales, 
customer_address, store, date_dim where c_current_addr_sk = ca_address_sk and 
ca_county = s_county and ca_state = s_state and ss_sold_date_sk = d_date_sk and 
c_customer_sk = ss_customer_sk and d_month_seq between (1203) and (1205) group 
by c_customer_sk ) , segments as (select cast((revenue/50) as
  int) as segment from my_revenue ) select segment, count(*) as num_customers, 
segment*50 as segment_base from segments group by segment order by segment, 
num_customers limit 100
+POSTHOOK: query: explain
+with my_customers as (
+ select distinct c_customer_sk
+        , c_current_addr_sk
+ from   
+        ( select cs_sold_date_sk sold_date_sk,
+                 cs_bill_customer_sk customer_sk,
+                 cs_item_sk item_sk
+          from   catalog_sales
+          union all
+          select ws_sold_date_sk sold_date_sk,
+                 ws_bill_customer_sk customer_sk,
+                 ws_item_sk item_sk
+          from   web_sales
+         ) cs_or_ws_sales,
+         item,
+         date_dim,
+         customer
+ where   sold_date_sk = d_date_sk
+         and item_sk = i_item_sk
+         and i_category = 'Jewelry'
+         and i_class = 'consignment'
+         and c_customer_sk = cs_or_ws_sales.customer_sk
+         and d_moy = 3
+         and d_year = 1999
+ )
+ , my_revenue as (
+ select c_customer_sk,
+        sum(ss_ext_sales_price) as revenue
+ from   my_customers,
+        store_sales,
+        customer_address,
+        store,
+        date_dim
+ where  c_current_addr_sk = ca_address_sk
+        and ca_county = s_county
+        and ca_state = s_state
+        and ss_sold_date_sk = d_date_sk
+        and c_customer_sk = ss_customer_sk
+        and d_month_seq between (select distinct d_month_seq+1
+                                 from   date_dim where d_year = 1999 and d_moy 
= 3)
+                           and  (select distinct d_month_seq+3
+                                 from   date_dim where d_year = 1999 and d_moy 
= 3)
+ group by c_customer_sk
+ )
+ , segments as
+ (select cast((revenue/50) as int) as segment
+  from   my_revenue
+ )
+  select  segment, count(*) as num_customers, segment*50 as segment_base
+ from segments
+ group by segment
+ order by segment, num_customers
+ limit 100
 POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 12 <- Union 13 (CONTAINS)
-Map 18 <- Union 13 (CONTAINS)
-Reducer 10 <- Reducer 17 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
-Reducer 14 <- Map 19 (SIMPLE_EDGE), Union 13 (SIMPLE_EDGE)
-Reducer 15 <- Map 20 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE)
-Reducer 16 <- Map 21 (SIMPLE_EDGE), Reducer 15 (SIMPLE_EDGE)
-Reducer 17 <- Reducer 16 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Map 21 <- Union 22 (CONTAINS)
+Map 27 <- Union 22 (CONTAINS)
+Reducer 10 <- Map 1 (SIMPLE_EDGE)
+Reducer 11 <- Reducer 10 (CUSTOM_SIMPLE_EDGE)
+Reducer 12 <- Reducer 11 (CUSTOM_SIMPLE_EDGE), Reducer 19 (CUSTOM_SIMPLE_EDGE)
+Reducer 13 <- Map 32 (SIMPLE_EDGE), Reducer 12 (SIMPLE_EDGE)
+Reducer 14 <- Reducer 13 (CUSTOM_SIMPLE_EDGE), Reducer 15 (CUSTOM_SIMPLE_EDGE)
+Reducer 15 <- Map 1 (SIMPLE_EDGE)
+Reducer 17 <- Map 16 (SIMPLE_EDGE), Map 20 (SIMPLE_EDGE)
+Reducer 18 <- Reducer 17 (SIMPLE_EDGE), Reducer 26 (SIMPLE_EDGE)
+Reducer 19 <- Map 31 (SIMPLE_EDGE), Reducer 18 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE)
+Reducer 23 <- Map 28 (SIMPLE_EDGE), Union 22 (SIMPLE_EDGE)
+Reducer 24 <- Map 29 (SIMPLE_EDGE), Reducer 23 (SIMPLE_EDGE)
+Reducer 25 <- Map 30 (SIMPLE_EDGE), Reducer 24 (SIMPLE_EDGE)
+Reducer 26 <- Reducer 25 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 2 (CUSTOM_SIMPLE_EDGE), Reducer 9 (CUSTOM_SIMPLE_EDGE)
+Reducer 4 <- Reducer 14 (CUSTOM_SIMPLE_EDGE), Reducer 3 (CUSTOM_SIMPLE_EDGE)
 Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
 Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
-Reducer 9 <- Map 11 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+Reducer 8 <- Map 1 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
-      Reducer 6
-      File Output Operator [FS_69]
-        Limit [LIM_68] (rows=100 width=88)
+      Reducer 7
+      File Output Operator [FS_129]
+        Limit [LIM_128] (rows=100 width=158)
           Number of rows:100
-          Select Operator [SEL_67] (rows=174238687 width=88)
+          Select Operator [SEL_127] (rows=1614130953450400 width=158)
             Output:["_col0","_col1","_col2"]
-          <-Reducer 5 [SIMPLE_EDGE]
-            SHUFFLE [RS_66]
-              Select Operator [SEL_65] (rows=174238687 width=88)
+          <-Reducer 6 [SIMPLE_EDGE]
+            SHUFFLE [RS_126]
+              Select Operator [SEL_125] (rows=1614130953450400 width=158)
                 Output:["_col0","_col1","_col2"]
-                Group By Operator [GBY_64] (rows=174238687 width=88)
+                Group By Operator [GBY_124] (rows=1614130953450400 width=158)
                   
Output:["_col0","_col1"],aggregations:["count(VALUE._col0)"],keys:KEY._col0
-                <-Reducer 4 [SIMPLE_EDGE]
-                  SHUFFLE [RS_63]
+                <-Reducer 5 [SIMPLE_EDGE]
+                  SHUFFLE [RS_123]
                     PartitionCols:_col0
-                    Group By Operator [GBY_62] (rows=348477374 width=88)
+                    Group By Operator [GBY_122] (rows=3228261906900801 
width=158)
                       
Output:["_col0","_col1"],aggregations:["count()"],keys:_col0
-                      Select Operator [SEL_60] (rows=348477374 width=88)
+                      Select Operator [SEL_120] (rows=3228261906900801 
width=158)
                         Output:["_col0"]
-                        Group By Operator [GBY_59] (rows=348477374 width=88)
+                        Group By Operator [GBY_119] (rows=3228261906900801 
width=158)
                           
Output:["_col0","_col1"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0
-                        <-Reducer 3 [SIMPLE_EDGE]
-                          SHUFFLE [RS_58]
+                        <-Reducer 4 [SIMPLE_EDGE]
+                          SHUFFLE [RS_118]
                             PartitionCols:_col0
-                            Group By Operator [GBY_57] (rows=696954748 
width=88)
-                              
Output:["_col0","_col1"],aggregations:["sum(_col2)"],keys:_col10
-                              Merge Join Operator [MERGEJOIN_117] 
(rows=696954748 width=88)
-                                
Conds:RS_53._col1=RS_54._col5(Inner),Output:["_col2","_col10"]
-                              <-Reducer 10 [SIMPLE_EDGE]
-                                SHUFFLE [RS_54]
-                                  PartitionCols:_col5
-                                  Merge Join Operator [MERGEJOIN_116] 
(rows=316240138 width=135)
-                                    
Conds:RS_46._col0=RS_47._col1(Inner),Output:["_col5"]
-                                  <-Reducer 17 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_47]
-                                      PartitionCols:_col1
-                                      Select Operator [SEL_42] (rows=287491029 
width=135)
-                                        Output:["_col0","_col1"]
-                                        Group By Operator [GBY_41] 
(rows=287491029 width=135)
-                                          
Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
-                                        <-Reducer 16 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_40]
-                                            PartitionCols:_col0, _col1
-                                            Group By Operator [GBY_39] 
(rows=574982058 width=135)
-                                              
Output:["_col0","_col1"],keys:_col10, _col9
-                                              Merge Join Operator 
[MERGEJOIN_115] (rows=574982058 width=135)
-                                                
Conds:RS_35._col1=RS_36._col0(Inner),Output:["_col9","_col10"]
-                                              <-Map 21 [SIMPLE_EDGE]
-                                                SHUFFLE [RS_36]
+                            Group By Operator [GBY_117] (rows=6456523813801603 
width=158)
+                              
Output:["_col0","_col1"],aggregations:["sum(_col4)"],keys:_col0
+                              Select Operator [SEL_116] (rows=6456523813801603 
width=158)
+                                Output:["_col0","_col4"]
+                                Filter Operator [FIL_115] 
(rows=6456523813801603 width=158)
+                                  predicate:_col11 BETWEEN _col13 AND _col15
+                                  Select Operator [SEL_114] 
(rows=58108714324214428 width=158)
+                                    
Output:["_col0","_col4","_col11","_col13","_col15"]
+                                    Merge Join Operator [MERGEJOIN_192] 
(rows=58108714324214428 width=158)
+                                      
Conds:(Inner),Output:["_col0","_col2","_col6","_col13","_col15"]
+                                    <-Reducer 14 [CUSTOM_SIMPLE_EDGE]
+                                      PARTITION_ONLY_SHUFFLE [RS_112]
+                                        Select Operator [SEL_107] 
(rows=6363893803988 width=1217)
+                                          
Output:["_col0","_col4","_col11","_col13"]
+                                          Merge Join Operator [MERGEJOIN_190] 
(rows=6363893803988 width=1217)
+                                            Conds:(Left 
Outer),Output:["_col5","_col9","_col12","_col13"]
+                                          <-Reducer 13 [CUSTOM_SIMPLE_EDGE]
+                                            PARTITION_ONLY_SHUFFLE [RS_104]
+                                              Merge Join Operator 
[MERGEJOIN_189] (rows=696954748 width=97)
+                                                
Conds:RS_101._col7=RS_102._col0(Inner),Output:["_col5","_col9","_col12"]
+                                              <-Map 32 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_102]
                                                   PartitionCols:_col0
-                                                  Select Operator [SEL_28] 
(rows=80000000 width=860)
+                                                  Select Operator [SEL_80] 
(rows=73049 width=1119)
                                                     Output:["_col0","_col1"]
-                                                    Filter Operator [FIL_110] 
(rows=80000000 width=860)
-                                                      predicate:(c_customer_sk 
is not null and c_current_addr_sk is not null)
-                                                      TableScan [TS_26] 
(rows=80000000 width=860)
-                                                        
default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
-                                              <-Reducer 15 [SIMPLE_EDGE]
-                                                SHUFFLE [RS_35]
-                                                  PartitionCols:_col1
-                                                  Merge Join Operator 
[MERGEJOIN_114] (rows=522710951 width=135)
-                                                    
Conds:RS_32._col2=RS_33._col0(Inner),Output:["_col1"]
-                                                  <-Map 20 [SIMPLE_EDGE]
-                                                    SHUFFLE [RS_33]
-                                                      PartitionCols:_col0
-                                                      Select Operator [SEL_25] 
(rows=115500 width=1436)
-                                                        Output:["_col0"]
-                                                        Filter Operator 
[FIL_109] (rows=115500 width=1436)
-                                                          
predicate:((i_category = 'Jewelry') and (i_class = 'football') and i_item_sk is 
not null)
-                                                          TableScan [TS_23] 
(rows=462000 width=1436)
-                                                            
default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_class","i_category"]
-                                                  <-Reducer 14 [SIMPLE_EDGE]
-                                                    SHUFFLE [RS_32]
-                                                      PartitionCols:_col2
-                                                      Merge Join Operator 
[MERGEJOIN_113] (rows=475191764 width=135)
-                                                        Conds:Union 
13._col0=RS_30._col0(Inner),Output:["_col1","_col2"]
-                                                      <-Map 19 [SIMPLE_EDGE]
-                                                        SHUFFLE [RS_30]
-                                                          PartitionCols:_col0
-                                                          Select Operator 
[SEL_22] (rows=18262 width=1119)
-                                                            Output:["_col0"]
-                                                            Filter Operator 
[FIL_108] (rows=18262 width=1119)
-                                                              
predicate:((d_moy = 3) and (d_year = 2000) and d_date_sk is not null)
-                                                              TableScan 
[TS_20] (rows=73049 width=1119)
-                                                                
default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_moy"]
-                                                      <-Union 13 [SIMPLE_EDGE]
-                                                        <-Map 12 [CONTAINS]
-                                                          Reduce Output 
Operator [RS_29]
-                                                            PartitionCols:_col0
-                                                            Select Operator 
[SEL_14] (rows=287989836 width=135)
-                                                              
Output:["_col0","_col1","_col2"]
-                                                              Filter Operator 
[FIL_106] (rows=287989836 width=135)
-                                                                
predicate:(cs_item_sk is not null and cs_sold_date_sk is not null and 
cs_bill_customer_sk is not null)
-                                                                TableScan 
[TS_12] (rows=287989836 width=135)
-                                                                  
Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_item_sk"]
-                                                        <-Map 18 [CONTAINS]
-                                                          Reduce Output 
Operator [RS_29]
+                                                    Filter Operator [FIL_180] 
(rows=73049 width=1119)
+                                                      predicate:d_date_sk is 
not null
+                                                      TableScan [TS_78] 
(rows=73049 width=1119)
+                                                        
default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_month_seq"]
+                                              <-Reducer 12 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_101]
+                                                  PartitionCols:_col7
+                                                  Merge Join Operator 
[MERGEJOIN_188] (rows=633595212 width=97)
+                                                    
Conds:(Inner),Output:["_col5","_col7","_col9"]
+                                                  <-Reducer 11 
[CUSTOM_SIMPLE_EDGE]
+                                                    PARTITION_ONLY_SHUFFLE 
[RS_99]
+                                                      Select Operator [SEL_77] 
(rows=1 width=8)
+                                                        Filter Operator 
[FIL_76] (rows=1 width=8)
+                                                          
predicate:(sq_count_check(_col0) <= 1)
+                                                          Group By Operator 
[GBY_74] (rows=1 width=8)
+                                                            
Output:["_col0"],aggregations:["count(VALUE._col0)"]
+                                                          <-Reducer 10 
[CUSTOM_SIMPLE_EDGE]
+                                                            
PARTITION_ONLY_SHUFFLE [RS_73]
+                                                              Group By 
Operator [GBY_72] (rows=1 width=8)
+                                                                
Output:["_col0"],aggregations:["count()"]
+                                                                Select 
Operator [SEL_70] (rows=9131 width=1119)
+                                                                  Group By 
Operator [GBY_69] (rows=9131 width=1119)
+                                                                    
Output:["_col0"],keys:KEY._col0
+                                                                  <-Map 1 
[SIMPLE_EDGE]
+                                                                    SHUFFLE 
[RS_68]
+                                                                      
PartitionCols:_col0
+                                                                      Group By 
Operator [GBY_67] (rows=18262 width=1119)
+                                                                        
Output:["_col0"],keys:_col0
+                                                                        Select 
Operator [SEL_65] (rows=18262 width=1119)
+                                                                          
Output:["_col0"]
+                                                                          
Filter Operator [FIL_179] (rows=18262 width=1119)
+                                                                            
predicate:((d_year = 1999) and (d_moy = 3))
+                                                                            
TableScan [TS_0] (rows=73049 width=1119)
+                                                                              
default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_year","d_moy"]
+                                                  <-Reducer 19 
[CUSTOM_SIMPLE_EDGE]
+                                                    PARTITION_ONLY_SHUFFLE 
[RS_98]
+                                                      Merge Join Operator 
[MERGEJOIN_187] (rows=633595212 width=88)
+                                                        
Conds:RS_95._col5=RS_96._col1(Inner),Output:["_col5","_col7","_col9"]
+                                                      <-Map 31 [SIMPLE_EDGE]
+                                                        SHUFFLE [RS_96]
+                                                          PartitionCols:_col1
+                                                          Select Operator 
[SEL_62] (rows=575995635 width=88)
+                                                            
Output:["_col0","_col1","_col2"]
+                                                            Filter Operator 
[FIL_178] (rows=575995635 width=88)
+                                                              
predicate:(ss_customer_sk is not null and ss_sold_date_sk is not null)
+                                                              TableScan 
[TS_60] (rows=575995635 width=88)
+                                                                
default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_customer_sk","ss_ext_sales_price"]
+                                                      <-Reducer 18 
[SIMPLE_EDGE]
+                                                        SHUFFLE [RS_95]
+                                                          PartitionCols:_col5
+                                                          Merge Join Operator 
[MERGEJOIN_186] (rows=316240138 width=135)
+                                                            
Conds:RS_92._col0=RS_93._col1(Inner),Output:["_col5"]
+                                                          <-Reducer 17 
[SIMPLE_EDGE]
+                                                            SHUFFLE [RS_92]
+                                                              
PartitionCols:_col0
+                                                              Merge Join 
Operator [MERGEJOIN_182] (rows=44000000 width=1014)
+                                                                
Conds:RS_89._col1, _col2=RS_90._col0, _col1(Inner),Output:["_col0"]
+                                                              <-Map 16 
[SIMPLE_EDGE]
+                                                                SHUFFLE [RS_89]
+                                                                  
PartitionCols:_col1, _col2
+                                                                  Select 
Operator [SEL_25] (rows=40000000 width=1014)
+                                                                    
Output:["_col0","_col1","_col2"]
+                                                                    Filter 
Operator [FIL_171] (rows=40000000 width=1014)
+                                                                      
predicate:(ca_address_sk is not null and ca_county is not null and ca_state is 
not null)
+                                                                      
TableScan [TS_23] (rows=40000000 width=1014)
+                                                                        
default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_county","ca_state"]
+                                                              <-Map 20 
[SIMPLE_EDGE]
+                                                                SHUFFLE [RS_90]
+                                                                  
PartitionCols:_col0, _col1
+                                                                  Select 
Operator [SEL_28] (rows=1704 width=1910)
+                                                                    
Output:["_col0","_col1"]
+                                                                    Filter 
Operator [FIL_172] (rows=1704 width=1910)
+                                                                      
predicate:(s_county is not null and s_state is not null)
+                                                                      
TableScan [TS_26] (rows=1704 width=1910)
+                                                                        
default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_county","s_state"]
+                                                          <-Reducer 26 
[SIMPLE_EDGE]
+                                                            SHUFFLE [RS_93]
+                                                              
PartitionCols:_col1
+                                                              Select Operator 
[SEL_59] (rows=287491029 width=135)
+                                                                
Output:["_col0","_col1"]
+                                                                Group By 
Operator [GBY_58] (rows=287491029 width=135)
+                                                                  
Output:["_col0","_col1"],keys:KEY._col0, KEY._col1
+                                                                <-Reducer 25 
[SIMPLE_EDGE]
+                                                                  SHUFFLE 
[RS_57]
+                                                                    
PartitionCols:_col0, _col1
+                                                                    Group By 
Operator [GBY_56] (rows=574982058 width=135)
+                                                                      
Output:["_col0","_col1"],keys:_col10, _col9
+                                                                      Merge 
Join Operator [MERGEJOIN_185] (rows=574982058 width=135)
+                                                                        
Conds:RS_52._col1=RS_53._col0(Inner),Output:["_col9","_col10"]
+                                                                      <-Map 30 
[SIMPLE_EDGE]
+                                                                        
SHUFFLE [RS_53]
+                                                                          
PartitionCols:_col0
+                                                                          
Select Operator [SEL_45] (rows=80000000 width=860)
+                                                                            
Output:["_col0","_col1"]
+                                                                            
Filter Operator [FIL_177] (rows=80000000 width=860)
+                                                                              
predicate:(c_customer_sk is not null and c_current_addr_sk is not null)
+                                                                              
TableScan [TS_43] (rows=80000000 width=860)
+                                                                               
 
default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
+                                                                      
<-Reducer 24 [SIMPLE_EDGE]
+                                                                        
SHUFFLE [RS_52]
+                                                                          
PartitionCols:_col1
+                                                                          
Merge Join Operator [MERGEJOIN_184] (rows=522710951 width=135)
+                                                                            
Conds:RS_49._col2=RS_50._col0(Inner),Output:["_col1"]
+                                                                          
<-Map 29 [SIMPLE_EDGE]
+                                                                            
SHUFFLE [RS_50]
+                                                                              
PartitionCols:_col0
+                                                                              
Select Operator [SEL_42] (rows=115500 width=1436)
+                                                                               
 Output:["_col0"]
+                                                                               
 Filter Operator [FIL_176] (rows=115500 width=1436)
+                                                                               
   predicate:((i_category = 'Jewelry') and (i_class = 'consignment') and 
i_item_sk is not null)
+                                                                               
   TableScan [TS_40] (rows=462000 width=1436)
+                                                                               
     
default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_class","i_category"]
+                                                                          
<-Reducer 23 [SIMPLE_EDGE]
+                                                                            
SHUFFLE [RS_49]
+                                                                              
PartitionCols:_col2
+                                                                              
Merge Join Operator [MERGEJOIN_183] (rows=475191764 width=135)
+                                                                               
 Conds:Union 22._col0=RS_47._col0(Inner),Output:["_col1","_col2"]
+                                                                              
<-Map 28 [SIMPLE_EDGE]
+                                                                               
 SHUFFLE [RS_47]
+                                                                               
   PartitionCols:_col0
+                                                                               
   Select Operator [SEL_39] (rows=18262 width=1119)
+                                                                               
     Output:["_col0"]
+                                                                               
     Filter Operator [FIL_175] (rows=18262 width=1119)
+                                                                               
       predicate:((d_moy = 3) and (d_year = 1999) and d_date_sk is not null)
+                                                                               
       TableScan [TS_37] (rows=73049 width=1119)
+                                                                               
         
default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_moy"]
+                                                                              
<-Union 22 [SIMPLE_EDGE]
+                                                                               
 <-Map 21 [CONTAINS]
+                                                                               
   Reduce Output Operator [RS_46]
+                                                                               
     PartitionCols:_col0
+                                                                               
     Select Operator [SEL_31] (rows=287989836 width=135)
+                                                                               
       Output:["_col0","_col1","_col2"]
+                                                                               
       Filter Operator [FIL_173] (rows=287989836 width=135)
+                                                                               
         predicate:(cs_item_sk is not null and cs_sold_date_sk is not null and 
cs_bill_customer_sk is not null)
+                                                                               
         TableScan [TS_29] (rows=287989836 width=135)
+                                                                               
           Output:["cs_sold_date_sk","cs_bill_customer_sk","cs_item_sk"]
+                                                                               
 <-Map 27 [CONTAINS]
+                                                                               
   Reduce Output Operator [RS_46]
+                                                                               
     PartitionCols:_col0
+                                                                               
     Select Operator [SEL_34] (rows=144002668 width=135)
+                                                                               
       Output:["_col0","_col1","_col2"]
+                                                                               
       Filter Operator [FIL_174] (rows=144002668 width=135)
+                                                                               
         predicate:(ws_item_sk is not null and ws_sold_date_sk is not null and 
ws_bill_customer_sk is not null)
+                                                                               
         TableScan [TS_32] (rows=144002668 width=135)
+                                                                               
           Output:["ws_sold_date_sk","ws_item_sk","ws_bill_customer_sk"]
+                                          <-Reducer 15 [CUSTOM_SIMPLE_EDGE]
+                                            PARTITION_ONLY_SHUFFLE [RS_105]
+                                              Group By Operator [GBY_87] 
(rows=9131 width=1119)
+                                                Output:["_col0"],keys:KEY._col0
+                                              <-Map 1 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_86]
+                                                  PartitionCols:_col0
+                                                  Group By Operator [GBY_85] 
(rows=18262 width=1119)
+                                                    Output:["_col0"],keys:_col0
+                                                    Select Operator [SEL_83] 
(rows=18262 width=1119)
+                                                      Output:["_col0"]
+                                                      Filter Operator 
[FIL_181] (rows=18262 width=1119)
+                                                        predicate:((d_year = 
1999) and (d_moy = 3))
+                                                         Please refer to the 
previous TableScan [TS_0]
+                                    <-Reducer 3 [CUSTOM_SIMPLE_EDGE]
+                                      PARTITION_ONLY_SHUFFLE [RS_111]
+                                        Merge Join Operator [MERGEJOIN_191] 
(rows=9131 width=1128)
+                                          Conds:(Right Outer),Output:["_col0"]
+                                        <-Reducer 2 [CUSTOM_SIMPLE_EDGE]
+                                          PARTITION_ONLY_SHUFFLE [RS_108]
+                                            Group By Operator [GBY_6] 
(rows=9131 width=1119)
+                                              Output:["_col0"],keys:KEY._col0
+                                            <-Map 1 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_5]
+                                                PartitionCols:_col0
+                                                Group By Operator [GBY_4] 
(rows=18262 width=1119)
+                                                  Output:["_col0"],keys:_col0
+                                                  Select Operator [SEL_2] 
(rows=18262 width=1119)
+                                                    Output:["_col0"]
+                                                    Filter Operator [FIL_169] 
(rows=18262 width=1119)
+                                                      predicate:((d_year = 
1999) and (d_moy = 3))
+                                                       Please refer to the 
previous TableScan [TS_0]
+                                        <-Reducer 9 [CUSTOM_SIMPLE_EDGE]
+                                          PARTITION_ONLY_SHUFFLE [RS_109]
+                                            Select Operator [SEL_22] (rows=1 
width=8)
+                                              Filter Operator [FIL_21] (rows=1 
width=8)
+                                                
predicate:(sq_count_check(_col0) <= 1)
+                                                Group By Operator [GBY_19] 
(rows=1 width=8)
+                                                  
Output:["_col0"],aggregations:["count(VALUE._col0)"]
+                                                <-Reducer 8 
[CUSTOM_SIMPLE_EDGE]
+                                                  PARTITION_ONLY_SHUFFLE 
[RS_18]
+                                                    Group By Operator [GBY_17] 
(rows=1 width=8)
+                                                      
Output:["_col0"],aggregations:["count()"]
+                                                      Select Operator [SEL_15] 
(rows=9131 width=1119)
+                                                        Group By Operator 
[GBY_14] (rows=9131 width=1119)
+                                                          
Output:["_col0"],keys:KEY._col0
+                                                        <-Map 1 [SIMPLE_EDGE]
+                                                          SHUFFLE [RS_13]
                                                             PartitionCols:_col0
-                                                            Select Operator 
[SEL_17] (rows=144002668 width=135)
-                                                              
Output:["_col0","_col1","_col2"]
-                                                              Filter Operator 
[FIL_107] (rows=144002668 width=135)
-                                                                
predicate:(ws_item_sk is not null and ws_sold_date_sk is not null and 
ws_bill_customer_sk is not null)
-                                                                TableScan 
[TS_15] (rows=144002668 width=135)
-                                                                  
Output:["ws_sold_date_sk","ws_item_sk","ws_bill_customer_sk"]
-                                  <-Reducer 9 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_46]
-                                      PartitionCols:_col0
-                                      Merge Join Operator [MERGEJOIN_112] 
(rows=44000000 width=1014)
-                                        Conds:RS_43._col1, _col2=RS_44._col0, 
_col1(Inner),Output:["_col0"]
-                                      <-Map 11 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_44]
-                                          PartitionCols:_col0, _col1
-                                          Select Operator [SEL_11] (rows=1704 
width=1910)
-                                            Output:["_col0","_col1"]
-                                            Filter Operator [FIL_105] 
(rows=1704 width=1910)
-                                              predicate:(s_county is not null 
and s_state is not null)
-                                              TableScan [TS_9] (rows=1704 
width=1910)
-                                                
default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_county","s_state"]
-                                      <-Map 8 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_43]
-                                          PartitionCols:_col1, _col2
-                                          Select Operator [SEL_8] 
(rows=40000000 width=1014)
-                                            Output:["_col0","_col1","_col2"]
-                                            Filter Operator [FIL_104] 
(rows=40000000 width=1014)
-                                              predicate:(ca_address_sk is not 
null and ca_county is not null and ca_state is not null)
-                                              TableScan [TS_6] (rows=40000000 
width=1014)
-                                                
default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_county","ca_state"]
-                              <-Reducer 2 [SIMPLE_EDGE]
-                                SHUFFLE [RS_53]
-                                  PartitionCols:_col1
-                                  Merge Join Operator [MERGEJOIN_111] 
(rows=633595212 width=88)
-                                    
Conds:RS_50._col0=RS_51._col0(Inner),Output:["_col1","_col2"]
-                                  <-Map 1 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_50]
-                                      PartitionCols:_col0
-                                      Select Operator [SEL_2] (rows=575995635 
width=88)
-                                        Output:["_col0","_col1","_col2"]
-                                        Filter Operator [FIL_102] 
(rows=575995635 width=88)
-                                          predicate:(ss_customer_sk is not 
null and ss_sold_date_sk is not null)
-                                          TableScan [TS_0] (rows=575995635 
width=88)
-                                            
default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_customer_sk","ss_ext_sales_price"]
-                                  <-Map 7 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_51]
-                                      PartitionCols:_col0
-                                      Select Operator [SEL_5] (rows=8116 
width=1119)
-                                        Output:["_col0"]
-                                        Filter Operator [FIL_103] (rows=8116 
width=1119)
-                                          predicate:(d_month_seq BETWEEN 1203 
AND 1205 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_month_seq"]
+                                                            Group By Operator 
[GBY_12] (rows=18262 width=1119)
+                                                              
Output:["_col0"],keys:_col0
+                                                              Select Operator 
[SEL_10] (rows=18262 width=1119)
+                                                                
Output:["_col0"]
+                                                                Filter 
Operator [FIL_170] (rows=18262 width=1119)
+                                                                  
predicate:((d_year = 1999) and (d_moy = 3))
+                                                                   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/query55.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query55.q.out 
b/ql/src/test/results/clientpositive/perf/query55.q.out
index 7948b6d..7125422 100644
--- a/ql/src/test/results/clientpositive/perf/query55.q.out
+++ b/ql/src/test/results/clientpositive/perf/query55.q.out
@@ -1,6 +1,28 @@
-PREHOOK: query: explain select i_brand_id brand_id, i_brand brand, 
sum(ss_ext_sales_price) ext_price from date_dim, store_sales, item where 
date_dim.d_date_sk = store_sales.ss_sold_date_sk and store_sales.ss_item_sk = 
item.i_item_sk and i_manager_id=36 and d_moy=12 and d_year=2001 group by 
i_brand, i_brand_id order by ext_price desc, i_brand_id limit 100
+PREHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand,
+       sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item
+ where d_date_sk = ss_sold_date_sk
+       and ss_item_sk = i_item_sk
+       and i_manager_id=36
+       and d_moy=12
+       and d_year=2001
+ group by i_brand, i_brand_id
+ order by ext_price desc, i_brand_id
+limit 100
 PREHOOK: type: QUERY
-POSTHOOK: query: explain select i_brand_id brand_id, i_brand brand, 
sum(ss_ext_sales_price) ext_price from date_dim, store_sales, item where 
date_dim.d_date_sk = store_sales.ss_sold_date_sk and store_sales.ss_item_sk = 
item.i_item_sk and i_manager_id=36 and d_moy=12 and d_year=2001 group by 
i_brand, i_brand_id order by ext_price desc, i_brand_id limit 100
+POSTHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand,
+       sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item
+ where d_date_sk = ss_sold_date_sk
+       and ss_item_sk = i_item_sk
+       and i_manager_id=36
+       and d_moy=12
+       and d_year=2001
+ group by i_brand, i_brand_id
+ order by ext_price desc, i_brand_id
+limit 100
 POSTHOOK: type: QUERY
 Plan optimized by CBO.
 

http://git-wip-us.apache.org/repos/asf/hive/blob/86b18772/ql/src/test/results/clientpositive/perf/query56.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query56.q.out 
b/ql/src/test/results/clientpositive/perf/query56.q.out
index 9e710e0..4ec7201 100644
--- a/ql/src/test/results/clientpositive/perf/query56.q.out
+++ b/ql/src/test/results/clientpositive/perf/query56.q.out
@@ -1,4 +1,5 @@
-PREHOOK: query: explain with ss as (
+PREHOOK: query: explain
+with ss as (
  select i_item_id,sum(ss_ext_sales_price) total_sales
  from
        store_sales,
@@ -64,7 +65,8 @@ where i_color in ('orchid','chiffon','lace'))
  order by total_sales
  limit 100
 PREHOOK: type: QUERY
-POSTHOOK: query: explain with ss as (
+POSTHOOK: query: explain
+with ss as (
  select i_item_id,sum(ss_ext_sales_price) total_sales
  from
        store_sales,

Reply via email to