http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query43.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query43.q.out 
b/ql/src/test/results/clientpositive/perf/query43.q.out
new file mode 100644
index 0000000..4e738e6
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query43.q.out
@@ -0,0 +1,118 @@
+PREHOOK: query: explain select s_store_name, s_store_id, sum(case when 
(d_day_name='Sunday') then ss_sales_price else null end) sun_sales, sum(case 
when (d_day_name='Monday') then ss_sales_price else null end) mon_sales, 
sum(case when (d_day_name='Tuesday') then ss_sales_price else null end) 
tue_sales, sum(case when (d_day_name='Wednesday') then ss_sales_price else null 
end) wed_sales, sum(case when (d_day_name='Thursday') then ss_sales_price else 
null end) thu_sales, sum(case when (d_day_name='Friday') then ss_sales_price 
else null end) fri_sales, sum(case when (d_day_name='Saturday') then 
ss_sales_price else null end) sat_sales from date_dim, store_sales, store where 
date_dim.d_date_sk = store_sales.ss_sold_date_sk and store.s_store_sk = 
store_sales.ss_store_sk and s_gmt_offset = -6 and d_year = 1998 group by 
s_store_name, s_store_id order by s_store_name, 
s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
 limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select s_store_name, s_store_id, sum(case when 
(d_day_name='Sunday') then ss_sales_price else null end) sun_sales, sum(case 
when (d_day_name='Monday') then ss_sales_price else null end) mon_sales, 
sum(case when (d_day_name='Tuesday') then ss_sales_price else null end) 
tue_sales, sum(case when (d_day_name='Wednesday') then ss_sales_price else null 
end) wed_sales, sum(case when (d_day_name='Thursday') then ss_sales_price else 
null end) thu_sales, sum(case when (d_day_name='Friday') then ss_sales_price 
else null end) fri_sales, sum(case when (d_day_name='Saturday') then 
ss_sales_price else null end) sat_sales from date_dim, store_sales, store where 
date_dim.d_date_sk = store_sales.ss_sold_date_sk and store.s_store_sk = 
store_sales.ss_store_sk and s_gmt_offset = -6 and d_year = 1998 group by 
s_store_name, s_store_id order by s_store_name, 
s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
 limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 3 <- Map 7 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:100
+      Stage-1
+         Reducer 5
+         File Output Operator [FS_28]
+            compressed:false
+            Statistics:Num rows: 100 Data size: 111900 Basic stats: COMPLETE 
Column stats: NONE
+            table:{"input 
format:":"org.apache.hadoop.mapred.TextInputFormat","output 
format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Limit [LIM_27]
+               Number of rows:100
+               Statistics:Num rows: 100 Data size: 111900 Basic stats: 
COMPLETE Column stats: NONE
+               Select Operator [SEL_26]
+               |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+               |  Statistics:Num rows: 22096 Data size: 24726006 Basic stats: 
COMPLETE Column stats: NONE
+               |<-Reducer 4 [SIMPLE_EDGE]
+                  Reduce Output Operator [RS_25]
+                     key expressions:_col0 (type: string), _col1 (type: 
string), _col2 (type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: 
decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 
(type: decimal(17,2)), _col8 (type: decimal(17,2))
+                     sort order:+++++++++
+                     Statistics:Num rows: 22096 Data size: 24726006 Basic 
stats: COMPLETE Column stats: NONE
+                     Group By Operator [GBY_23]
+                     |  
aggregations:["sum(VALUE._col0)","sum(VALUE._col1)","sum(VALUE._col2)","sum(VALUE._col3)","sum(VALUE._col4)","sum(VALUE._col5)","sum(VALUE._col6)"]
+                     |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
+                     |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                     |  Statistics:Num rows: 22096 Data size: 24726006 Basic 
stats: COMPLETE Column stats: NONE
+                     |<-Reducer 3 [SIMPLE_EDGE]
+                        Reduce Output Operator [RS_22]
+                           key expressions:_col0 (type: string), _col1 (type: 
string)
+                           Map-reduce partition columns:_col0 (type: string), 
_col1 (type: string)
+                           sort order:++
+                           Statistics:Num rows: 44193 Data size: 49453132 
Basic stats: COMPLETE Column stats: NONE
+                           value expressions:_col2 (type: decimal(17,2)), 
_col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 (type: 
decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2)), _col8 
(type: decimal(17,2))
+                           Group By Operator [GBY_21]
+                              
aggregations:["sum(_col2)","sum(_col3)","sum(_col4)","sum(_col5)","sum(_col6)","sum(_col7)","sum(_col8)"]
+                              keys:_col0 (type: string), _col1 (type: string)
+                              
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                              Statistics:Num rows: 44193 Data size: 49453132 
Basic stats: COMPLETE Column stats: NONE
+                              Select Operator [SEL_19]
+                                 
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                                 Statistics:Num rows: 44193 Data size: 
49453132 Basic stats: COMPLETE Column stats: NONE
+                                 Merge Join Operator [MERGEJOIN_38]
+                                 |  condition map:[{"":"Inner Join 0 to 1"}]
+                                 |  keys:{"0":"_col4 (type: int)","1":"_col0 
(type: int)"}
+                                 |  
outputColumnNames:["_col2","_col5","_col7","_col8"]
+                                 |  Statistics:Num rows: 44193 Data size: 
49453132 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Map 7 [SIMPLE_EDGE]
+                                 |  Reduce Output Operator [RS_17]
+                                 |     key expressions:_col0 (type: int)
+                                 |     Map-reduce partition columns:_col0 
(type: int)
+                                 |     sort order:+
+                                 |     Statistics:Num rows: 852 Data size: 
1628138 Basic stats: COMPLETE Column stats: NONE
+                                 |     value expressions:_col1 (type: string), 
_col2 (type: string)
+                                 |     Select Operator [SEL_8]
+                                 |        
outputColumnNames:["_col0","_col1","_col2"]
+                                 |        Statistics:Num rows: 852 Data size: 
1628138 Basic stats: COMPLETE Column stats: NONE
+                                 |        Filter Operator [FIL_36]
+                                 |           predicate:((s_gmt_offset = -6) 
and s_store_sk is not null) (type: boolean)
+                                 |           Statistics:Num rows: 852 Data 
size: 1628138 Basic stats: COMPLETE Column stats: NONE
+                                 |           TableScan [TS_6]
+                                 |              alias:store
+                                 |              Statistics:Num rows: 1704 Data 
size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Reducer 2 [SIMPLE_EDGE]
+                                    Reduce Output Operator [RS_15]
+                                       key expressions:_col4 (type: int)
+                                       Map-reduce partition columns:_col4 
(type: int)
+                                       sort order:+
+                                       Statistics:Num rows: 40176 Data size: 
44957392 Basic stats: COMPLETE Column stats: NONE
+                                       value expressions:_col2 (type: string), 
_col5 (type: decimal(7,2))
+                                       Merge Join Operator [MERGEJOIN_37]
+                                       |  condition map:[{"":"Inner Join 0 to 
1"}]
+                                       |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
+                                       |  
outputColumnNames:["_col2","_col4","_col5"]
+                                       |  Statistics:Num rows: 40176 Data 
size: 44957392 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 1 [SIMPLE_EDGE]
+                                       |  Reduce Output Operator [RS_10]
+                                       |     key expressions:_col0 (type: int)
+                                       |     Map-reduce partition 
columns:_col0 (type: int)
+                                       |     sort order:+
+                                       |     Statistics:Num rows: 36524 Data 
size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                       |     value expressions:_col2 (type: 
string)
+                                       |     Select Operator [SEL_2]
+                                       |        
outputColumnNames:["_col0","_col2"]
+                                       |        Statistics:Num rows: 36524 
Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                       |        Filter Operator [FIL_34]
+                                       |           predicate:((d_year = 1998) 
and d_date_sk is not null) (type: boolean)
+                                       |           Statistics:Num rows: 36524 
Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
+                                       |           TableScan [TS_0]
+                                       |              alias:date_dim
+                                       |              Statistics:Num rows: 
73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 6 [SIMPLE_EDGE]
+                                          Reduce Output Operator [RS_12]
+                                             key expressions:_col0 (type: int)
+                                             Map-reduce partition 
columns:_col0 (type: int)
+                                             sort order:+
+                                             Statistics:Num rows: 1 Data size: 
0 Basic stats: PARTIAL Column stats: NONE
+                                             value expressions:_col1 (type: 
int), _col2 (type: decimal(7,2))
+                                             Select Operator [SEL_5]
+                                                
outputColumnNames:["_col0","_col1","_col2"]
+                                                Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                Filter Operator [FIL_35]
+                                                   predicate:(ss_sold_date_sk 
is not null and ss_store_sk is not null) (type: boolean)
+                                                   Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                   TableScan [TS_3]
+                                                      alias:store_sales
+                                                      Statistics:Num rows: 1 
Data size: 0 Basic stats: PARTIAL Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query45.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query45.q.out 
b/ql/src/test/results/clientpositive/perf/query45.q.out
new file mode 100644
index 0000000..dd14ac4
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query45.q.out
@@ -0,0 +1,210 @@
+PREHOOK: query: explain select ca_zip, ca_county, sum(ws_sales_price) from 
web_sales JOIN customer ON web_sales.ws_bill_customer_sk = 
customer.c_customer_sk JOIN customer_address ON customer.c_current_addr_sk = 
customer_address.ca_address_sk JOIN date_dim ON web_sales.ws_sold_date_sk = 
date_dim.d_date_sk JOIN item ON web_sales.ws_item_sk = item.i_item_sk where ( 
item.i_item_id in (select i_item_id from item i2 where i2.i_item_sk in (2, 3, 
5, 7, 11, 13, 17, 19, 23, 29) ) ) and d_qoy = 2 and d_year = 2000 group by 
ca_zip, ca_county order by ca_zip, ca_county limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select ca_zip, ca_county, sum(ws_sales_price) from 
web_sales JOIN customer ON web_sales.ws_bill_customer_sk = 
customer.c_customer_sk JOIN customer_address ON customer.c_current_addr_sk = 
customer_address.ca_address_sk JOIN date_dim ON web_sales.ws_sold_date_sk = 
date_dim.d_date_sk JOIN item ON web_sales.ws_item_sk = item.i_item_sk where ( 
item.i_item_id in (select i_item_id from item i2 where i2.i_item_sk in (2, 3, 
5, 7, 11, 13, 17, 19, 23, 29) ) ) and d_qoy = 2 and d_year = 2000 group by 
ca_zip, ca_county order by ca_zip, ca_county limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 13 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 3 <- Map 9 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 12 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:100
+      Stage-1
+         Reducer 7
+         File Output Operator [FS_54]
+            compressed:false
+            Statistics:Num rows: 100 Data size: 86000 Basic stats: COMPLETE 
Column stats: NONE
+            table:{"input 
format:":"org.apache.hadoop.mapred.TextInputFormat","output 
format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Limit [LIM_53]
+               Number of rows:100
+               Statistics:Num rows: 100 Data size: 86000 Basic stats: COMPLETE 
Column stats: NONE
+               Select Operator [SEL_52]
+               |  outputColumnNames:["_col0","_col1","_col2"]
+               |  Statistics:Num rows: 58564004 Data size: 50366227250 Basic 
stats: COMPLETE Column stats: NONE
+               |<-Reducer 6 [SIMPLE_EDGE]
+                  Reduce Output Operator [RS_51]
+                     key expressions:_col0 (type: string), _col1 (type: string)
+                     sort order:++
+                     Statistics:Num rows: 58564004 Data size: 50366227250 
Basic stats: COMPLETE Column stats: NONE
+                     value expressions:_col2 (type: decimal(17,2))
+                     Select Operator [SEL_50]
+                        outputColumnNames:["_col0","_col1","_col2"]
+                        Statistics:Num rows: 58564004 Data size: 50366227250 
Basic stats: COMPLETE Column stats: NONE
+                        Group By Operator [GBY_49]
+                        |  aggregations:["sum(VALUE._col0)"]
+                        |  keys:KEY._col0 (type: string), KEY._col1 (type: 
string)
+                        |  outputColumnNames:["_col0","_col1","_col2"]
+                        |  Statistics:Num rows: 58564004 Data size: 
50366227250 Basic stats: COMPLETE Column stats: NONE
+                        |<-Reducer 5 [SIMPLE_EDGE]
+                           Reduce Output Operator [RS_48]
+                              key expressions:_col0 (type: string), _col1 
(type: string)
+                              Map-reduce partition columns:_col0 (type: 
string), _col1 (type: string)
+                              sort order:++
+                              Statistics:Num rows: 117128008 Data size: 
100732454500 Basic stats: COMPLETE Column stats: NONE
+                              value expressions:_col2 (type: decimal(17,2))
+                              Group By Operator [GBY_47]
+                                 aggregations:["sum(_col3)"]
+                                 keys:_col7 (type: string), _col8 (type: 
string)
+                                 outputColumnNames:["_col0","_col1","_col2"]
+                                 Statistics:Num rows: 117128008 Data size: 
100732454500 Basic stats: COMPLETE Column stats: NONE
+                                 Select Operator [SEL_46]
+                                    outputColumnNames:["_col7","_col8","_col3"]
+                                    Statistics:Num rows: 117128008 Data size: 
100732454500 Basic stats: COMPLETE Column stats: NONE
+                                    Merge Join Operator [MERGEJOIN_82]
+                                    |  condition map:[{"":"Inner Join 0 to 1"}]
+                                    |  keys:{"0":"_col1 (type: 
int)","1":"_col0 (type: int)"}
+                                    |  
outputColumnNames:["_col3","_col7","_col8"]
+                                    |  Statistics:Num rows: 117128008 Data 
size: 100732454500 Basic stats: COMPLETE Column stats: NONE
+                                    |<-Reducer 12 [SIMPLE_EDGE]
+                                    |  Reduce Output Operator [RS_44]
+                                    |     key expressions:_col0 (type: int)
+                                    |     Map-reduce partition columns:_col0 
(type: int)
+                                    |     sort order:+
+                                    |     Statistics:Num rows: 508200 Data 
size: 729916518 Basic stats: COMPLETE Column stats: NONE
+                                    |     Merge Join Operator [MERGEJOIN_81]
+                                    |     |  condition map:[{"":"Left Semi 
Join 0 to 1"}]
+                                    |     |  keys:{"0":"_col1 (type: 
string)","1":"_col0 (type: string)"}
+                                    |     |  outputColumnNames:["_col0"]
+                                    |     |  Statistics:Num rows: 508200 Data 
size: 729916518 Basic stats: COMPLETE Column stats: NONE
+                                    |     |<-Map 11 [SIMPLE_EDGE]
+                                    |     |  Reduce Output Operator [RS_21]
+                                    |     |     key expressions:_col1 (type: 
string)
+                                    |     |     Map-reduce partition 
columns:_col1 (type: string)
+                                    |     |     sort order:+
+                                    |     |     Statistics:Num rows: 462000 
Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                    |     |     value expressions:_col0 (type: 
int)
+                                    |     |     Select Operator [SEL_14]
+                                    |     |        
outputColumnNames:["_col0","_col1"]
+                                    |     |        Statistics:Num rows: 462000 
Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                    |     |        Filter Operator [FIL_76]
+                                    |     |           predicate:(i_item_sk is 
not null and i_item_id is not null) (type: boolean)
+                                    |     |           Statistics:Num rows: 
462000 Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                    |     |           TableScan [TS_12]
+                                    |     |              alias:item
+                                    |     |              Statistics:Num rows: 
462000 Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                    |     |<-Map 13 [SIMPLE_EDGE]
+                                    |        Reduce Output Operator [RS_23]
+                                    |           key expressions:_col0 (type: 
string)
+                                    |           Map-reduce partition 
columns:_col0 (type: string)
+                                    |           sort order:+
+                                    |           Statistics:Num rows: 231000 
Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                    |           Group By Operator [GBY_19]
+                                    |              keys:_col0 (type: string)
+                                    |              outputColumnNames:["_col0"]
+                                    |              Statistics:Num rows: 231000 
Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                    |              Select Operator [SEL_17]
+                                    |                 
outputColumnNames:["_col0"]
+                                    |                 Statistics:Num rows: 
231000 Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                    |                 Filter Operator [FIL_77]
+                                    |                    
predicate:((i_item_sk) IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29) and i_item_id is 
not null) (type: boolean)
+                                    |                    Statistics:Num rows: 
231000 Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
+                                    |                    TableScan [TS_15]
+                                    |                       alias:item
+                                    |                       Statistics:Num 
rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
+                                    |<-Reducer 4 [SIMPLE_EDGE]
+                                       Reduce Output Operator [RS_42]
+                                          key expressions:_col1 (type: int)
+                                          Map-reduce partition columns:_col1 
(type: int)
+                                          sort order:+
+                                          Statistics:Num rows: 106480005 Data 
size: 91574956652 Basic stats: COMPLETE Column stats: NONE
+                                          value expressions:_col3 (type: 
decimal(7,2)), _col7 (type: string), _col8 (type: string)
+                                          Merge Join Operator [MERGEJOIN_80]
+                                          |  condition map:[{"":"Inner Join 0 
to 1"}]
+                                          |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
+                                          |  
outputColumnNames:["_col1","_col3","_col7","_col8"]
+                                          |  Statistics:Num rows: 106480005 
Data size: 91574956652 Basic stats: COMPLETE Column stats: NONE
+                                          |<-Map 10 [SIMPLE_EDGE]
+                                          |  Reduce Output Operator [RS_39]
+                                          |     key expressions:_col0 (type: 
int)
+                                          |     Map-reduce partition 
columns:_col0 (type: int)
+                                          |     sort order:+
+                                          |     Statistics:Num rows: 18262 
Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                          |     Select Operator [SEL_11]
+                                          |        outputColumnNames:["_col0"]
+                                          |        Statistics:Num rows: 18262 
Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                          |        Filter Operator [FIL_75]
+                                          |           predicate:(((d_qoy = 2) 
and (d_year = 2000)) and d_date_sk is not null) (type: boolean)
+                                          |           Statistics:Num rows: 
18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
+                                          |           TableScan [TS_9]
+                                          |              alias:date_dim
+                                          |              Statistics:Num rows: 
73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
+                                          |<-Reducer 3 [SIMPLE_EDGE]
+                                             Reduce Output Operator [RS_37]
+                                                key expressions:_col0 (type: 
int)
+                                                Map-reduce partition 
columns:_col0 (type: int)
+                                                sort order:+
+                                                Statistics:Num rows: 96800003 
Data size: 83249958789 Basic stats: COMPLETE Column stats: NONE
+                                                value expressions:_col1 (type: 
int), _col3 (type: decimal(7,2)), _col7 (type: string), _col8 (type: string)
+                                                Merge Join Operator 
[MERGEJOIN_79]
+                                                |  condition map:[{"":"Inner 
Join 0 to 1"}]
+                                                |  keys:{"0":"_col5 (type: 
int)","1":"_col0 (type: int)"}
+                                                |  
outputColumnNames:["_col0","_col1","_col3","_col7","_col8"]
+                                                |  Statistics:Num rows: 
96800003 Data size: 83249958789 Basic stats: COMPLETE Column stats: NONE
+                                                |<-Map 9 [SIMPLE_EDGE]
+                                                |  Reduce Output Operator 
[RS_34]
+                                                |     key expressions:_col0 
(type: int)
+                                                |     Map-reduce partition 
columns:_col0 (type: int)
+                                                |     sort order:+
+                                                |     Statistics:Num rows: 
40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                |     value expressions:_col1 
(type: string), _col2 (type: string)
+                                                |     Select Operator [SEL_8]
+                                                |        
outputColumnNames:["_col0","_col1","_col2"]
+                                                |        Statistics:Num rows: 
40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                |        Filter Operator 
[FIL_74]
+                                                |           
predicate:ca_address_sk is not null (type: boolean)
+                                                |           Statistics:Num 
rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                |           TableScan [TS_6]
+                                                |              
alias:customer_address
+                                                |              Statistics:Num 
rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                |<-Reducer 2 [SIMPLE_EDGE]
+                                                   Reduce Output Operator 
[RS_32]
+                                                      key expressions:_col5 
(type: int)
+                                                      Map-reduce partition 
columns:_col5 (type: int)
+                                                      sort order:+
+                                                      Statistics:Num rows: 
88000001 Data size: 75681779077 Basic stats: COMPLETE Column stats: NONE
+                                                      value expressions:_col0 
(type: int), _col1 (type: int), _col3 (type: decimal(7,2))
+                                                      Merge Join Operator 
[MERGEJOIN_78]
+                                                      |  condition 
map:[{"":"Inner Join 0 to 1"}]
+                                                      |  keys:{"0":"_col2 
(type: int)","1":"_col0 (type: int)"}
+                                                      |  
outputColumnNames:["_col0","_col1","_col3","_col5"]
+                                                      |  Statistics:Num rows: 
88000001 Data size: 75681779077 Basic stats: COMPLETE Column stats: NONE
+                                                      |<-Map 1 [SIMPLE_EDGE]
+                                                      |  Reduce Output 
Operator [RS_27]
+                                                      |     key 
expressions:_col2 (type: int)
+                                                      |     Map-reduce 
partition columns:_col2 (type: int)
+                                                      |     sort order:+
+                                                      |     Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                      |     value 
expressions:_col0 (type: int), _col1 (type: int), _col3 (type: decimal(7,2))
+                                                      |     Select Operator 
[SEL_2]
+                                                      |        
outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                                      |        Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                      |        Filter Operator 
[FIL_72]
+                                                      |           
predicate:((ws_bill_customer_sk is not null and ws_sold_date_sk is not null) 
and ws_item_sk is not null) (type: boolean)
+                                                      |           
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                      |           TableScan 
[TS_0]
+                                                      |              
alias:web_sales
+                                                      |              
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                      |<-Map 8 [SIMPLE_EDGE]
+                                                         Reduce Output 
Operator [RS_29]
+                                                            key 
expressions:_col0 (type: int)
+                                                            Map-reduce 
partition columns:_col0 (type: int)
+                                                            sort order:+
+                                                            Statistics:Num 
rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                            value 
expressions:_col1 (type: int)
+                                                            Select Operator 
[SEL_5]
+                                                               
outputColumnNames:["_col0","_col1"]
+                                                               Statistics:Num 
rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                                               Filter Operator 
[FIL_73]
+                                                                  
predicate:(c_customer_sk is not null and c_current_addr_sk is not null) (type: 
boolean)
+                                                                  
Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE 
Column stats: NONE
+                                                                  TableScan 
[TS_3]
+                                                                     
alias:customer
+                                                                     
Statistics:Num rows: 80000000 Data size: 68801615852 Basic stats: COMPLETE 
Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query46.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query46.q.out 
b/ql/src/test/results/clientpositive/perf/query46.q.out
new file mode 100644
index 0000000..5d11fd7
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query46.q.out
@@ -0,0 +1,241 @@
+PREHOOK: query: explain select c_last_name ,c_first_name ,ca_city ,bought_city 
,ss_ticket_number ,amt,profit from (select ss_ticket_number ,ss_customer_sk 
,ca_city bought_city ,sum(ss_coupon_amt) amt ,sum(ss_net_profit) profit from 
store_sales,date_dim,store,household_demographics,customer_address where 
store_sales.ss_sold_date_sk = date_dim.d_date_sk and store_sales.ss_store_sk = 
store.s_store_sk and store_sales.ss_hdemo_sk = 
household_demographics.hd_demo_sk and store_sales.ss_addr_sk = 
customer_address.ca_address_sk and (household_demographics.hd_dep_count = 4 or 
household_demographics.hd_vehicle_count= 2) and date_dim.d_dow in (6,0) and 
date_dim.d_year in (1998,1998+1,1998+2) and store.s_city in 
('Rosedale','Bethlehem','Clinton','Clifton','Springfield') group by 
ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) 
dn,customer,customer_address current_addr where dn.ss_customer_sk = 
customer.c_customer_sk and customer.c_current_addr_sk = 
current_addr.ca_address_sk and current_addr.
 ca_city <> bought_city order by c_last_name ,c_first_name ,ca_city 
,bought_city ,ss_ticket_number limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select c_last_name ,c_first_name ,ca_city 
,bought_city ,ss_ticket_number ,amt,profit from (select ss_ticket_number 
,ss_customer_sk ,ca_city bought_city ,sum(ss_coupon_amt) amt 
,sum(ss_net_profit) profit from 
store_sales,date_dim,store,household_demographics,customer_address where 
store_sales.ss_sold_date_sk = date_dim.d_date_sk and store_sales.ss_store_sk = 
store.s_store_sk and store_sales.ss_hdemo_sk = 
household_demographics.hd_demo_sk and store_sales.ss_addr_sk = 
customer_address.ca_address_sk and (household_demographics.hd_dep_count = 4 or 
household_demographics.hd_vehicle_count= 2) and date_dim.d_dow in (6,0) and 
date_dim.d_year in (1998,1998+1,1998+2) and store.s_city in 
('Rosedale','Bethlehem','Clinton','Clifton','Springfield') group by 
ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) 
dn,customer,customer_address current_addr where dn.ss_customer_sk = 
customer.c_customer_sk and customer.c_current_addr_sk = 
current_addr.ca_address_sk and current_addr
 .ca_city <> bought_city order by c_last_name ,c_first_name ,ca_city 
,bought_city ,ss_ticket_number limit 100
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 10 (SIMPLE_EDGE)
+Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 13 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Map 14 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
+Reducer 8 <- Map 15 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:100
+      Stage-1
+         Reducer 9
+         File Output Operator [FS_62]
+            compressed:false
+            Statistics:Num rows: 100 Data size: 86000 Basic stats: COMPLETE 
Column stats: NONE
+            table:{"input 
format:":"org.apache.hadoop.mapred.TextInputFormat","output 
format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Limit [LIM_61]
+               Number of rows:100
+               Statistics:Num rows: 100 Data size: 86000 Basic stats: COMPLETE 
Column stats: NONE
+               Select Operator [SEL_60]
+               |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+               |  Statistics:Num rows: 96800003 Data size: 83249958789 Basic 
stats: COMPLETE Column stats: NONE
+               |<-Reducer 8 [SIMPLE_EDGE]
+                  Reduce Output Operator [RS_59]
+                     key expressions:_col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: int)
+                     sort order:+++++
+                     Statistics:Num rows: 96800003 Data size: 83249958789 
Basic stats: COMPLETE Column stats: NONE
+                     value expressions:_col5 (type: decimal(17,2)), _col6 
(type: decimal(17,2))
+                     Select Operator [SEL_58]
+                        
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
+                        Statistics:Num rows: 96800003 Data size: 83249958789 
Basic stats: COMPLETE Column stats: NONE
+                        Filter Operator [FIL_90]
+                           predicate:(_col10 <> _col2) (type: boolean)
+                           Statistics:Num rows: 96800003 Data size: 
83249958789 Basic stats: COMPLETE Column stats: NONE
+                           Merge Join Operator [MERGEJOIN_103]
+                           |  condition map:[{"":"Inner Join 0 to 1"}]
+                           |  keys:{"0":"_col6 (type: int)","1":"_col0 (type: 
int)"}
+                           |  
outputColumnNames:["_col0","_col2","_col3","_col4","_col7","_col8","_col10"]
+                           |  Statistics:Num rows: 96800003 Data size: 
83249958789 Basic stats: COMPLETE Column stats: NONE
+                           |<-Map 15 [SIMPLE_EDGE]
+                           |  Reduce Output Operator [RS_55]
+                           |     key expressions:_col0 (type: int)
+                           |     Map-reduce partition columns:_col0 (type: int)
+                           |     sort order:+
+                           |     Statistics:Num rows: 40000000 Data size: 
40595195284 Basic stats: COMPLETE Column stats: NONE
+                           |     value expressions:_col1 (type: string)
+                           |     Select Operator [SEL_46]
+                           |        outputColumnNames:["_col0","_col1"]
+                           |        Statistics:Num rows: 40000000 Data size: 
40595195284 Basic stats: COMPLETE Column stats: NONE
+                           |        Filter Operator [FIL_97]
+                           |           predicate:ca_address_sk is not null 
(type: boolean)
+                           |           Statistics:Num rows: 40000000 Data 
size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                           |           TableScan [TS_44]
+                           |              alias:customer_address
+                           |              Statistics:Num rows: 40000000 Data 
size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                           |<-Reducer 7 [SIMPLE_EDGE]
+                              Reduce Output Operator [RS_53]
+                                 key expressions:_col6 (type: int)
+                                 Map-reduce partition columns:_col6 (type: int)
+                                 sort order:+
+                                 Statistics:Num rows: 88000001 Data size: 
75681779077 Basic stats: COMPLETE Column stats: NONE
+                                 value expressions:_col0 (type: int), _col2 
(type: string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col7 
(type: string), _col8 (type: string)
+                                 Merge Join Operator [MERGEJOIN_102]
+                                 |  condition map:[{"":"Inner Join 0 to 1"}]
+                                 |  keys:{"0":"_col1 (type: int)","1":"_col0 
(type: int)"}
+                                 |  
outputColumnNames:["_col0","_col2","_col3","_col4","_col6","_col7","_col8"]
+                                 |  Statistics:Num rows: 88000001 Data size: 
75681779077 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Map 14 [SIMPLE_EDGE]
+                                 |  Reduce Output Operator [RS_50]
+                                 |     key expressions:_col0 (type: int)
+                                 |     Map-reduce partition columns:_col0 
(type: int)
+                                 |     sort order:+
+                                 |     Statistics:Num rows: 80000000 Data 
size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                 |     value expressions:_col1 (type: int), 
_col2 (type: string), _col3 (type: string)
+                                 |     Select Operator [SEL_43]
+                                 |        
outputColumnNames:["_col0","_col1","_col2","_col3"]
+                                 |        Statistics:Num rows: 80000000 Data 
size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                 |        Filter Operator [FIL_96]
+                                 |           predicate:(c_customer_sk is not 
null and c_current_addr_sk is not null) (type: boolean)
+                                 |           Statistics:Num rows: 80000000 
Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                 |           TableScan [TS_41]
+                                 |              alias:customer
+                                 |              Statistics:Num rows: 80000000 
Data size: 68801615852 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Reducer 6 [SIMPLE_EDGE]
+                                    Reduce Output Operator [RS_48]
+                                       key expressions:_col1 (type: int)
+                                       Map-reduce partition columns:_col1 
(type: int)
+                                       sort order:+
+                                       Statistics:Num rows: 22000000 Data 
size: 22327357890 Basic stats: COMPLETE Column stats: NONE
+                                       value expressions:_col0 (type: int), 
_col2 (type: string), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2))
+                                       Select Operator [SEL_39]
+                                          
outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
+                                          Statistics:Num rows: 22000000 Data 
size: 22327357890 Basic stats: COMPLETE Column stats: NONE
+                                          Group By Operator [GBY_38]
+                                          |  
aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"]
+                                          |  keys:KEY._col0 (type: int), 
KEY._col1 (type: int), KEY._col2 (type: int), KEY._col3 (type: string)
+                                          |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                          |  Statistics:Num rows: 22000000 
Data size: 22327357890 Basic stats: COMPLETE Column stats: NONE
+                                          |<-Reducer 5 [SIMPLE_EDGE]
+                                             Reduce Output Operator [RS_37]
+                                                key expressions:_col0 (type: 
int), _col1 (type: int), _col2 (type: int), _col3 (type: string)
+                                                Map-reduce partition 
columns:_col0 (type: int), _col1 (type: int), _col2 (type: int), _col3 (type: 
string)
+                                                sort order:++++
+                                                Statistics:Num rows: 44000000 
Data size: 44654715780 Basic stats: COMPLETE Column stats: NONE
+                                                value expressions:_col4 (type: 
decimal(17,2)), _col5 (type: decimal(17,2))
+                                                Group By Operator [GBY_36]
+                                                   
aggregations:["sum(_col6)","sum(_col7)"]
+                                                   keys:_col1 (type: int), 
_col3 (type: int), _col5 (type: int), _col17 (type: string)
+                                                   
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                                   Statistics:Num rows: 
44000000 Data size: 44654715780 Basic stats: COMPLETE Column stats: NONE
+                                                   Select Operator [SEL_35]
+                                                      
outputColumnNames:["_col1","_col3","_col5","_col17","_col6","_col7"]
+                                                      Statistics:Num rows: 
44000000 Data size: 44654715780 Basic stats: COMPLETE Column stats: NONE
+                                                      Merge Join Operator 
[MERGEJOIN_101]
+                                                      |  condition 
map:[{"":"Inner Join 0 to 1"}]
+                                                      |  keys:{"0":"_col3 
(type: int)","1":"_col0 (type: int)"}
+                                                      |  
outputColumnNames:["_col1","_col3","_col5","_col6","_col7","_col17"]
+                                                      |  Statistics:Num rows: 
44000000 Data size: 44654715780 Basic stats: COMPLETE Column stats: NONE
+                                                      |<-Map 13 [SIMPLE_EDGE]
+                                                      |  Reduce Output 
Operator [RS_33]
+                                                      |     key 
expressions:_col0 (type: int)
+                                                      |     Map-reduce 
partition columns:_col0 (type: int)
+                                                      |     sort order:+
+                                                      |     Statistics:Num 
rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                      |     value 
expressions:_col1 (type: string)
+                                                      |     Select Operator 
[SEL_14]
+                                                      |        
outputColumnNames:["_col0","_col1"]
+                                                      |        Statistics:Num 
rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                                      |        Filter Operator 
[FIL_95]
+                                                      |           
predicate:ca_address_sk is not null (type: boolean)
+                                                      |           
Statistics:Num rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE 
Column stats: NONE
+                                                      |           TableScan 
[TS_12]
+                                                      |              
alias:customer_address
+                                                      |              
Statistics:Num rows: 40000000 Data size: 40595195284 Basic stats: COMPLETE 
Column stats: NONE
+                                                      |<-Reducer 4 
[SIMPLE_EDGE]
+                                                         Reduce Output 
Operator [RS_31]
+                                                            key 
expressions:_col3 (type: int)
+                                                            Map-reduce 
partition columns:_col3 (type: int)
+                                                            sort order:+
+                                                            Statistics:Num 
rows: 24305 Data size: 27199223 Basic stats: COMPLETE Column stats: NONE
+                                                            value 
expressions:_col1 (type: int), _col5 (type: int), _col6 (type: decimal(7,2)), 
_col7 (type: decimal(7,2))
+                                                            Merge Join 
Operator [MERGEJOIN_100]
+                                                            |  condition 
map:[{"":"Inner Join 0 to 1"}]
+                                                            |  
keys:{"0":"_col2 (type: int)","1":"_col0 (type: int)"}
+                                                            |  
outputColumnNames:["_col1","_col3","_col5","_col6","_col7"]
+                                                            |  Statistics:Num 
rows: 24305 Data size: 27199223 Basic stats: COMPLETE Column stats: NONE
+                                                            |<-Map 12 
[SIMPLE_EDGE]
+                                                            |  Reduce Output 
Operator [RS_28]
+                                                            |     key 
expressions:_col0 (type: int)
+                                                            |     Map-reduce 
partition columns:_col0 (type: int)
+                                                            |     sort order:+
+                                                            |     
Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: 
NONE
+                                                            |     Select 
Operator [SEL_11]
+                                                            |        
outputColumnNames:["_col0"]
+                                                            |        
Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: 
NONE
+                                                            |        Filter 
Operator [FIL_94]
+                                                            |           
predicate:(((hd_dep_count = 4) or (hd_vehicle_count = 2)) and hd_demo_sk is not 
null) (type: boolean)
+                                                            |           
Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: 
NONE
+                                                            |           
TableScan [TS_9]
+                                                            |              
alias:household_demographics
+                                                            |              
Statistics:Num rows: 7200 Data size: 770400 Basic stats: COMPLETE Column stats: 
NONE
+                                                            |<-Reducer 3 
[SIMPLE_EDGE]
+                                                               Reduce Output 
Operator [RS_26]
+                                                                  key 
expressions:_col2 (type: int)
+                                                                  Map-reduce 
partition columns:_col2 (type: int)
+                                                                  sort order:+
+                                                                  
Statistics:Num rows: 22096 Data size: 24726566 Basic stats: COMPLETE Column 
stats: NONE
+                                                                  value 
expressions:_col1 (type: int), _col3 (type: int), _col5 (type: int), _col6 
(type: decimal(7,2)), _col7 (type: decimal(7,2))
+                                                                  Merge Join 
Operator [MERGEJOIN_99]
+                                                                  |  condition 
map:[{"":"Inner Join 0 to 1"}]
+                                                                  |  
keys:{"0":"_col4 (type: int)","1":"_col0 (type: int)"}
+                                                                  |  
outputColumnNames:["_col1","_col2","_col3","_col5","_col6","_col7"]
+                                                                  |  
Statistics:Num rows: 22096 Data size: 24726566 Basic stats: COMPLETE Column 
stats: NONE
+                                                                  |<-Map 11 
[SIMPLE_EDGE]
+                                                                  |  Reduce 
Output Operator [RS_23]
+                                                                  |     key 
expressions:_col0 (type: int)
+                                                                  |     
Map-reduce partition columns:_col0 (type: int)
+                                                                  |     sort 
order:+
+                                                                  |     
Statistics:Num rows: 852 Data size: 1628138 Basic stats: COMPLETE Column stats: 
NONE
+                                                                  |     Select 
Operator [SEL_8]
+                                                                  |        
outputColumnNames:["_col0"]
+                                                                  |        
Statistics:Num rows: 852 Data size: 1628138 Basic stats: COMPLETE Column stats: 
NONE
+                                                                  |        
Filter Operator [FIL_93]
+                                                                  |           
predicate:((s_city) IN ('Rosedale', 'Bethlehem', 'Clinton', 'Clifton', 
'Springfield') and s_store_sk is not null) (type: boolean)
+                                                                  |           
Statistics:Num rows: 852 Data size: 1628138 Basic stats: COMPLETE Column stats: 
NONE
+                                                                  |           
TableScan [TS_6]
+                                                                  |            
  alias:store
+                                                                  |            
  Statistics:Num rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column 
stats: NONE
+                                                                  |<-Reducer 2 
[SIMPLE_EDGE]
+                                                                     Reduce 
Output Operator [RS_21]
+                                                                        key 
expressions:_col4 (type: int)
+                                                                        
Map-reduce partition columns:_col4 (type: int)
+                                                                        sort 
order:+
+                                                                        
Statistics:Num rows: 20088 Data size: 22478696 Basic stats: COMPLETE Column 
stats: NONE
+                                                                        value 
expressions:_col1 (type: int), _col2 (type: int), _col3 (type: int), _col5 
(type: int), _col6 (type: decimal(7,2)), _col7 (type: decimal(7,2))
+                                                                        Merge 
Join Operator [MERGEJOIN_98]
+                                                                        |  
condition map:[{"":"Inner Join 0 to 1"}]
+                                                                        |  
keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                                                                        |  
outputColumnNames:["_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                                                        |  
Statistics:Num rows: 20088 Data size: 22478696 Basic stats: COMPLETE Column 
stats: NONE
+                                                                        |<-Map 
1 [SIMPLE_EDGE]
+                                                                        |  
Reduce Output Operator [RS_16]
+                                                                        |     
key expressions:_col0 (type: int)
+                                                                        |     
Map-reduce partition columns:_col0 (type: int)
+                                                                        |     
sort order:+
+                                                                        |     
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                        |     
value expressions:_col1 (type: int), _col2 (type: int), _col3 (type: int), 
_col4 (type: int), _col5 (type: int), _col6 (type: decimal(7,2)), _col7 (type: 
decimal(7,2))
+                                                                        |     
Select Operator [SEL_2]
+                                                                        |      
  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
+                                                                        |      
  Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                        |      
  Filter Operator [FIL_91]
+                                                                        |      
     predicate:((((ss_sold_date_sk is not null and ss_store_sk is not null) and 
ss_hdemo_sk is not null) and ss_addr_sk is not null) and ss_customer_sk is not 
null) (type: boolean)
+                                                                        |      
     Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                                                        |      
     TableScan [TS_0]
+                                                                        |      
        alias:store_sales
+                                                                        |      
        Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: 
NONE
+                                                                        |<-Map 
10 [SIMPLE_EDGE]
+                                                                           
Reduce Output Operator [RS_18]
+                                                                              
key expressions:_col0 (type: int)
+                                                                              
Map-reduce partition columns:_col0 (type: int)
+                                                                              
sort order:+
+                                                                              
Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column 
stats: NONE
+                                                                              
Select Operator [SEL_5]
+                                                                               
  outputColumnNames:["_col0"]
+                                                                               
  Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column 
stats: NONE
+                                                                               
  Filter Operator [FIL_92]
+                                                                               
     predicate:(((d_year) IN (1998, 1999, 2000) and (d_dow) IN (6, 0)) and 
d_date_sk is not null) (type: boolean)
+                                                                               
     Statistics:Num rows: 18262 Data size: 20435178 Basic stats: COMPLETE 
Column stats: NONE
+                                                                               
     TableScan [TS_3]
+                                                                               
        alias:date_dim
+                                                                               
        Statistics:Num rows: 73049 Data size: 81741831 Basic stats: COMPLETE 
Column stats: NONE
+

http://git-wip-us.apache.org/repos/asf/hive/blob/09b6f9a3/ql/src/test/results/clientpositive/perf/query48.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query48.q.out 
b/ql/src/test/results/clientpositive/perf/query48.q.out
new file mode 100644
index 0000000..d15d578
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/query48.q.out
@@ -0,0 +1,160 @@
+PREHOOK: query: explain select sum (ss_quantity) from store_sales, store, 
customer_demographics, customer_address, date_dim where store.s_store_sk = 
store_sales.ss_store_sk and store_sales.ss_sold_date_sk = date_dim.d_date_sk 
and d_year = 1998 and ( ( customer_demographics.cd_demo_sk = 
store_sales.ss_cdemo_sk and cd_marital_status = 'M' and cd_education_status = 
'4 yr Degree' and ss_sales_price between 100.00 and 150.00 ) or ( 
customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk and 
cd_marital_status = 'M' and cd_education_status = '4 yr Degree' and 
ss_sales_price between 50.00 and 100.00 ) or ( customer_demographics.cd_demo_sk 
= store_sales.ss_cdemo_sk and cd_marital_status = 'M' and cd_education_status = 
'4 yr Degree' and ss_sales_price between 150.00 and 200.00 ) ) and ( ( 
store_sales.ss_addr_sk = customer_address.ca_address_sk and ca_country = 
'United States' and ca_state in ('KY', 'GA', 'NM') and ss_net_profit between 0 
and 2000 ) or (store_sales.ss_addr_sk = customer_add
 ress.ca_address_sk and ca_country = 'United States' and ca_state in ('MT', 
'OR', 'IN') and ss_net_profit between 150 and 3000 ) or (store_sales.ss_addr_sk 
= customer_address.ca_address_sk and ca_country = 'United States' and ca_state 
in ('WI', 'MO', 'WV') and ss_net_profit between 50 and 25000 ) )
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select sum (ss_quantity) from store_sales, store, 
customer_demographics, customer_address, date_dim where store.s_store_sk = 
store_sales.ss_store_sk and store_sales.ss_sold_date_sk = date_dim.d_date_sk 
and d_year = 1998 and ( ( customer_demographics.cd_demo_sk = 
store_sales.ss_cdemo_sk and cd_marital_status = 'M' and cd_education_status = 
'4 yr Degree' and ss_sales_price between 100.00 and 150.00 ) or ( 
customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk and 
cd_marital_status = 'M' and cd_education_status = '4 yr Degree' and 
ss_sales_price between 50.00 and 100.00 ) or ( customer_demographics.cd_demo_sk 
= store_sales.ss_cdemo_sk and cd_marital_status = 'M' and cd_education_status = 
'4 yr Degree' and ss_sales_price between 150.00 and 200.00 ) ) and ( ( 
store_sales.ss_addr_sk = customer_address.ca_address_sk and ca_country = 
'United States' and ca_state in ('KY', 'GA', 'NM') and ss_net_profit between 0 
and 2000 ) or (store_sales.ss_addr_sk = customer_ad
 dress.ca_address_sk and ca_country = 'United States' and ca_state in ('MT', 
'OR', 'IN') and ss_net_profit between 150 and 3000 ) or (store_sales.ss_addr_sk 
= customer_address.ca_address_sk and ca_country = 'United States' and ca_state 
in ('WI', 'MO', 'WV') and ss_net_profit between 50 and 25000 ) )
+POSTHOOK: type: QUERY
+Plan optimized by CBO.
+
+Vertex dependency in root stage
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 3 <- Map 8 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 10 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
+
+Stage-0
+   Fetch Operator
+      limit:-1
+      Stage-1
+         Reducer 6
+         File Output Operator [FS_42]
+            compressed:false
+            Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE Column 
stats: NONE
+            table:{"input 
format:":"org.apache.hadoop.mapred.TextInputFormat","output 
format:":"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat","serde:":"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"}
+            Group By Operator [GBY_40]
+            |  aggregations:["sum(VALUE._col0)"]
+            |  outputColumnNames:["_col0"]
+            |  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+            |<-Reducer 5 [SIMPLE_EDGE]
+               Reduce Output Operator [RS_39]
+                  sort order:
+                  Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                  value expressions:_col0 (type: bigint)
+                  Group By Operator [GBY_38]
+                     aggregations:["sum(_col4)"]
+                     outputColumnNames:["_col0"]
+                     Statistics:Num rows: 1 Data size: 8 Basic stats: COMPLETE 
Column stats: NONE
+                     Merge Join Operator [MERGEJOIN_66]
+                     |  condition map:[{"":"Inner Join 0 to 1"}]
+                     |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: int)"}
+                     |  outputColumnNames:["_col4"]
+                     |  Statistics:Num rows: 18150000 Data size: 18420070657 
Basic stats: COMPLETE Column stats: NONE
+                     |<-Map 10 [SIMPLE_EDGE]
+                     |  Reduce Output Operator [RS_35]
+                     |     key expressions:_col0 (type: int)
+                     |     Map-reduce partition columns:_col0 (type: int)
+                     |     sort order:+
+                     |     Statistics:Num rows: 36524 Data size: 40870356 
Basic stats: COMPLETE Column stats: NONE
+                     |     Select Operator [SEL_31]
+                     |        outputColumnNames:["_col0"]
+                     |        Statistics:Num rows: 36524 Data size: 40870356 
Basic stats: COMPLETE Column stats: NONE
+                     |        Filter Operator [FIL_62]
+                     |           predicate:((d_year = 1998) and d_date_sk is 
not null) (type: boolean)
+                     |           Statistics:Num rows: 36524 Data size: 
40870356 Basic stats: COMPLETE Column stats: NONE
+                     |           TableScan [TS_29]
+                     |              alias:date_dim
+                     |              Statistics:Num rows: 73049 Data size: 
81741831 Basic stats: COMPLETE Column stats: NONE
+                     |<-Reducer 4 [SIMPLE_EDGE]
+                        Reduce Output Operator [RS_33]
+                           key expressions:_col0 (type: int)
+                           Map-reduce partition columns:_col0 (type: int)
+                           sort order:+
+                           Statistics:Num rows: 16500000 Data size: 
16745518417 Basic stats: COMPLETE Column stats: NONE
+                           value expressions:_col4 (type: int)
+                           Select Operator [SEL_28]
+                              outputColumnNames:["_col0","_col4"]
+                              Statistics:Num rows: 16500000 Data size: 
16745518417 Basic stats: COMPLETE Column stats: NONE
+                              Filter Operator [FIL_57]
+                                 predicate:(((_col12) IN ('KY', 'GA', 'NM') 
and _col6 BETWEEN 0 AND 2000) or ((_col12) IN ('MT', 'OR', 'IN') and _col6 
BETWEEN 150 AND 3000) or ((_col12) IN ('WI', 'MO', 'WV') and _col6 BETWEEN 50 
AND 25000)) (type: boolean)
+                                 Statistics:Num rows: 16500000 Data size: 
16745518417 Basic stats: COMPLETE Column stats: NONE
+                                 Merge Join Operator [MERGEJOIN_65]
+                                 |  condition map:[{"":"Inner Join 0 to 1"}]
+                                 |  keys:{"0":"_col2 (type: int)","1":"_col0 
(type: int)"}
+                                 |  
outputColumnNames:["_col0","_col4","_col6","_col12"]
+                                 |  Statistics:Num rows: 22000000 Data size: 
22327357890 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Map 9 [SIMPLE_EDGE]
+                                 |  Reduce Output Operator [RS_25]
+                                 |     key expressions:_col0 (type: int)
+                                 |     Map-reduce partition columns:_col0 
(type: int)
+                                 |     sort order:+
+                                 |     Statistics:Num rows: 20000000 Data 
size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                 |     value expressions:_col1 (type: string)
+                                 |     Select Operator [SEL_11]
+                                 |        outputColumnNames:["_col0","_col1"]
+                                 |        Statistics:Num rows: 20000000 Data 
size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                 |        Filter Operator [FIL_61]
+                                 |           predicate:((((ca_state) IN ('KY', 
'GA', 'NM') or (ca_state) IN ('MT', 'OR', 'IN') or (ca_state) IN ('WI', 'MO', 
'WV')) and (ca_country = 'United States')) and ca_address_sk is not null) 
(type: boolean)
+                                 |           Statistics:Num rows: 20000000 
Data size: 20297597642 Basic stats: COMPLETE Column stats: NONE
+                                 |           TableScan [TS_9]
+                                 |              alias:customer_address
+                                 |              Statistics:Num rows: 40000000 
Data size: 40595195284 Basic stats: COMPLETE Column stats: NONE
+                                 |<-Reducer 3 [SIMPLE_EDGE]
+                                    Reduce Output Operator [RS_23]
+                                       key expressions:_col2 (type: int)
+                                       Map-reduce partition columns:_col2 
(type: int)
+                                       sort order:+
+                                       Statistics:Num rows: 5445 Data size: 
1972040 Basic stats: COMPLETE Column stats: NONE
+                                       value expressions:_col0 (type: int), 
_col4 (type: int), _col6 (type: decimal(7,2))
+                                       Merge Join Operator [MERGEJOIN_64]
+                                       |  condition map:[{"":"Inner Join 0 to 
1"}]
+                                       |  keys:{"0":"_col1 (type: 
int)","1":"_col0 (type: int)"}
+                                       |  
outputColumnNames:["_col0","_col2","_col4","_col6"]
+                                       |  Statistics:Num rows: 5445 Data size: 
1972040 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Map 8 [SIMPLE_EDGE]
+                                       |  Reduce Output Operator [RS_20]
+                                       |     key expressions:_col0 (type: int)
+                                       |     Map-reduce partition 
columns:_col0 (type: int)
+                                       |     sort order:+
+                                       |     Statistics:Num rows: 4950 Data 
size: 1792764 Basic stats: COMPLETE Column stats: NONE
+                                       |     Select Operator [SEL_8]
+                                       |        outputColumnNames:["_col0"]
+                                       |        Statistics:Num rows: 4950 Data 
size: 1792764 Basic stats: COMPLETE Column stats: NONE
+                                       |        Filter Operator [FIL_60]
+                                       |           
predicate:(((cd_education_status = '4 yr Degree') and (cd_marital_status = 
'M')) and cd_demo_sk is not null) (type: boolean)
+                                       |           Statistics:Num rows: 4950 
Data size: 1792764 Basic stats: COMPLETE Column stats: NONE
+                                       |           TableScan [TS_6]
+                                       |              
alias:customer_demographics
+                                       |              Statistics:Num rows: 
19800 Data size: 7171059 Basic stats: COMPLETE Column stats: NONE
+                                       |<-Reducer 2 [SIMPLE_EDGE]
+                                          Reduce Output Operator [RS_18]
+                                             key expressions:_col1 (type: int)
+                                             Map-reduce partition 
columns:_col1 (type: int)
+                                             sort order:+
+                                             Statistics:Num rows: 1874 Data 
size: 3581903 Basic stats: COMPLETE Column stats: NONE
+                                             value expressions:_col0 (type: 
int), _col2 (type: int), _col4 (type: int), _col6 (type: decimal(7,2))
+                                             Merge Join Operator [MERGEJOIN_63]
+                                             |  condition map:[{"":"Inner Join 
0 to 1"}]
+                                             |  keys:{"0":"_col3 (type: 
int)","1":"_col0 (type: int)"}
+                                             |  
outputColumnNames:["_col0","_col1","_col2","_col4","_col6"]
+                                             |  Statistics:Num rows: 1874 Data 
size: 3581903 Basic stats: COMPLETE Column stats: NONE
+                                             |<-Map 1 [SIMPLE_EDGE]
+                                             |  Reduce Output Operator [RS_13]
+                                             |     key expressions:_col3 
(type: int)
+                                             |     Map-reduce partition 
columns:_col3 (type: int)
+                                             |     sort order:+
+                                             |     Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
+                                             |     value expressions:_col0 
(type: int), _col1 (type: int), _col2 (type: int), _col4 (type: int), _col6 
(type: decimal(7,2))
+                                             |     Select Operator [SEL_2]
+                                             |        
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col6"]
+                                             |        Statistics:Num rows: 1 
Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                             |        Filter Operator [FIL_58]
+                                             |           
predicate:((((((ss_net_profit BETWEEN 0 AND 2000 or ss_net_profit BETWEEN 150 
AND 3000 or ss_net_profit BETWEEN 50 AND 25000) and ss_store_sk is not null) 
and (ss_sales_price BETWEEN 100.0 AND 150.0 or ss_sales_price BETWEEN 50.0 AND 
100.0 or ss_sales_price BETWEEN 150.0 AND 200.0)) and ss_cdemo_sk is not null) 
and ss_addr_sk is not null) and ss_sold_date_sk is not null) (type: boolean)
+                                             |           Statistics:Num rows: 
1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                             |           TableScan [TS_0]
+                                             |              alias:store_sales
+                                             |              Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
+                                             |<-Map 7 [SIMPLE_EDGE]
+                                                Reduce Output Operator [RS_15]
+                                                   key expressions:_col0 
(type: int)
+                                                   Map-reduce partition 
columns:_col0 (type: int)
+                                                   sort order:+
+                                                   Statistics:Num rows: 1704 
Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                   Select Operator [SEL_5]
+                                                      
outputColumnNames:["_col0"]
+                                                      Statistics:Num rows: 
1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                      Filter Operator [FIL_59]
+                                                         predicate:s_store_sk 
is not null (type: boolean)
+                                                         Statistics:Num rows: 
1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+                                                         TableScan [TS_3]
+                                                            alias:store
+                                                            Statistics:Num 
rows: 1704 Data size: 3256276 Basic stats: COMPLETE Column stats: NONE
+

Reply via email to