http://git-wip-us.apache.org/repos/asf/hive/blob/6f44fc81/ql/src/test/results/clientpositive/perf/query32.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query32.q.out 
b/ql/src/test/results/clientpositive/perf/query32.q.out
index f905498..da2ac8f 100644
--- a/ql/src/test/results/clientpositive/perf/query32.q.out
+++ b/ql/src/test/results/clientpositive/perf/query32.q.out
@@ -50,66 +50,66 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 4
-         File Output Operator [FS_44]
+         File Output Operator [FS_37]
             compressed:false
             Statistics:Num rows: 1 Data size: 112 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_42]
+            Group By Operator [GBY_35]
             |  aggregations:["sum(VALUE._col0)"]
             |  outputColumnNames:["_col0"]
             |  Statistics:Num rows: 1 Data size: 112 Basic stats: COMPLETE 
Column stats: NONE
             |<-Reducer 3 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_41]
+               Reduce Output Operator [RS_34]
                   sort order:
                   Statistics:Num rows: 1 Data size: 112 Basic stats: COMPLETE 
Column stats: NONE
                   value expressions:_col0 (type: decimal(17,2))
-                  Group By Operator [GBY_40]
+                  Group By Operator [GBY_33]
                      aggregations:["sum(_col1)"]
                      outputColumnNames:["_col0"]
                      Statistics:Num rows: 1 Data size: 112 Basic stats: 
COMPLETE Column stats: NONE
-                     Select Operator [SEL_39]
+                     Select Operator [SEL_32]
                         outputColumnNames:["_col1"]
                         Statistics:Num rows: 169400 Data size: 243305505 Basic 
stats: COMPLETE Column stats: NONE
-                        Filter Operator [FIL_59]
+                        Filter Operator [FIL_31]
                            predicate:(_col1 > CAST( _col5 AS decimal(20,15))) 
(type: boolean)
                            Statistics:Num rows: 169400 Data size: 243305505 
Basic stats: COMPLETE Column stats: NONE
-                           Merge Join Operator [MERGEJOIN_67]
+                           Merge Join Operator [MERGEJOIN_59]
                            |  condition map:[{"":"Inner Join 0 to 
1"},{"":"Inner Join 1 to 2"}]
                            |  keys:{"0":"_col0 (type: int)","1":"_col0 (type: 
int)","2":"_col0 (type: int)"}
                            |  outputColumnNames:["_col1","_col5"]
                            |  Statistics:Num rows: 508200 Data size: 729916517 
Basic stats: COMPLETE Column stats: NONE
                            |<-Map 6 [SIMPLE_EDGE]
-                           |  Reduce Output Operator [RS_34]
+                           |  Reduce Output Operator [RS_28]
                            |     key expressions:_col0 (type: int)
                            |     Map-reduce partition columns:_col0 (type: int)
                            |     sort order:+
                            |     Statistics:Num rows: 231000 Data size: 
331780228 Basic stats: COMPLETE Column stats: NONE
-                           |     Select Operator [SEL_14]
+                           |     Select Operator [SEL_12]
                            |        outputColumnNames:["_col0"]
                            |        Statistics:Num rows: 231000 Data size: 
331780228 Basic stats: COMPLETE Column stats: NONE
-                           |        Filter Operator [FIL_62]
+                           |        Filter Operator [FIL_54]
                            |           predicate:((i_manufact_id = 436) and 
i_item_sk is not null) (type: boolean)
                            |           Statistics:Num rows: 231000 Data size: 
331780228 Basic stats: COMPLETE Column stats: NONE
-                           |           TableScan [TS_12]
+                           |           TableScan [TS_10]
                            |              alias:i
                            |              Statistics:Num rows: 462000 Data 
size: 663560457 Basic stats: COMPLETE Column stats: NONE
                            |<-Reducer 2 [SIMPLE_EDGE]
-                           |  Reduce Output Operator [RS_32]
+                           |  Reduce Output Operator [RS_27]
                            |     key expressions:_col0 (type: int)
                            |     Map-reduce partition columns:_col0 (type: int)
                            |     sort order:+
                            |     Statistics:Num rows: 40176 Data size: 
44957392 Basic stats: COMPLETE Column stats: NONE
                            |     value expressions:_col1 (type: decimal(7,2))
-                           |     Select Operator [SEL_11]
+                           |     Select Operator [SEL_9]
                            |        outputColumnNames:["_col0","_col1"]
                            |        Statistics:Num rows: 40176 Data size: 
44957392 Basic stats: COMPLETE Column stats: NONE
-                           |        Merge Join Operator [MERGEJOIN_65]
+                           |        Merge Join Operator [MERGEJOIN_57]
                            |        |  condition map:[{"":"Inner Join 0 to 1"}]
                            |        |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
                            |        |  outputColumnNames:["_col1","_col2"]
                            |        |  Statistics:Num rows: 40176 Data size: 
44957392 Basic stats: COMPLETE Column stats: NONE
                            |        |<-Map 1 [SIMPLE_EDGE]
-                           |        |  Reduce Output Operator [RS_7]
+                           |        |  Reduce Output Operator [RS_6]
                            |        |     key expressions:_col0 (type: int)
                            |        |     Map-reduce partition columns:_col0 
(type: int)
                            |        |     sort order:+
@@ -118,14 +118,14 @@ Stage-0
                            |        |     Select Operator [SEL_2]
                            |        |        
outputColumnNames:["_col0","_col1","_col2"]
                            |        |        Statistics:Num rows: 1 Data size: 
0 Basic stats: PARTIAL Column stats: NONE
-                           |        |        Filter Operator [FIL_60]
+                           |        |        Filter Operator [FIL_52]
                            |        |           predicate:(cs_sold_date_sk is 
not null and cs_item_sk is not null) (type: boolean)
                            |        |           Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
                            |        |           TableScan [TS_0]
                            |        |              alias:cs
                            |        |              Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
                            |        |<-Map 5 [SIMPLE_EDGE]
-                           |           Reduce Output Operator [RS_9]
+                           |           Reduce Output Operator [RS_7]
                            |              key expressions:_col0 (type: int)
                            |              Map-reduce partition columns:_col0 
(type: int)
                            |              sort order:+
@@ -133,73 +133,73 @@ Stage-0
                            |              Select Operator [SEL_5]
                            |                 outputColumnNames:["_col0"]
                            |                 Statistics:Num rows: 36524 Data 
size: 40870356 Basic stats: COMPLETE Column stats: NONE
-                           |                 Filter Operator [FIL_61]
+                           |                 Filter Operator [FIL_53]
                            |                    predicate:(d_date BETWEEN 
'2000-01-27' AND '2000-04-27' and d_date_sk is not null) (type: boolean)
                            |                    Statistics:Num rows: 36524 
Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
                            |                    TableScan [TS_3]
                            |                       alias:d
                            |                       Statistics:Num rows: 73049 
Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                            |<-Reducer 9 [SIMPLE_EDGE]
-                              Reduce Output Operator [RS_36]
+                              Reduce Output Operator [RS_29]
                                  key expressions:_col0 (type: int)
                                  Map-reduce partition columns:_col0 (type: int)
                                  sort order:+
                                  Statistics:Num rows: 20088 Data size: 
22478696 Basic stats: COMPLETE Column stats: NONE
                                  value expressions:_col1 (type: double)
-                                 Select Operator [SEL_30]
+                                 Select Operator [SEL_26]
                                     outputColumnNames:["_col0","_col1"]
                                     Statistics:Num rows: 20088 Data size: 
22478696 Basic stats: COMPLETE Column stats: NONE
-                                    Group By Operator [GBY_29]
+                                    Group By Operator [GBY_25]
                                     |  aggregations:["avg(VALUE._col0)"]
                                     |  keys:KEY._col0 (type: int)
                                     |  outputColumnNames:["_col0","_col1"]
                                     |  Statistics:Num rows: 20088 Data size: 
22478696 Basic stats: COMPLETE Column stats: NONE
                                     |<-Reducer 8 [SIMPLE_EDGE]
-                                       Reduce Output Operator [RS_28]
+                                       Reduce Output Operator [RS_24]
                                           key expressions:_col0 (type: int)
                                           Map-reduce partition columns:_col0 
(type: int)
                                           sort order:+
                                           Statistics:Num rows: 40176 Data 
size: 44957392 Basic stats: COMPLETE Column stats: NONE
                                           value expressions:_col1 (type: 
struct<count:bigint,sum:decimal(17,2),input:decimal(7,2)>)
-                                          Group By Operator [GBY_27]
+                                          Group By Operator [GBY_23]
                                              aggregations:["avg(_col2)"]
                                              keys:_col1 (type: int)
                                              
outputColumnNames:["_col0","_col1"]
                                              Statistics:Num rows: 40176 Data 
size: 44957392 Basic stats: COMPLETE Column stats: NONE
-                                             Merge Join Operator [MERGEJOIN_66]
+                                             Merge Join Operator [MERGEJOIN_58]
                                              |  condition map:[{"":"Inner Join 
0 to 1"}]
                                              |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
                                              |  
outputColumnNames:["_col1","_col2"]
                                              |  Statistics:Num rows: 40176 
Data size: 44957392 Basic stats: COMPLETE Column stats: NONE
                                              |<-Map 10 [SIMPLE_EDGE]
-                                             |  Reduce Output Operator [RS_24]
+                                             |  Reduce Output Operator [RS_20]
                                              |     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_20]
+                                             |     Select Operator [SEL_18]
                                              |        
outputColumnNames:["_col0"]
                                              |        Statistics:Num rows: 
36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
-                                             |        Filter Operator [FIL_64]
+                                             |        Filter Operator [FIL_56]
                                              |           predicate:(d_date 
BETWEEN '2000-01-27' AND '2000-04-27' and d_date_sk is not null) (type: boolean)
                                              |           Statistics:Num rows: 
36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
-                                             |           TableScan [TS_18]
+                                             |           TableScan [TS_16]
                                              |              alias:d
                                              |              Statistics:Num 
rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                                              |<-Map 7 [SIMPLE_EDGE]
-                                                Reduce Output Operator [RS_22]
+                                                Reduce Output Operator [RS_19]
                                                    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_17]
+                                                   Select Operator [SEL_15]
                                                       
outputColumnNames:["_col0","_col1","_col2"]
                                                       Statistics:Num rows: 1 
Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                      Filter Operator [FIL_63]
+                                                      Filter Operator [FIL_55]
                                                          
predicate:(cs_sold_date_sk is not null and cs_item_sk is not null) (type: 
boolean)
                                                          Statistics:Num rows: 
1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                         TableScan [TS_15]
+                                                         TableScan [TS_13]
                                                             alias:cs
                                                             Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
 

http://git-wip-us.apache.org/repos/asf/hive/blob/6f44fc81/ql/src/test/results/clientpositive/perf/query34.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query34.q.out 
b/ql/src/test/results/clientpositive/perf/query34.q.out
index 193cf4f..1cb7c28 100644
--- a/ql/src/test/results/clientpositive/perf/query34.q.out
+++ b/ql/src/test/results/clientpositive/perf/query34.q.out
@@ -17,80 +17,80 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 7
-         File Output Operator [FS_45]
+         File Output Operator [FS_37]
             compressed:false
             Statistics:Num rows: 88000001 Data size: 75681779077 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"}
-            Select Operator [SEL_44]
+            Select Operator [SEL_36]
             |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
             |  Statistics:Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
             |<-Reducer 6 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_43]
+               Reduce Output Operator [RS_35]
                   key expressions:_col0 (type: string), _col1 (type: string), 
_col2 (type: string), _col3 (type: string)
                   sort order:+++-
                   Statistics:Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
                   value expressions:_col4 (type: int), _col5 (type: bigint)
-                  Select Operator [SEL_42]
+                  Select Operator [SEL_34]
                      
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                      Statistics:Num rows: 88000001 Data size: 75681779077 
Basic stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_69]
+                     Merge Join Operator [MERGEJOIN_60]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col1 (type: int)","1":"_col0 (type: int)"}
                      |  
outputColumnNames:["_col0","_col2","_col4","_col5","_col6","_col7"]
                      |  Statistics:Num rows: 88000001 Data size: 75681779077 
Basic stats: COMPLETE Column stats: NONE
                      |<-Map 11 [SIMPLE_EDGE]
-                     |  Reduce Output Operator [RS_40]
+                     |  Reduce Output Operator [RS_32]
                      |     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: string), _col2 
(type: string), _col3 (type: string), _col4 (type: string)
-                     |     Select Operator [SEL_36]
+                     |     Select Operator [SEL_30]
                      |        
outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
                      |        Statistics:Num rows: 80000000 Data size: 
68801615852 Basic stats: COMPLETE Column stats: NONE
-                     |        Filter Operator [FIL_65]
+                     |        Filter Operator [FIL_56]
                      |           predicate:c_customer_sk is not null (type: 
boolean)
                      |           Statistics:Num rows: 80000000 Data size: 
68801615852 Basic stats: COMPLETE Column stats: NONE
-                     |           TableScan [TS_34]
+                     |           TableScan [TS_28]
                      |              alias:customer
                      |              Statistics:Num rows: 80000000 Data size: 
68801615852 Basic stats: COMPLETE Column stats: NONE
                      |<-Reducer 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_38]
+                        Reduce Output Operator [RS_31]
                            key expressions:_col1 (type: int)
                            Map-reduce partition columns:_col1 (type: int)
                            sort order:+
                            Statistics:Num rows: 12153 Data size: 13599611 
Basic stats: COMPLETE Column stats: NONE
                            value expressions:_col0 (type: int), _col2 (type: 
bigint)
-                           Select Operator [SEL_31]
-                              outputColumnNames:["_col0","_col1","_col2"]
+                           Filter Operator [FIL_26]
+                              predicate:_col2 BETWEEN 15 AND 20 (type: boolean)
                               Statistics:Num rows: 12153 Data size: 13599611 
Basic stats: COMPLETE Column stats: NONE
-                              Filter Operator [FIL_60]
-                                 predicate:_col2 BETWEEN 15 AND 20 (type: 
boolean)
-                                 Statistics:Num rows: 12153 Data size: 
13599611 Basic stats: COMPLETE Column stats: NONE
-                                 Group By Operator [GBY_30]
+                              Select Operator [SEL_25]
+                                 outputColumnNames:["_col0","_col1","_col2"]
+                                 Statistics:Num rows: 24306 Data size: 
27199223 Basic stats: COMPLETE Column stats: NONE
+                                 Group By Operator [GBY_24]
                                  |  aggregations:["count(VALUE._col0)"]
                                  |  keys:KEY._col0 (type: int), KEY._col1 
(type: int)
                                  |  outputColumnNames:["_col0","_col1","_col2"]
                                  |  Statistics:Num rows: 24306 Data size: 
27199223 Basic stats: COMPLETE Column stats: NONE
                                  |<-Reducer 4 [SIMPLE_EDGE]
-                                    Reduce Output Operator [RS_29]
+                                    Reduce Output Operator [RS_23]
                                        key expressions:_col0 (type: int), 
_col1 (type: int)
                                        Map-reduce partition columns:_col0 
(type: int), _col1 (type: int)
                                        sort order:++
                                        Statistics:Num rows: 48612 Data size: 
54398446 Basic stats: COMPLETE Column stats: NONE
                                        value expressions:_col2 (type: bigint)
-                                       Group By Operator [GBY_28]
+                                       Group By Operator [GBY_22]
                                           aggregations:["count()"]
                                           keys:_col1 (type: int), _col4 (type: 
int)
                                           
outputColumnNames:["_col0","_col1","_col2"]
                                           Statistics:Num rows: 48612 Data 
size: 54398446 Basic stats: COMPLETE Column stats: NONE
-                                          Merge Join Operator [MERGEJOIN_68]
+                                          Merge Join Operator [MERGEJOIN_59]
                                           |  condition map:[{"":"Inner Join 0 
to 1"}]
                                           |  keys:{"0":"_col2 (type: 
int)","1":"_col0 (type: int)"}
                                           |  
outputColumnNames:["_col1","_col4"]
                                           |  Statistics:Num rows: 48612 Data 
size: 54398446 Basic stats: COMPLETE Column stats: NONE
                                           |<-Map 10 [SIMPLE_EDGE]
-                                          |  Reduce Output Operator [RS_25]
+                                          |  Reduce Output Operator [RS_19]
                                           |     key expressions:_col0 (type: 
int)
                                           |     Map-reduce partition 
columns:_col0 (type: int)
                                           |     sort order:+
@@ -98,26 +98,26 @@ Stage-0
                                           |     Select Operator [SEL_11]
                                           |        outputColumnNames:["_col0"]
                                           |        Statistics:Num rows: 800 
Data size: 85600 Basic stats: COMPLETE Column stats: NONE
-                                          |        Filter Operator [FIL_64]
+                                          |        Filter Operator [FIL_55]
                                           |           predicate:((((CASE WHEN 
((hd_vehicle_count > 0)) THEN ((UDFToDouble(hd_dep_count) / 
UDFToDouble(hd_vehicle_count))) ELSE (null) END > 1.2) and ((hd_buy_potential = 
'1001-5000') or (hd_buy_potential = '5001-10000'))) and (hd_vehicle_count > 0)) 
and hd_demo_sk is not null) (type: boolean)
                                           |           Statistics:Num rows: 800 
Data size: 85600 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_23]
+                                             Reduce Output Operator [RS_18]
                                                 key expressions:_col2 (type: 
int)
                                                 Map-reduce partition 
columns:_col2 (type: int)
                                                 sort order:+
                                                 Statistics:Num rows: 44193 
Data size: 49453132 Basic stats: COMPLETE Column stats: NONE
                                                 value expressions:_col1 (type: 
int), _col4 (type: int)
-                                                Merge Join Operator 
[MERGEJOIN_67]
+                                                Merge Join Operator 
[MERGEJOIN_58]
                                                 |  condition map:[{"":"Inner 
Join 0 to 1"}]
                                                 |  keys:{"0":"_col3 (type: 
int)","1":"_col0 (type: int)"}
                                                 |  
outputColumnNames:["_col1","_col2","_col4"]
                                                 |  Statistics:Num rows: 44193 
Data size: 49453132 Basic stats: COMPLETE Column stats: NONE
                                                 |<-Map 9 [SIMPLE_EDGE]
-                                                |  Reduce Output Operator 
[RS_20]
+                                                |  Reduce Output Operator 
[RS_16]
                                                 |     key expressions:_col0 
(type: int)
                                                 |     Map-reduce partition 
columns:_col0 (type: int)
                                                 |     sort order:+
@@ -125,26 +125,26 @@ Stage-0
                                                 |     Select Operator [SEL_8]
                                                 |        
outputColumnNames:["_col0"]
                                                 |        Statistics:Num rows: 
852 Data size: 1628138 Basic stats: COMPLETE Column stats: NONE
-                                                |        Filter Operator 
[FIL_63]
+                                                |        Filter Operator 
[FIL_54]
                                                 |           
predicate:((s_county) IN ('Kittitas County', 'Adams County', 'Richland County', 
'Furnas County', 'Orange County', 'Appanoose County', 'Franklin Parish', 
'Tehama County') 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_18]
+                                                   Reduce Output Operator 
[RS_15]
                                                       key expressions:_col3 
(type: int)
                                                       Map-reduce partition 
columns:_col3 (type: int)
                                                       sort order:+
                                                       Statistics:Num rows: 
40176 Data size: 44957392 Basic stats: COMPLETE Column stats: NONE
                                                       value expressions:_col1 
(type: int), _col2 (type: int), _col4 (type: int)
-                                                      Merge Join Operator 
[MERGEJOIN_66]
+                                                      Merge Join Operator 
[MERGEJOIN_57]
                                                       |  condition 
map:[{"":"Inner Join 0 to 1"}]
                                                       |  keys:{"0":"_col0 
(type: int)","1":"_col0 (type: int)"}
                                                       |  
outputColumnNames:["_col1","_col2","_col3","_col4"]
                                                       |  Statistics:Num rows: 
40176 Data size: 44957392 Basic stats: COMPLETE Column stats: NONE
                                                       |<-Map 1 [SIMPLE_EDGE]
-                                                      |  Reduce Output 
Operator [RS_13]
+                                                      |  Reduce Output 
Operator [RS_12]
                                                       |     key 
expressions:_col0 (type: int)
                                                       |     Map-reduce 
partition columns:_col0 (type: int)
                                                       |     sort order:+
@@ -153,14 +153,14 @@ Stage-0
                                                       |     Select Operator 
[SEL_2]
                                                       |        
outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
                                                       |        Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                      |        Filter Operator 
[FIL_61]
+                                                      |        Filter Operator 
[FIL_52]
                                                       |           
predicate:(((ss_sold_date_sk is not null and ss_store_sk is not null) and 
ss_hdemo_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 8 [SIMPLE_EDGE]
-                                                         Reduce Output 
Operator [RS_15]
+                                                         Reduce Output 
Operator [RS_13]
                                                             key 
expressions:_col0 (type: int)
                                                             Map-reduce 
partition columns:_col0 (type: int)
                                                             sort order:+
@@ -168,7 +168,7 @@ Stage-0
                                                             Select Operator 
[SEL_5]
                                                                
outputColumnNames:["_col0"]
                                                                Statistics:Num 
rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column stats: NONE
-                                                               Filter Operator 
[FIL_62]
+                                                               Filter Operator 
[FIL_53]
                                                                   
predicate:(((d_year) IN (1998, 1999, 2000) and (d_dom BETWEEN 1 AND 3 or d_dom 
BETWEEN 25 AND 28)) and d_date_sk is not null) (type: boolean)
                                                                   
Statistics:Num rows: 36524 Data size: 40870356 Basic stats: COMPLETE Column 
stats: NONE
                                                                   TableScan 
[TS_3]

http://git-wip-us.apache.org/repos/asf/hive/blob/6f44fc81/ql/src/test/results/clientpositive/perf/query39.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query39.q.out 
b/ql/src/test/results/clientpositive/perf/query39.q.out
index 0ad62cc..a18cdaf 100644
--- a/ql/src/test/results/clientpositive/perf/query39.q.out
+++ b/ql/src/test/results/clientpositive/perf/query39.q.out
@@ -21,197 +21,197 @@ Stage-0
       limit:-1
       Stage-1
          Reducer 7
-         File Output Operator [FS_76]
+         File Output Operator [FS_62]
             compressed:false
             Statistics:Num rows: 112735 Data size: 161919824 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"}
-            Select Operator [SEL_75]
+            Select Operator [SEL_61]
             |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
             |  Statistics:Num rows: 112735 Data size: 161919824 Basic stats: 
COMPLETE Column stats: NONE
             |<-Reducer 6 [SIMPLE_EDGE]
-               Reduce Output Operator [RS_74]
+               Reduce Output Operator [RS_60]
                   key expressions:_col0 (type: int), _col1 (type: int), _col2 
(type: int), _col3 (type: double), _col4 (type: double), _col7 (type: int), 
_col8 (type: double), _col9 (type: double)
                   sort order:++++++++
                   Statistics:Num rows: 112735 Data size: 161919824 Basic 
stats: COMPLETE Column stats: NONE
                   value expressions:_col5 (type: int), _col6 (type: int)
-                  Select Operator [SEL_73]
+                  Select Operator [SEL_59]
                      
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
                      Statistics:Num rows: 112735 Data size: 161919824 Basic 
stats: COMPLETE Column stats: NONE
-                     Merge Join Operator [MERGEJOIN_121]
+                     Merge Join Operator [MERGEJOIN_103]
                      |  condition map:[{"":"Inner Join 0 to 1"}]
                      |  keys:{"0":"_col2 (type: int), _col1 (type: 
int)","1":"_col2 (type: int), _col1 (type: int)"}
                      |  
outputColumnNames:["_col1","_col2","_col3","_col4","_col5","_col7","_col8","_col9","_col10","_col11"]
                      |  Statistics:Num rows: 112735 Data size: 161919824 Basic 
stats: COMPLETE Column stats: NONE
                      |<-Reducer 15 [SIMPLE_EDGE]
-                     |  Reduce Output Operator [RS_71]
+                     |  Reduce Output Operator [RS_57]
                      |     key expressions:_col2 (type: int), _col1 (type: int)
                      |     Map-reduce partition columns:_col2 (type: int), 
_col1 (type: int)
                      |     sort order:++
                      |     Statistics:Num rows: 102487 Data size: 147199837 
Basic stats: COMPLETE Column stats: NONE
                      |     value expressions:_col3 (type: int), _col4 (type: 
double), _col5 (type: double)
-                     |     Select Operator [SEL_65]
+                     |     Select Operator [SEL_55]
                      |        
outputColumnNames:["_col1","_col2","_col3","_col4","_col5"]
                      |        Statistics:Num rows: 102487 Data size: 147199837 
Basic stats: COMPLETE Column stats: NONE
-                     |        Filter Operator [FIL_108]
+                     |        Filter Operator [FIL_54]
                      |           predicate:(CASE (_col5) WHEN (0) THEN (0) 
ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
                      |           Statistics:Num rows: 102487 Data size: 
147199837 Basic stats: COMPLETE Column stats: NONE
-                     |           Select Operator [SEL_113]
-                     |              
outputColumnNames:["_col0","_col1","_col3","_col4","_col5"]
+                     |           Select Operator [SEL_53]
+                     |              
outputColumnNames:["_col1","_col2","_col3","_col4","_col5"]
                      |              Statistics:Num rows: 307461 Data size: 
441599512 Basic stats: COMPLETE Column stats: NONE
-                     |              Group By Operator [GBY_64]
+                     |              Group By Operator [GBY_52]
                      |              |  
aggregations:["stddev_samp(VALUE._col0)","avg(VALUE._col1)"]
                      |              |  keys:KEY._col0 (type: int), KEY._col1 
(type: int), KEY._col2 (type: string), KEY._col3 (type: int)
                      |              |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                      |              |  Statistics:Num rows: 307461 Data size: 
441599512 Basic stats: COMPLETE Column stats: NONE
                      |              |<-Reducer 14 [SIMPLE_EDGE]
-                     |                 Reduce Output Operator [RS_63]
+                     |                 Reduce Output Operator [RS_51]
                      |                    key expressions:_col0 (type: int), 
_col1 (type: int), _col2 (type: string), _col3 (type: int)
                      |                    Map-reduce partition columns:_col0 
(type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int)
                      |                    sort order:++++
                      |                    Statistics:Num rows: 614922 Data 
size: 883199024 Basic stats: COMPLETE Column stats: NONE
                      |                    value expressions:_col4 (type: 
struct<count:bigint,sum:double,variance:double>), _col5 (type: 
struct<count:bigint,sum:double,input:int>)
-                     |                    Group By Operator [GBY_62]
+                     |                    Group By Operator [GBY_50]
                      |                       
aggregations:["stddev_samp(_col3)","avg(_col3)"]
                      |                       keys:_col4 (type: int), _col5 
(type: int), _col6 (type: string), _col9 (type: int)
                      |                       
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                      |                       Statistics:Num rows: 614922 Data 
size: 883199024 Basic stats: COMPLETE Column stats: NONE
-                     |                       Select Operator [SEL_61]
+                     |                       Select Operator [SEL_49]
                      |                          
outputColumnNames:["_col4","_col5","_col6","_col9","_col3"]
                      |                          Statistics:Num rows: 614922 
Data size: 883199024 Basic stats: COMPLETE Column stats: NONE
-                     |                          Merge Join Operator 
[MERGEJOIN_120]
+                     |                          Merge Join Operator 
[MERGEJOIN_102]
                      |                          |  condition map:[{"":"Inner 
Join 0 to 1"}]
                      |                          |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
                      |                          |  
outputColumnNames:["_col3","_col4","_col5","_col6"]
                      |                          |  Statistics:Num rows: 614922 
Data size: 883199024 Basic stats: COMPLETE Column stats: NONE
                      |                          |<-Map 18 [SIMPLE_EDGE]
-                     |                          |  Reduce Output Operator 
[RS_59]
+                     |                          |  Reduce Output Operator 
[RS_47]
                      |                          |     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_45]
+                     |                          |     Select Operator [SEL_39]
                      |                          |        
outputColumnNames:["_col0"]
                      |                          |        Statistics:Num rows: 
18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
-                     |                          |        Filter Operator 
[FIL_112]
+                     |                          |        Filter Operator 
[FIL_96]
                      |                          |           predicate:(((d_moy 
= 4) and d_date_sk is not null) and (d_year = 1999)) (type: boolean)
                      |                          |           Statistics:Num 
rows: 18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
-                     |                          |           TableScan [TS_43]
+                     |                          |           TableScan [TS_37]
                      |                          |              alias:date_dim
                      |                          |              Statistics:Num 
rows: 73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                      |                          |<-Reducer 13 [SIMPLE_EDGE]
-                     |                             Reduce Output Operator 
[RS_57]
+                     |                             Reduce Output Operator 
[RS_46]
                      |                                key expressions:_col0 
(type: int)
                      |                                Map-reduce partition 
columns:_col0 (type: int)
                      |                                sort order:+
                      |                                Statistics:Num rows: 
559020 Data size: 802908187 Basic stats: COMPLETE Column stats: NONE
                      |                                value expressions:_col3 
(type: int), _col4 (type: int), _col5 (type: int), _col6 (type: string)
-                     |                                Merge Join Operator 
[MERGEJOIN_119]
+                     |                                Merge Join Operator 
[MERGEJOIN_101]
                      |                                |  condition 
map:[{"":"Inner Join 0 to 1"}]
                      |                                |  keys:{"0":"_col2 
(type: int)","1":"_col0 (type: int)"}
                      |                                |  
outputColumnNames:["_col0","_col3","_col4","_col5","_col6"]
                      |                                |  Statistics:Num rows: 
559020 Data size: 802908187 Basic stats: COMPLETE Column stats: NONE
                      |                                |<-Map 17 [SIMPLE_EDGE]
-                     |                                |  Reduce Output 
Operator [RS_54]
+                     |                                |  Reduce Output 
Operator [RS_44]
                      |                                |     key 
expressions:_col0 (type: int)
                      |                                |     Map-reduce 
partition columns:_col0 (type: int)
                      |                                |     sort order:+
                      |                                |     Statistics:Num 
rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: NONE
                      |                                |     value 
expressions:_col1 (type: string)
-                     |                                |     Select Operator 
[SEL_42]
+                     |                                |     Select Operator 
[SEL_36]
                      |                                |        
outputColumnNames:["_col0","_col1"]
                      |                                |        Statistics:Num 
rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: NONE
-                     |                                |        Filter Operator 
[FIL_111]
+                     |                                |        Filter Operator 
[FIL_95]
                      |                                |           
predicate:w_warehouse_sk is not null (type: boolean)
                      |                                |           
Statistics:Num rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: 
NONE
-                     |                                |           TableScan 
[TS_40]
+                     |                                |           TableScan 
[TS_34]
                      |                                |              
alias:warehouse
                      |                                |              
Statistics:Num rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: 
NONE
                      |                                |<-Reducer 12 
[SIMPLE_EDGE]
-                     |                                   Reduce Output 
Operator [RS_52]
+                     |                                   Reduce Output 
Operator [RS_43]
                      |                                      key 
expressions:_col2 (type: int)
                      |                                      Map-reduce 
partition columns:_col2 (type: int)
                      |                                      sort order:+
                      |                                      Statistics:Num 
rows: 508200 Data size: 729916518 Basic stats: COMPLETE Column stats: NONE
                      |                                      value 
expressions:_col0 (type: int), _col3 (type: int), _col4 (type: int)
-                     |                                      Merge Join 
Operator [MERGEJOIN_118]
+                     |                                      Merge Join 
Operator [MERGEJOIN_100]
                      |                                      |  condition 
map:[{"":"Inner Join 0 to 1"}]
                      |                                      |  
keys:{"0":"_col1 (type: int)","1":"_col0 (type: int)"}
                      |                                      |  
outputColumnNames:["_col0","_col2","_col3","_col4"]
                      |                                      |  Statistics:Num 
rows: 508200 Data size: 729916518 Basic stats: COMPLETE Column stats: NONE
                      |                                      |<-Map 11 
[SIMPLE_EDGE]
-                     |                                      |  Reduce Output 
Operator [RS_47]
+                     |                                      |  Reduce Output 
Operator [RS_40]
                      |                                      |     key 
expressions:_col1 (type: int)
                      |                                      |     Map-reduce 
partition columns:_col1 (type: int)
                      |                                      |     sort order:+
                      |                                      |     
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                      |                                      |     value 
expressions:_col0 (type: int), _col2 (type: int), _col3 (type: int)
-                     |                                      |     Select 
Operator [SEL_36]
+                     |                                      |     Select 
Operator [SEL_30]
                      |                                      |        
outputColumnNames:["_col0","_col1","_col2","_col3"]
                      |                                      |        
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                     |                                      |        Filter 
Operator [FIL_109]
+                     |                                      |        Filter 
Operator [FIL_93]
                      |                                      |           
predicate:((inv_item_sk is not null and inv_warehouse_sk is not null) and 
inv_date_sk is not null) (type: boolean)
                      |                                      |           
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                     |                                      |           
TableScan [TS_34]
+                     |                                      |           
TableScan [TS_28]
                      |                                      |              
alias:inventory
                      |                                      |              
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                      |                                      |<-Map 16 
[SIMPLE_EDGE]
-                     |                                         Reduce Output 
Operator [RS_49]
+                     |                                         Reduce Output 
Operator [RS_41]
                      |                                            key 
expressions:_col0 (type: int)
                      |                                            Map-reduce 
partition columns:_col0 (type: int)
                      |                                            sort order:+
                      |                                            
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
-                     |                                            Select 
Operator [SEL_39]
+                     |                                            Select 
Operator [SEL_33]
                      |                                               
outputColumnNames:["_col0"]
                      |                                               
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
-                     |                                               Filter 
Operator [FIL_110]
+                     |                                               Filter 
Operator [FIL_94]
                      |                                                  
predicate:i_item_sk is not null (type: boolean)
                      |                                                  
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
-                     |                                                  
TableScan [TS_37]
+                     |                                                  
TableScan [TS_31]
                      |                                                     
alias:item
                      |                                                     
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
                      |<-Reducer 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_69]
+                        Reduce Output Operator [RS_56]
                            key expressions:_col2 (type: int), _col1 (type: int)
                            Map-reduce partition columns:_col2 (type: int), 
_col1 (type: int)
                            sort order:++
                            Statistics:Num rows: 102487 Data size: 147199837 
Basic stats: COMPLETE Column stats: NONE
                            value expressions:_col3 (type: int), _col4 (type: 
double), _col5 (type: double)
-                           Select Operator [SEL_31]
+                           Select Operator [SEL_27]
                               
outputColumnNames:["_col1","_col2","_col3","_col4","_col5"]
                               Statistics:Num rows: 102487 Data size: 147199837 
Basic stats: COMPLETE Column stats: NONE
-                              Filter Operator [FIL_103]
+                              Filter Operator [FIL_26]
                                  predicate:(CASE (_col5) WHEN (0) THEN (0) 
ELSE ((_col4 / _col5)) END > 1.0) (type: boolean)
                                  Statistics:Num rows: 102487 Data size: 
147199837 Basic stats: COMPLETE Column stats: NONE
-                                 Select Operator [SEL_114]
-                                    
outputColumnNames:["_col0","_col1","_col3","_col4","_col5"]
+                                 Select Operator [SEL_25]
+                                    
outputColumnNames:["_col1","_col2","_col3","_col4","_col5"]
                                     Statistics:Num rows: 307461 Data size: 
441599512 Basic stats: COMPLETE Column stats: NONE
-                                    Group By Operator [GBY_30]
+                                    Group By Operator [GBY_24]
                                     |  
aggregations:["stddev_samp(VALUE._col0)","avg(VALUE._col1)"]
                                     |  keys:KEY._col0 (type: int), KEY._col1 
(type: int), KEY._col2 (type: string), KEY._col3 (type: int)
                                     |  
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                     |  Statistics:Num rows: 307461 Data size: 
441599512 Basic stats: COMPLETE Column stats: NONE
                                     |<-Reducer 4 [SIMPLE_EDGE]
-                                       Reduce Output Operator [RS_29]
+                                       Reduce Output Operator [RS_23]
                                           key expressions:_col0 (type: int), 
_col1 (type: int), _col2 (type: string), _col3 (type: int)
                                           Map-reduce partition columns:_col0 
(type: int), _col1 (type: int), _col2 (type: string), _col3 (type: int)
                                           sort order:++++
                                           Statistics:Num rows: 614922 Data 
size: 883199024 Basic stats: COMPLETE Column stats: NONE
                                           value expressions:_col4 (type: 
struct<count:bigint,sum:double,variance:double>), _col5 (type: 
struct<count:bigint,sum:double,input:int>)
-                                          Group By Operator [GBY_28]
+                                          Group By Operator [GBY_22]
                                              
aggregations:["stddev_samp(_col3)","avg(_col3)"]
                                              keys:_col4 (type: int), _col5 
(type: int), _col6 (type: string), _col9 (type: int)
                                              
outputColumnNames:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                              Statistics:Num rows: 614922 Data 
size: 883199024 Basic stats: COMPLETE Column stats: NONE
-                                             Select Operator [SEL_27]
+                                             Select Operator [SEL_21]
                                                 
outputColumnNames:["_col4","_col5","_col6","_col9","_col3"]
                                                 Statistics:Num rows: 614922 
Data size: 883199024 Basic stats: COMPLETE Column stats: NONE
-                                                Merge Join Operator 
[MERGEJOIN_117]
+                                                Merge Join Operator 
[MERGEJOIN_99]
                                                 |  condition map:[{"":"Inner 
Join 0 to 1"}]
                                                 |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
                                                 |  
outputColumnNames:["_col3","_col4","_col5","_col6"]
                                                 |  Statistics:Num rows: 614922 
Data size: 883199024 Basic stats: COMPLETE Column stats: NONE
                                                 |<-Map 10 [SIMPLE_EDGE]
-                                                |  Reduce Output Operator 
[RS_25]
+                                                |  Reduce Output Operator 
[RS_19]
                                                 |     key expressions:_col0 
(type: int)
                                                 |     Map-reduce partition 
columns:_col0 (type: int)
                                                 |     sort order:+
@@ -219,26 +219,26 @@ Stage-0
                                                 |     Select Operator [SEL_11]
                                                 |        
outputColumnNames:["_col0"]
                                                 |        Statistics:Num rows: 
18262 Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
-                                                |        Filter Operator 
[FIL_107]
+                                                |        Filter Operator 
[FIL_92]
                                                 |           predicate:(((d_moy 
= 3) and d_date_sk is not null) and (d_year = 1999)) (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_23]
+                                                   Reduce Output Operator 
[RS_18]
                                                       key expressions:_col0 
(type: int)
                                                       Map-reduce partition 
columns:_col0 (type: int)
                                                       sort order:+
                                                       Statistics:Num rows: 
559020 Data size: 802908187 Basic stats: COMPLETE Column stats: NONE
                                                       value expressions:_col3 
(type: int), _col4 (type: int), _col5 (type: int), _col6 (type: string)
-                                                      Merge Join Operator 
[MERGEJOIN_116]
+                                                      Merge Join Operator 
[MERGEJOIN_98]
                                                       |  condition 
map:[{"":"Inner Join 0 to 1"}]
                                                       |  keys:{"0":"_col2 
(type: int)","1":"_col0 (type: int)"}
                                                       |  
outputColumnNames:["_col0","_col3","_col4","_col5","_col6"]
                                                       |  Statistics:Num rows: 
559020 Data size: 802908187 Basic stats: COMPLETE Column stats: NONE
                                                       |<-Map 9 [SIMPLE_EDGE]
-                                                      |  Reduce Output 
Operator [RS_20]
+                                                      |  Reduce Output 
Operator [RS_16]
                                                       |     key 
expressions:_col0 (type: int)
                                                       |     Map-reduce 
partition columns:_col0 (type: int)
                                                       |     sort order:+
@@ -247,26 +247,26 @@ Stage-0
                                                       |     Select Operator 
[SEL_8]
                                                       |        
outputColumnNames:["_col0","_col1"]
                                                       |        Statistics:Num 
rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: NONE
-                                                      |        Filter Operator 
[FIL_106]
+                                                      |        Filter Operator 
[FIL_91]
                                                       |           
predicate:w_warehouse_sk is not null (type: boolean)
                                                       |           
Statistics:Num rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: 
NONE
                                                       |           TableScan 
[TS_6]
                                                       |              
alias:warehouse
                                                       |              
Statistics:Num rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: 
NONE
                                                       |<-Reducer 2 
[SIMPLE_EDGE]
-                                                         Reduce Output 
Operator [RS_18]
+                                                         Reduce Output 
Operator [RS_15]
                                                             key 
expressions:_col2 (type: int)
                                                             Map-reduce 
partition columns:_col2 (type: int)
                                                             sort order:+
                                                             Statistics:Num 
rows: 508200 Data size: 729916518 Basic stats: COMPLETE Column stats: NONE
                                                             value 
expressions:_col0 (type: int), _col3 (type: int), _col4 (type: int)
-                                                            Merge Join 
Operator [MERGEJOIN_115]
+                                                            Merge Join 
Operator [MERGEJOIN_97]
                                                             |  condition 
map:[{"":"Inner Join 0 to 1"}]
                                                             |  
keys:{"0":"_col1 (type: int)","1":"_col0 (type: int)"}
                                                             |  
outputColumnNames:["_col0","_col2","_col3","_col4"]
                                                             |  Statistics:Num 
rows: 508200 Data size: 729916518 Basic stats: COMPLETE Column stats: NONE
                                                             |<-Map 1 
[SIMPLE_EDGE]
-                                                            |  Reduce Output 
Operator [RS_13]
+                                                            |  Reduce Output 
Operator [RS_12]
                                                             |     key 
expressions:_col1 (type: int)
                                                             |     Map-reduce 
partition columns:_col1 (type: int)
                                                             |     sort order:+
@@ -275,14 +275,14 @@ Stage-0
                                                             |     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_104]
+                                                            |        Filter 
Operator [FIL_89]
                                                             |           
predicate:((inv_item_sk is not null and inv_warehouse_sk is not null) and 
inv_date_sk is not null) (type: boolean)
                                                             |           
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                                                             |           
TableScan [TS_0]
                                                             |              
alias:inventory
                                                             |              
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                                                             |<-Map 8 
[SIMPLE_EDGE]
-                                                               Reduce Output 
Operator [RS_15]
+                                                               Reduce Output 
Operator [RS_13]
                                                                   key 
expressions:_col0 (type: int)
                                                                   Map-reduce 
partition columns:_col0 (type: int)
                                                                   sort order:+
@@ -290,7 +290,7 @@ Stage-0
                                                                   Select 
Operator [SEL_5]
                                                                      
outputColumnNames:["_col0"]
                                                                      
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
-                                                                     Filter 
Operator [FIL_105]
+                                                                     Filter 
Operator [FIL_90]
                                                                         
predicate:i_item_sk is not null (type: boolean)
                                                                         
Statistics:Num rows: 462000 Data size: 663560457 Basic stats: COMPLETE Column 
stats: NONE
                                                                         
TableScan [TS_3]

http://git-wip-us.apache.org/repos/asf/hive/blob/6f44fc81/ql/src/test/results/clientpositive/perf/query40.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query40.q.out 
b/ql/src/test/results/clientpositive/perf/query40.q.out
index 08c3e49..b2d6262 100644
--- a/ql/src/test/results/clientpositive/perf/query40.q.out
+++ b/ql/src/test/results/clientpositive/perf/query40.q.out
@@ -17,49 +17,49 @@ Stage-0
       limit:100
       Stage-1
          Reducer 7
-         File Output Operator [FS_41]
+         File Output Operator [FS_35]
             compressed:false
             Statistics:Num rows: 100 Data size: 143600 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_40]
+            Limit [LIM_34]
                Number of rows:100
                Statistics:Num rows: 100 Data size: 143600 Basic stats: 
COMPLETE Column stats: NONE
-               Select Operator [SEL_39]
+               Select Operator [SEL_33]
                |  outputColumnNames:["_col0","_col1","_col2","_col3"]
                |  Statistics:Num rows: 139755 Data size: 200727046 Basic 
stats: COMPLETE Column stats: NONE
                |<-Reducer 6 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_38]
+                  Reduce Output Operator [RS_32]
                      key expressions:_col0 (type: string), _col1 (type: string)
                      sort order:++
                      Statistics:Num rows: 139755 Data size: 200727046 Basic 
stats: COMPLETE Column stats: NONE
                      value expressions:_col2 (type: decimal(23,2)), _col3 
(type: decimal(23,2))
-                     Group By Operator [GBY_36]
+                     Group By Operator [GBY_30]
                      |  aggregations:["sum(VALUE._col0)","sum(VALUE._col1)"]
                      |  keys:KEY._col0 (type: string), KEY._col1 (type: string)
                      |  outputColumnNames:["_col0","_col1","_col2","_col3"]
                      |  Statistics:Num rows: 139755 Data size: 200727046 Basic 
stats: COMPLETE Column stats: NONE
                      |<-Reducer 5 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_35]
+                        Reduce Output Operator [RS_29]
                            key expressions:_col0 (type: string), _col1 (type: 
string)
                            Map-reduce partition columns:_col0 (type: string), 
_col1 (type: string)
                            sort order:++
                            Statistics:Num rows: 279510 Data size: 401454092 
Basic stats: COMPLETE Column stats: NONE
                            value expressions:_col2 (type: decimal(23,2)), 
_col3 (type: decimal(23,2))
-                           Group By Operator [GBY_34]
+                           Group By Operator [GBY_28]
                               aggregations:["sum(_col2)","sum(_col3)"]
                               keys:_col0 (type: string), _col1 (type: string)
                               
outputColumnNames:["_col0","_col1","_col2","_col3"]
                               Statistics:Num rows: 279510 Data size: 401454092 
Basic stats: COMPLETE Column stats: NONE
-                              Select Operator [SEL_32]
+                              Select Operator [SEL_26]
                                  
outputColumnNames:["_col0","_col1","_col2","_col3"]
                                  Statistics:Num rows: 279510 Data size: 
401454092 Basic stats: COMPLETE Column stats: NONE
-                                 Merge Join Operator [MERGEJOIN_63]
+                                 Merge Join Operator [MERGEJOIN_57]
                                  |  condition map:[{"":"Inner Join 0 to 1"}]
                                  |  keys:{"0":"_col0 (type: int)","1":"_col0 
(type: int)"}
                                  |  
outputColumnNames:["_col4","_col7","_col9","_col11","_col14"]
                                  |  Statistics:Num rows: 279510 Data size: 
401454092 Basic stats: COMPLETE Column stats: NONE
                                  |<-Map 11 [SIMPLE_EDGE]
-                                 |  Reduce Output Operator [RS_30]
+                                 |  Reduce Output Operator [RS_24]
                                  |     key expressions:_col0 (type: int)
                                  |     Map-reduce partition columns:_col0 
(type: int)
                                  |     sort order:+
@@ -68,26 +68,26 @@ Stage-0
                                  |     Select Operator [SEL_13]
                                  |        outputColumnNames:["_col0","_col1"]
                                  |        Statistics:Num rows: 36524 Data 
size: 40870356 Basic stats: COMPLETE Column stats: NONE
-                                 |        Filter Operator [FIL_59]
+                                 |        Filter Operator [FIL_53]
                                  |           predicate:(d_date BETWEEN 
'1998-03-09' AND '1998-05-08' and d_date_sk is not null) (type: boolean)
                                  |           Statistics:Num rows: 36524 Data 
size: 40870356 Basic stats: COMPLETE Column stats: NONE
                                  |           TableScan [TS_11]
                                  |              alias:date_dim
                                  |              Statistics:Num rows: 73049 
Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                                  |<-Reducer 4 [SIMPLE_EDGE]
-                                    Reduce Output Operator [RS_28]
+                                    Reduce Output Operator [RS_23]
                                        key expressions:_col0 (type: int)
                                        Map-reduce partition columns:_col0 
(type: int)
                                        sort order:+
                                        Statistics:Num rows: 254100 Data size: 
364958258 Basic stats: COMPLETE Column stats: NONE
                                        value expressions:_col4 (type: 
decimal(7,2)), _col7 (type: decimal(7,2)), _col9 (type: string), _col11 (type: 
string)
-                                       Merge Join Operator [MERGEJOIN_62]
+                                       Merge Join Operator [MERGEJOIN_56]
                                        |  condition map:[{"":"Inner Join 0 to 
1"}]
                                        |  keys:{"0":"_col2 (type: 
int)","1":"_col0 (type: int)"}
                                        |  
outputColumnNames:["_col0","_col4","_col7","_col9","_col11"]
                                        |  Statistics:Num rows: 254100 Data 
size: 364958258 Basic stats: COMPLETE Column stats: NONE
                                        |<-Map 10 [SIMPLE_EDGE]
-                                       |  Reduce Output Operator [RS_25]
+                                       |  Reduce Output Operator [RS_21]
                                        |     key expressions:_col0 (type: int)
                                        |     Map-reduce partition 
columns:_col0 (type: int)
                                        |     sort order:+
@@ -96,26 +96,26 @@ Stage-0
                                        |     Select Operator [SEL_10]
                                        |        
outputColumnNames:["_col0","_col1"]
                                        |        Statistics:Num rows: 231000 
Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
-                                       |        Filter Operator [FIL_58]
+                                       |        Filter Operator [FIL_52]
                                        |           predicate:(i_current_price 
BETWEEN 0.99 AND 1.49 and i_item_sk is not null) (type: boolean)
                                        |           Statistics:Num rows: 231000 
Data size: 331780228 Basic stats: COMPLETE Column stats: NONE
                                        |           TableScan [TS_8]
                                        |              alias:item
                                        |              Statistics:Num rows: 
462000 Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
                                        |<-Reducer 3 [SIMPLE_EDGE]
-                                          Reduce Output Operator [RS_23]
+                                          Reduce Output Operator [RS_20]
                                              key expressions:_col2 (type: int)
                                              Map-reduce partition 
columns:_col2 (type: int)
                                              sort order:+
                                              Statistics:Num rows: 29 Data 
size: 30582 Basic stats: COMPLETE Column stats: NONE
                                              value expressions:_col0 (type: 
int), _col4 (type: decimal(7,2)), _col7 (type: decimal(7,2)), _col9 (type: 
string)
-                                             Merge Join Operator [MERGEJOIN_61]
+                                             Merge Join Operator [MERGEJOIN_55]
                                              |  condition map:[{"":"Inner Join 
0 to 1"}]
                                              |  keys:{"0":"_col1 (type: 
int)","1":"_col0 (type: int)"}
                                              |  
outputColumnNames:["_col0","_col2","_col4","_col7","_col9"]
                                              |  Statistics:Num rows: 29 Data 
size: 30582 Basic stats: COMPLETE Column stats: NONE
                                              |<-Map 9 [SIMPLE_EDGE]
-                                             |  Reduce Output Operator [RS_20]
+                                             |  Reduce Output Operator [RS_18]
                                              |     key expressions:_col0 
(type: int)
                                              |     Map-reduce partition 
columns:_col0 (type: int)
                                              |     sort order:+
@@ -124,20 +124,20 @@ Stage-0
                                              |     Select Operator [SEL_7]
                                              |        
outputColumnNames:["_col0","_col1"]
                                              |        Statistics:Num rows: 27 
Data size: 27802 Basic stats: COMPLETE Column stats: NONE
-                                             |        Filter Operator [FIL_57]
+                                             |        Filter Operator [FIL_51]
                                              |           
predicate:w_warehouse_sk is not null (type: boolean)
                                              |           Statistics:Num rows: 
27 Data size: 27802 Basic stats: COMPLETE Column stats: NONE
                                              |           TableScan [TS_5]
                                              |              alias:warehouse
                                              |              Statistics:Num 
rows: 27 Data size: 27802 Basic stats: COMPLETE Column stats: NONE
                                              |<-Reducer 2 [SIMPLE_EDGE]
-                                                Reduce Output Operator [RS_18]
+                                                Reduce Output Operator [RS_17]
                                                    key expressions:_col1 
(type: int)
                                                    Map-reduce partition 
columns:_col1 (type: int)
                                                    sort order:+
                                                    Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
                                                    value expressions:_col0 
(type: int), _col2 (type: int), _col4 (type: decimal(7,2)), _col7 (type: 
decimal(7,2))
-                                                   Merge Join Operator 
[MERGEJOIN_60]
+                                                   Merge Join Operator 
[MERGEJOIN_54]
                                                    |  condition map:[{"":"Left 
Outer Join0 to 1"}]
                                                    |  keys:{"0":"_col3 (type: 
int), _col2 (type: int)","1":"_col1 (type: int), _col0 (type: int)"}
                                                    |  
outputColumnNames:["_col0","_col1","_col2","_col4","_col7"]
@@ -152,7 +152,7 @@ Stage-0
                                                    |     Select Operator 
[SEL_2]
                                                    |        
outputColumnNames:["_col0","_col1","_col2","_col3","_col4"]
                                                    |        Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                   |        Filter Operator 
[FIL_55]
+                                                   |        Filter Operator 
[FIL_49]
                                                    |           
predicate:((cs_warehouse_sk is not null and cs_item_sk is not null) and 
cs_sold_date_sk is not null) (type: boolean)
                                                    |           Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                                                    |           TableScan [TS_0]
@@ -168,10 +168,7 @@ Stage-0
                                                          Select Operator 
[SEL_4]
                                                             
outputColumnNames:["_col0","_col1","_col2"]
                                                             Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                            Filter Operator 
[FIL_56]
-                                                               
predicate:cr_item_sk is not null (type: boolean)
+                                                            TableScan [TS_3]
+                                                               
alias:catalog_returns
                                                                Statistics:Num 
rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                               TableScan [TS_3]
-                                                                  
alias:catalog_returns
-                                                                  
Statistics:Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
 

http://git-wip-us.apache.org/repos/asf/hive/blob/6f44fc81/ql/src/test/results/clientpositive/perf/query42.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query42.q.out 
b/ql/src/test/results/clientpositive/perf/query42.q.out
index a3264c7..3954829 100644
--- a/ql/src/test/results/clientpositive/perf/query42.q.out
+++ b/ql/src/test/results/clientpositive/perf/query42.q.out
@@ -15,48 +15,48 @@ Stage-0
       limit:100
       Stage-1
          Reducer 5
-         File Output Operator [FS_27]
+         File Output Operator [FS_23]
             compressed:false
             Statistics:Num rows: 100 Data size: 143600 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_26]
+            Limit [LIM_22]
                Number of rows:100
                Statistics:Num rows: 100 Data size: 143600 Basic stats: 
COMPLETE Column stats: NONE
-               Select Operator [SEL_25]
+               Select Operator [SEL_21]
                |  outputColumnNames:["_col0","_col1","_col2","_col3"]
                |  Statistics:Num rows: 127050 Data size: 182479129 Basic 
stats: COMPLETE Column stats: NONE
                |<-Reducer 4 [SIMPLE_EDGE]
-                  Reduce Output Operator [RS_24]
+                  Reduce Output Operator [RS_20]
                      key expressions:_col3 (type: decimal(17,2)), _col0 (type: 
int), _col1 (type: int), _col2 (type: string)
                      sort order:-+++
                      Statistics:Num rows: 127050 Data size: 182479129 Basic 
stats: COMPLETE Column stats: NONE
-                     Group By Operator [GBY_22]
+                     Group By Operator [GBY_18]
                      |  aggregations:["sum(VALUE._col0)"]
                      |  keys:KEY._col0 (type: int), KEY._col1 (type: int), 
KEY._col2 (type: string)
                      |  outputColumnNames:["_col0","_col1","_col2","_col3"]
                      |  Statistics:Num rows: 127050 Data size: 182479129 Basic 
stats: COMPLETE Column stats: NONE
                      |<-Reducer 3 [SIMPLE_EDGE]
-                        Reduce Output Operator [RS_21]
+                        Reduce Output Operator [RS_17]
                            key expressions:_col0 (type: int), _col1 (type: 
int), _col2 (type: string)
                            Map-reduce partition columns:_col0 (type: int), 
_col1 (type: int), _col2 (type: string)
                            sort order:+++
                            Statistics:Num rows: 254100 Data size: 364958258 
Basic stats: COMPLETE Column stats: NONE
                            value expressions:_col3 (type: decimal(17,2))
-                           Group By Operator [GBY_20]
+                           Group By Operator [GBY_16]
                               aggregations:["sum(_col5)"]
                               keys:_col1 (type: int), _col7 (type: int), _col8 
(type: string)
                               
outputColumnNames:["_col0","_col1","_col2","_col3"]
                               Statistics:Num rows: 254100 Data size: 364958258 
Basic stats: COMPLETE Column stats: NONE
-                              Select Operator [SEL_19]
+                              Select Operator [SEL_15]
                                  
outputColumnNames:["_col1","_col7","_col8","_col5"]
                                  Statistics:Num rows: 254100 Data size: 
364958258 Basic stats: COMPLETE Column stats: NONE
-                                 Merge Join Operator [MERGEJOIN_37]
+                                 Merge Join Operator [MERGEJOIN_33]
                                  |  condition map:[{"":"Inner Join 0 to 1"}]
                                  |  keys:{"0":"_col4 (type: int)","1":"_col0 
(type: int)"}
                                  |  outputColumnNames:["_col5","_col7","_col8"]
                                  |  Statistics:Num rows: 254100 Data size: 
364958258 Basic stats: COMPLETE Column stats: NONE
                                  |<-Map 7 [SIMPLE_EDGE]
-                                 |  Reduce Output Operator [RS_17]
+                                 |  Reduce Output Operator [RS_13]
                                  |     key expressions:_col0 (type: int)
                                  |     Map-reduce partition columns:_col0 
(type: int)
                                  |     sort order:+
@@ -65,26 +65,26 @@ Stage-0
                                  |     Select Operator [SEL_8]
                                  |        
outputColumnNames:["_col0","_col1","_col2"]
                                  |        Statistics:Num rows: 231000 Data 
size: 331780228 Basic stats: COMPLETE Column stats: NONE
-                                 |        Filter Operator [FIL_35]
+                                 |        Filter Operator [FIL_31]
                                  |           predicate:((i_manager_id = 1) and 
i_item_sk is not null) (type: boolean)
                                  |           Statistics:Num rows: 231000 Data 
size: 331780228 Basic stats: COMPLETE Column stats: NONE
                                  |           TableScan [TS_6]
                                  |              alias:item
                                  |              Statistics:Num rows: 462000 
Data size: 663560457 Basic stats: COMPLETE Column stats: NONE
                                  |<-Reducer 2 [SIMPLE_EDGE]
-                                    Reduce Output Operator [RS_15]
+                                    Reduce Output Operator [RS_12]
                                        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:_col5 (type: 
decimal(7,2))
-                                       Merge Join Operator [MERGEJOIN_36]
+                                       Merge Join Operator [MERGEJOIN_32]
                                        |  condition map:[{"":"Inner Join 0 to 
1"}]
                                        |  keys:{"0":"_col0 (type: 
int)","1":"_col0 (type: int)"}
                                        |  outputColumnNames:["_col4","_col5"]
                                        |  Statistics:Num rows: 20088 Data 
size: 22478696 Basic stats: COMPLETE Column stats: NONE
                                        |<-Map 1 [SIMPLE_EDGE]
-                                       |  Reduce Output Operator [RS_10]
+                                       |  Reduce Output Operator [RS_9]
                                        |     key expressions:_col0 (type: int)
                                        |     Map-reduce partition 
columns:_col0 (type: int)
                                        |     sort order:+
@@ -92,14 +92,14 @@ Stage-0
                                        |     Select Operator [SEL_2]
                                        |        outputColumnNames:["_col0"]
                                        |        Statistics:Num rows: 18262 
Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
-                                       |        Filter Operator [FIL_33]
+                                       |        Filter Operator [FIL_29]
                                        |           predicate:(((d_year = 1998) 
and (d_moy = 12)) and d_date_sk is not null) (type: boolean)
                                        |           Statistics:Num rows: 18262 
Data size: 20435178 Basic stats: COMPLETE Column stats: NONE
                                        |           TableScan [TS_0]
                                        |              alias:dt
                                        |              Statistics:Num rows: 
73049 Data size: 81741831 Basic stats: COMPLETE Column stats: NONE
                                        |<-Map 6 [SIMPLE_EDGE]
-                                          Reduce Output Operator [RS_12]
+                                          Reduce Output Operator [RS_10]
                                              key expressions:_col0 (type: int)
                                              Map-reduce partition 
columns:_col0 (type: int)
                                              sort order:+
@@ -108,7 +108,7 @@ Stage-0
                                              Select Operator [SEL_5]
                                                 
outputColumnNames:["_col0","_col1","_col2"]
                                                 Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
-                                                Filter Operator [FIL_34]
+                                                Filter Operator [FIL_30]
                                                    predicate:(ss_sold_date_sk 
is not null and ss_item_sk is not null) (type: boolean)
                                                    Statistics:Num rows: 1 Data 
size: 0 Basic stats: PARTIAL Column stats: NONE
                                                    TableScan [TS_3]

Reply via email to