http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query85.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query85.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query85.q.out
index 50474bc..f5a71b4 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query85.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query85.q.out
@@ -184,36 +184,36 @@ CBO PLAN:
 HiveProject(_o__c0=[$0], _o__c1=[$1], _o__c2=[$2], _o__c3=[$3])
   HiveSortLimit(sort0=[$7], sort1=[$4], sort2=[$5], sort3=[$6], dir0=[ASC], 
dir1=[ASC], dir2=[ASC], dir3=[ASC], fetch=[100])
     HiveProject(_o__c0=[substr($0, 1, 20)], _o__c1=[/(CAST($1):DOUBLE, $2)], 
_o__c2=[/($3, $4)], _o__c3=[/($5, $6)], (tok_function avg (tok_table_or_col 
ws_quantity))=[/(CAST($1):DOUBLE, $2)], (tok_function avg (tok_table_or_col 
wr_refunded_cash))=[/($3, $4)], (tok_function avg (tok_table_or_col 
wr_fee))=[/($5, $6)], (tok_function substr (tok_table_or_col r_reason_desc) 1 
20)=[substr($0, 1, 20)])
-      HiveAggregate(group=[{7}], agg#0=[sum($26)], agg#1=[count($26)], 
agg#2=[sum($21)], agg#3=[count($21)], agg#4=[sum($20)], agg#5=[count($20)])
-        HiveJoin(condition=[AND(AND(=($0, $17), =($4, $1)), =($5, $2))], 
joinType=[inner], algorithm=[none], cost=[not available])
-          HiveProject(cd_demo_sk=[$0], cd_marital_status=[$2], 
cd_education_status=[$3])
+      HiveAggregate(group=[{14}], agg#0=[sum($32)], agg#1=[count($32)], 
agg#2=[sum($27)], agg#3=[count($27)], agg#4=[sum($26)], agg#5=[count($26)])
+        HiveJoin(condition=[AND(AND(AND(=($1, $18), =($2, $19)), =($0, $21)), 
OR(AND($3, $4, $36), AND($5, $6, $37), AND($7, $8, $38)))], joinType=[inner], 
algorithm=[none], cost=[not available])
+          HiveProject(cd_demo_sk=[$0], cd_marital_status=[$2], 
cd_education_status=[$3], ==[=($2, _UTF-16LE'M')], =4=[=($3, _UTF-16LE'4 yr 
Degree')], =5=[=($2, _UTF-16LE'D')], =6=[=($3, _UTF-16LE'Primary')], =7=[=($2, 
_UTF-16LE'U')], =8=[=($3, _UTF-16LE'Advanced Degree')])
             HiveFilter(condition=[AND(IN($3, _UTF-16LE'4 yr Degree', 
_UTF-16LE'Primary', _UTF-16LE'Advanced Degree'), IN($2, _UTF-16LE'M', 
_UTF-16LE'D', _UTF-16LE'U'), IS NOT NULL($0))])
-              HiveTableScan(table=[[default, customer_demographics]], 
table:alias=[cd2])
-          HiveJoin(condition=[AND(=($0, $12), OR(AND(=($1, _UTF-16LE'M'), 
=($2, _UTF-16LE'4 yr Degree'), BETWEEN(false, $24, 100, 150)), AND(=($1, 
_UTF-16LE'D'), =($2, _UTF-16LE'Primary'), BETWEEN(false, $24, 50, 100)), 
AND(=($1, _UTF-16LE'U'), =($2, _UTF-16LE'Advanced Degree'), BETWEEN(false, $24, 
150, 200))))], joinType=[inner], algorithm=[none], cost=[not available])
-            HiveProject(cd_demo_sk=[$0], cd_marital_status=[$2], 
cd_education_status=[$3])
-              HiveFilter(condition=[AND(IN($3, _UTF-16LE'4 yr Degree', 
_UTF-16LE'Primary', _UTF-16LE'Advanced Degree'), IN($2, _UTF-16LE'M', 
_UTF-16LE'D', _UTF-16LE'U'), IS NOT NULL($0))])
-                HiveTableScan(table=[[default, customer_demographics]], 
table:alias=[cd1])
-            HiveJoin(condition=[=($0, $12)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveTableScan(table=[[default, customer_demographics]], 
table:alias=[cd1])
+          HiveJoin(condition=[AND(=($0, $13), OR(AND($1, $24), AND($2, $25), 
AND($3, $26)))], joinType=[inner], algorithm=[none], cost=[not available])
+            HiveProject(ca_address_sk=[$0], IN=[IN($8, _UTF-16LE'KY', 
_UTF-16LE'GA', _UTF-16LE'NM')], IN2=[IN($8, _UTF-16LE'MT', _UTF-16LE'OR', 
_UTF-16LE'IN')], IN3=[IN($8, _UTF-16LE'WI', _UTF-16LE'MO', _UTF-16LE'WV')])
+              HiveFilter(condition=[AND(IN($8, _UTF-16LE'KY', _UTF-16LE'GA', 
_UTF-16LE'NM', _UTF-16LE'MT', _UTF-16LE'OR', _UTF-16LE'IN', _UTF-16LE'WI', 
_UTF-16LE'MO', _UTF-16LE'WV'), =($10, _UTF-16LE'United States'), IS NOT 
NULL($0))])
+                HiveTableScan(table=[[default, customer_address]], 
table:alias=[customer_address])
+            HiveJoin(condition=[=($0, $11)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveProject(r_reason_sk=[$0], r_reason_desc=[$2])
                 HiveFilter(condition=[IS NOT NULL($0)])
                   HiveTableScan(table=[[default, reason]], 
table:alias=[reason])
-              HiveJoin(condition=[=($14, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                HiveProject(d_date_sk=[$0], d_year=[CAST(1998):INTEGER])
-                  HiveFilter(condition=[AND(=($6, 1998), IS NOT NULL($0))])
-                    HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
-                HiveJoin(condition=[=($14, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                  HiveProject(wp_web_page_sk=[$0])
-                    HiveFilter(condition=[IS NOT NULL($0)])
-                      HiveTableScan(table=[[default, web_page]], 
table:alias=[web_page])
-                  HiveJoin(condition=[AND(=($0, $5), OR(AND(IN($1, 
_UTF-16LE'KY', _UTF-16LE'GA', _UTF-16LE'NM'), BETWEEN(false, $17, 100, 200)), 
AND(IN($1, _UTF-16LE'MT', _UTF-16LE'OR', _UTF-16LE'IN'), BETWEEN(false, $17, 
150, 300)), AND(IN($1, _UTF-16LE'WI', _UTF-16LE'MO', _UTF-16LE'WV'), 
BETWEEN(false, $17, 50, 250))))], joinType=[inner], algorithm=[none], cost=[not 
available])
-                    HiveProject(ca_address_sk=[$0], ca_state=[$8], 
ca_country=[CAST(_UTF-16LE'United States'):VARCHAR(2147483647) CHARACTER SET 
"UTF-16LE" COLLATE "ISO-8859-1$en_US$primary"])
-                      HiveFilter(condition=[AND(IN($8, _UTF-16LE'KY', 
_UTF-16LE'GA', _UTF-16LE'NM', _UTF-16LE'MT', _UTF-16LE'OR', _UTF-16LE'IN', 
_UTF-16LE'WI', _UTF-16LE'MO', _UTF-16LE'WV'), =($10, _UTF-16LE'United States'), 
IS NOT NULL($0))])
-                        HiveTableScan(table=[[default, customer_address]], 
table:alias=[customer_address])
+              HiveJoin(condition=[=($15, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                HiveProject(wp_web_page_sk=[$0])
+                  HiveFilter(condition=[IS NOT NULL($0)])
+                    HiveTableScan(table=[[default, web_page]], 
table:alias=[web_page])
+                HiveJoin(condition=[=($12, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                  HiveProject(d_date_sk=[$0])
+                    HiveFilter(condition=[AND(=($6, 1998), IS NOT NULL($0))])
+                      HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
+                  HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                    HiveProject(cd_demo_sk=[$0], cd_marital_status=[$2], 
cd_education_status=[$3])
+                      HiveFilter(condition=[AND(IN($3, _UTF-16LE'4 yr Degree', 
_UTF-16LE'Primary', _UTF-16LE'Advanced Degree'), IN($2, _UTF-16LE'M', 
_UTF-16LE'D', _UTF-16LE'U'), IS NOT NULL($0))])
+                        HiveTableScan(table=[[default, 
customer_demographics]], table:alias=[cd2])
                     HiveJoin(condition=[AND(=($9, $0), =($11, $5))], 
joinType=[inner], algorithm=[none], cost=[not available])
                       HiveProject(wr_item_sk=[$2], wr_refunded_cdemo_sk=[$4], 
wr_refunded_addr_sk=[$6], wr_returning_cdemo_sk=[$8], wr_reason_sk=[$12], 
wr_order_number=[$13], wr_fee=[$18], wr_refunded_cash=[$20])
                         HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT 
NULL($13), IS NOT NULL($4), IS NOT NULL($8), IS NOT NULL($6), IS NOT 
NULL($12))])
                           HiveTableScan(table=[[default, web_returns]], 
table:alias=[web_returns])
-                      HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], 
ws_web_page_sk=[$12], ws_order_number=[$17], ws_quantity=[$18], 
ws_sales_price=[$21], ws_net_profit=[$33])
+                      HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], 
ws_web_page_sk=[$12], ws_order_number=[$17], ws_quantity=[$18], 
BETWEEN=[BETWEEN(false, $33, 100, 200)], BETWEEN6=[BETWEEN(false, $33, 150, 
300)], BETWEEN7=[BETWEEN(false, $33, 50, 250)], BETWEEN8=[BETWEEN(false, $21, 
100, 150)], BETWEEN9=[BETWEEN(false, $21, 50, 100)], BETWEEN10=[BETWEEN(false, 
$21, 150, 200)])
                         HiveFilter(condition=[AND(OR(BETWEEN(false, $21, 100, 
150), BETWEEN(false, $21, 50, 100), BETWEEN(false, $21, 150, 200)), 
OR(BETWEEN(false, $33, 100, 200), BETWEEN(false, $33, 150, 300), BETWEEN(false, 
$33, 50, 250)), IS NOT NULL($3), IS NOT NULL($17), IS NOT NULL($12), IS NOT 
NULL($0))])
                           HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query87.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query87.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query87.q.out
index 35f319d..e030b3e 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query87.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query87.q.out
@@ -78,7 +78,7 @@ HiveAggregate(group=[{}], agg#0=[count()])
                                       HiveProject(ss_sold_date_sk=[$0], 
ss_customer_sk=[$3])
                                         HiveFilter(condition=[AND(IS NOT 
NULL($0), IS NOT NULL($3))])
                                           HiveTableScan(table=[[default, 
store_sales]], table:alias=[store_sales])
-                                      HiveProject(d_date_sk=[$0], d_date=[$2], 
d_month_seq=[$3])
+                                      HiveProject(d_date_sk=[$0], d_date=[$2])
                                         
HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), IS NOT NULL($0))])
                                           HiveTableScan(table=[[default, 
date_dim]], table:alias=[date_dim])
                           HiveProject($f0=[$1], $f1=[$0], $f2=[$2], $f3=[1], 
$f4=[$3])
@@ -93,7 +93,7 @@ HiveAggregate(group=[{}], agg#0=[count()])
                                       HiveProject(cs_sold_date_sk=[$0], 
cs_bill_customer_sk=[$3])
                                         HiveFilter(condition=[AND(IS NOT 
NULL($0), IS NOT NULL($3))])
                                           HiveTableScan(table=[[default, 
catalog_sales]], table:alias=[catalog_sales])
-                                      HiveProject(d_date_sk=[$0], d_date=[$2], 
d_month_seq=[$3])
+                                      HiveProject(d_date_sk=[$0], d_date=[$2])
                                         
HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), IS NOT NULL($0))])
                                           HiveTableScan(table=[[default, 
date_dim]], table:alias=[date_dim])
             HiveProject($f0=[$1], $f1=[$0], $f2=[$2], $f3=[1], $f4=[$3])
@@ -108,7 +108,7 @@ HiveAggregate(group=[{}], agg#0=[count()])
                         HiveProject(ws_sold_date_sk=[$0], 
ws_bill_customer_sk=[$4])
                           HiveFilter(condition=[AND(IS NOT NULL($0), IS NOT 
NULL($4))])
                             HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
-                        HiveProject(d_date_sk=[$0], d_date=[$2], 
d_month_seq=[$3])
+                        HiveProject(d_date_sk=[$0], d_date=[$2])
                           HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 
1223), IS NOT NULL($0))])
                             HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query88.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query88.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query88.q.out
index 1f86e3a..1f4471e 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query88.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query88.q.out
@@ -210,138 +210,138 @@ HiveProject($f0=[$0], $f00=[$7], $f01=[$6], $f02=[$5], 
$f03=[$4], $f04=[$3], $f0
               HiveJoin(condition=[true], joinType=[inner], algorithm=[none], 
cost=[not available])
                 HiveProject($f0=[$0])
                   HiveAggregate(group=[{}], agg#0=[count()])
-                    HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                      HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                    HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                      HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                         HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                           HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                             HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                               HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                          HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                          HiveProject(hd_demo_sk=[$0])
                             HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 
5), OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                               HiveTableScan(table=[[default, 
household_demographics]], table:alias=[household_demographics])
-                        HiveProject(t_time_sk=[$0], t_hour=[CAST(8):INTEGER], 
t_minute=[$4])
+                        HiveProject(t_time_sk=[$0])
                           HiveFilter(condition=[AND(=($3, 8), >=($4, 30), IS 
NOT NULL($0))])
                             HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-                      HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+                      HiveProject(s_store_sk=[$0])
                         HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS 
NOT NULL($0))])
                           HiveTableScan(table=[[default, store]], 
table:alias=[store])
                 HiveProject($f0=[$0])
                   HiveAggregate(group=[{}], agg#0=[count()])
-                    HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                      HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                    HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                      HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                         HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                           HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                             HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                               HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                          HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                          HiveProject(hd_demo_sk=[$0])
                             HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 
5), OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                               HiveTableScan(table=[[default, 
household_demographics]], table:alias=[household_demographics])
-                        HiveProject(t_time_sk=[$0], t_hour=[CAST(12):INTEGER], 
t_minute=[$4])
+                        HiveProject(t_time_sk=[$0])
                           HiveFilter(condition=[AND(=($3, 12), <($4, 30), IS 
NOT NULL($0))])
                             HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-                      HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+                      HiveProject(s_store_sk=[$0])
                         HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS 
NOT NULL($0))])
                           HiveTableScan(table=[[default, store]], 
table:alias=[store])
               HiveProject($f0=[$0])
                 HiveAggregate(group=[{}], agg#0=[count()])
-                  HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                    HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                  HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                    HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                       HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                         HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                           HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                             HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                        HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                        HiveProject(hd_demo_sk=[$0])
                           HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 
5), OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                             HiveTableScan(table=[[default, 
household_demographics]], table:alias=[household_demographics])
-                      HiveProject(t_time_sk=[$0], t_hour=[CAST(11):INTEGER], 
t_minute=[$4])
+                      HiveProject(t_time_sk=[$0])
                         HiveFilter(condition=[AND(=($3, 11), >=($4, 30), IS 
NOT NULL($0))])
                           HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-                    HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+                    HiveProject(s_store_sk=[$0])
                       HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT 
NULL($0))])
                         HiveTableScan(table=[[default, store]], 
table:alias=[store])
             HiveProject($f0=[$0])
               HiveAggregate(group=[{}], agg#0=[count()])
-                HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                  HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                  HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                     HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                       HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                         HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                           HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                      HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                      HiveProject(hd_demo_sk=[$0])
                         HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 5), 
OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                           HiveTableScan(table=[[default, 
household_demographics]], table:alias=[household_demographics])
-                    HiveProject(t_time_sk=[$0], t_hour=[CAST(11):INTEGER], 
t_minute=[$4])
+                    HiveProject(t_time_sk=[$0])
                       HiveFilter(condition=[AND(=($3, 11), <($4, 30), IS NOT 
NULL($0))])
                         HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-                  HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+                  HiveProject(s_store_sk=[$0])
                     HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT 
NULL($0))])
                       HiveTableScan(table=[[default, store]], 
table:alias=[store])
           HiveProject($f0=[$0])
             HiveAggregate(group=[{}], agg#0=[count()])
-              HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                   HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                     HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                       HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                         HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                    HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                    HiveProject(hd_demo_sk=[$0])
                       HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 5), 
OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                         HiveTableScan(table=[[default, 
household_demographics]], table:alias=[household_demographics])
-                  HiveProject(t_time_sk=[$0], t_hour=[CAST(10):INTEGER], 
t_minute=[$4])
+                  HiveProject(t_time_sk=[$0])
                     HiveFilter(condition=[AND(=($3, 10), >=($4, 30), IS NOT 
NULL($0))])
                       HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-                HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+                HiveProject(s_store_sk=[$0])
                   HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT 
NULL($0))])
                     HiveTableScan(table=[[default, store]], 
table:alias=[store])
         HiveProject($f0=[$0])
           HiveAggregate(group=[{}], agg#0=[count()])
-            HiveJoin(condition=[=($2, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-              HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+            HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                   HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                     HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT 
NULL($1), IS NOT NULL($7))])
                       HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                  HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                  HiveProject(hd_demo_sk=[$0])
                     HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 5), 
OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                       HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
-                HiveProject(t_time_sk=[$0], t_hour=[CAST(10):INTEGER], 
t_minute=[$4])
+                HiveProject(t_time_sk=[$0])
                   HiveFilter(condition=[AND(=($3, 10), <($4, 30), IS NOT 
NULL($0))])
                     HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-              HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+              HiveProject(s_store_sk=[$0])
                 HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, store]], table:alias=[store])
       HiveProject($f0=[$0])
         HiveAggregate(group=[{}], agg#0=[count()])
-          HiveJoin(condition=[=($2, $9)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
+          HiveJoin(condition=[=($2, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                   HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT NULL($1), 
IS NOT NULL($7))])
                     HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+                HiveProject(hd_demo_sk=[$0])
                   HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 5), 
OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                     HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
-              HiveProject(t_time_sk=[$0], t_hour=[CAST(9):INTEGER], 
t_minute=[$4])
+              HiveProject(t_time_sk=[$0])
                 HiveFilter(condition=[AND(=($3, 9), >=($4, 30), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-            HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+            HiveProject(s_store_sk=[$0])
               HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT 
NULL($0))])
                 HiveTableScan(table=[[default, store]], table:alias=[store])
     HiveProject($f0=[$0])
       HiveAggregate(group=[{}], agg#0=[count()])
-        HiveJoin(condition=[=($2, $9)], joinType=[inner], algorithm=[none], 
cost=[not available])
-          HiveJoin(condition=[=($0, $6)], joinType=[inner], algorithm=[none], 
cost=[not available])
+        HiveJoin(condition=[=($2, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+          HiveJoin(condition=[=($0, $4)], joinType=[inner], algorithm=[none], 
cost=[not available])
             HiveJoin(condition=[=($1, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                 HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT NULL($1), IS 
NOT NULL($7))])
                   HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-              HiveProject(hd_demo_sk=[$0], hd_dep_count=[$3], 
hd_vehicle_count=[$4])
+              HiveProject(hd_demo_sk=[$0])
                 HiveFilter(condition=[AND(IN($3, 3, 0, 1), <=($4, 5), 
OR(AND(=($3, 3), IS NOT NULL($4)), AND(=($3, 0), <=($4, 2)), AND(=($3, 1), 
<=($4, 3))), IS NOT NULL($0))])
                   HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
-            HiveProject(t_time_sk=[$0], t_hour=[CAST(9):INTEGER], 
t_minute=[$4])
+            HiveProject(t_time_sk=[$0])
               HiveFilter(condition=[AND(=($3, 9), <($4, 30), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-          HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+          HiveProject(s_store_sk=[$0])
             HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT NULL($0))])
               HiveTableScan(table=[[default, store]], table:alias=[store])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query89.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query89.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query89.q.out
index 72f22b6..7cfb3ec 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query89.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query89.q.out
@@ -69,8 +69,8 @@ HiveProject(i_category=[$0], i_class=[$1], i_brand=[$2], 
s_store_name=[$3], s_co
       HiveFilter(condition=[CASE(<>($7, 0), >(/(ABS(-($6, $7)), $7), 0.1), 
null)])
         HiveProject((tok_table_or_col i_category)=[$2], (tok_table_or_col 
i_class)=[$1], (tok_table_or_col i_brand)=[$0], (tok_table_or_col 
s_store_name)=[$4], (tok_table_or_col s_company_name)=[$5], (tok_table_or_col 
d_moy)=[$3], (tok_function sum (tok_table_or_col ss_sales_price))=[$6], 
avg_window_0=[avg($6) OVER (PARTITION BY $2, $0, $4, $5 ORDER BY $2 NULLS 
FIRST, $0 NULLS FIRST, $4 NULLS FIRST, $5 NULLS FIRST ROWS BETWEEN 2147483647 
FOLLOWING AND 2147483647 PRECEDING)])
           HiveProject(i_brand=[$0], i_class=[$1], i_category=[$2], d_moy=[$3], 
s_store_name=[$4], s_company_name=[$5], $f6=[$6])
-            HiveAggregate(group=[{5, 6, 7, 10, 12, 13}], agg#0=[sum($3)])
-              HiveJoin(condition=[=($2, $11)], joinType=[inner], 
algorithm=[none], cost=[not available])
+            HiveAggregate(group=[{5, 6, 7, 9, 11, 12}], agg#0=[sum($3)])
+              HiveJoin(condition=[=($2, $10)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveJoin(condition=[=($0, $8)], joinType=[inner], 
algorithm=[none], cost=[not available])
                   HiveJoin(condition=[=($1, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                     HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], 
ss_store_sk=[$7], ss_sales_price=[$13])
@@ -79,7 +79,7 @@ HiveProject(i_category=[$0], i_class=[$1], i_brand=[$2], 
s_store_name=[$3], s_co
                     HiveProject(i_item_sk=[$0], i_brand=[$8], i_class=[$10], 
i_category=[$12])
                       HiveFilter(condition=[AND(IN($10, _UTF-16LE'wallpaper', 
_UTF-16LE'parenting', _UTF-16LE'musical', _UTF-16LE'womens', _UTF-16LE'birdal', 
_UTF-16LE'pants'), IN($12, _UTF-16LE'Home', _UTF-16LE'Books', 
_UTF-16LE'Electronics', _UTF-16LE'Shoes', _UTF-16LE'Jewelry', _UTF-16LE'Men'), 
OR(AND(IN($12, _UTF-16LE'Home', _UTF-16LE'Books', _UTF-16LE'Electronics'), 
IN($10, _UTF-16LE'wallpaper', _UTF-16LE'parenting', _UTF-16LE'musical')), 
AND(IN($12, _UTF-16LE'Shoes', _UTF-16LE'Jewelry', _UTF-16LE'Men'), IN($10, 
_UTF-16LE'womens', _UTF-16LE'birdal', _UTF-16LE'pants'))), IS NOT NULL($0))])
                         HiveTableScan(table=[[default, item]], 
table:alias=[item])
-                  HiveProject(d_date_sk=[$0], d_year=[CAST(2000):INTEGER], 
d_moy=[$8])
+                  HiveProject(d_date_sk=[$0], d_moy=[$8])
                     HiveFilter(condition=[AND(=($6, 2000), IS NOT NULL($0))])
                       HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
                 HiveProject(s_store_sk=[$0], s_store_name=[$5], 
s_company_name=[$17])

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query9.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query9.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query9.q.out
index 3ec1916..3a1e199 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query9.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query9.q.out
@@ -118,7 +118,7 @@ POSTHOOK: Input: default@reason
 POSTHOOK: Input: default@store_sales
 POSTHOOK: Output: hdfs://### HDFS PATH ###
 CBO PLAN:
-HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], bucket2=[CASE(>($4, 
4595804), $5, $6)], bucket3=[CASE(>($7, 7887297), $8, $9)], 
bucket4=[CASE(>($10, 10872978), $11, $12)], bucket5=[CASE(>($13, 43571537), 
$14, $15)])
+HiveProject(bucket1=[CASE($1, $2, $3)], bucket2=[CASE($4, $5, $6)], 
bucket3=[CASE($7, $8, $9)], bucket4=[CASE($10, $11, $12)], bucket5=[CASE($13, 
$14, $15)])
   HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not 
available])
     HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not 
available])
       HiveJoin(condition=[true], joinType=[left], algorithm=[none], cost=[not 
available])
@@ -137,7 +137,7 @@ HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], 
bucket2=[CASE(>($4, 4595804),
                                 HiveProject(r_reason_sk=[CAST(1):INTEGER])
                                   HiveFilter(condition=[=($0, 1)])
                                     HiveTableScan(table=[[default, reason]], 
table:alias=[reason])
-                                HiveProject($f0=[$0])
+                                HiveProject(>=[>($0, 409437)])
                                   HiveAggregate(group=[{}], agg#0=[count()])
                                     HiveFilter(condition=[BETWEEN(false, $10, 
1, 20)])
                                       HiveTableScan(table=[[default, 
store_sales]], table:alias=[store_sales])
@@ -149,7 +149,7 @@ HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], 
bucket2=[CASE(>($4, 4595804),
                               HiveAggregate(group=[{}], agg#0=[sum($21)], 
agg#1=[count($21)])
                                 HiveFilter(condition=[BETWEEN(false, $10, 1, 
20)])
                                   HiveTableScan(table=[[default, 
store_sales]], table:alias=[store_sales])
-                          HiveProject($f0=[$0])
+                          HiveProject(>=[>($0, 4595804)])
                             HiveAggregate(group=[{}], agg#0=[count()])
                               HiveFilter(condition=[BETWEEN(false, $10, 21, 
40)])
                                 HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
@@ -161,7 +161,7 @@ HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], 
bucket2=[CASE(>($4, 4595804),
                         HiveAggregate(group=[{}], agg#0=[sum($21)], 
agg#1=[count($21)])
                           HiveFilter(condition=[BETWEEN(false, $10, 21, 40)])
                             HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                    HiveProject($f0=[$0])
+                    HiveProject(>=[>($0, 7887297)])
                       HiveAggregate(group=[{}], agg#0=[count()])
                         HiveFilter(condition=[BETWEEN(false, $10, 41, 60)])
                           HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
@@ -173,7 +173,7 @@ HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], 
bucket2=[CASE(>($4, 4595804),
                   HiveAggregate(group=[{}], agg#0=[sum($21)], 
agg#1=[count($21)])
                     HiveFilter(condition=[BETWEEN(false, $10, 41, 60)])
                       HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-              HiveProject($f0=[$0])
+              HiveProject(>=[>($0, 10872978)])
                 HiveAggregate(group=[{}], agg#0=[count()])
                   HiveFilter(condition=[BETWEEN(false, $10, 61, 80)])
                     HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
@@ -185,7 +185,7 @@ HiveProject(bucket1=[CASE(>($1, 409437), $2, $3)], 
bucket2=[CASE(>($4, 4595804),
             HiveAggregate(group=[{}], agg#0=[sum($21)], agg#1=[count($21)])
               HiveFilter(condition=[BETWEEN(false, $10, 61, 80)])
                 HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-        HiveProject($f0=[$0])
+        HiveProject(>=[>($0, 43571537)])
           HiveAggregate(group=[{}], agg#0=[count()])
             HiveFilter(condition=[BETWEEN(false, $10, 81, 100)])
               HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query90.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query90.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query90.q.out
index c1567c7..123b3c2 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query90.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query90.q.out
@@ -57,36 +57,36 @@ HiveSortLimit(sort0=[$0], dir0=[ASC], fetch=[100])
     HiveJoin(condition=[true], joinType=[inner], algorithm=[none], cost=[not 
available])
       HiveProject($f0=[$0])
         HiveAggregate(group=[{}], agg#0=[count()])
-          HiveJoin(condition=[=($1, $7)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveJoin(condition=[=($0, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+          HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveJoin(condition=[=($2, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveProject(ws_sold_time_sk=[$1], ws_ship_hdemo_sk=[$10], 
ws_web_page_sk=[$12])
                   HiveFilter(condition=[AND(IS NOT NULL($10), IS NOT NULL($1), 
IS NOT NULL($12))])
                     HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
-                HiveProject(wp_web_page_sk=[$0], wp_char_count=[$10])
+                HiveProject(wp_web_page_sk=[$0])
                   HiveFilter(condition=[AND(BETWEEN(false, $10, 5000, 5200), 
IS NOT NULL($0))])
                     HiveTableScan(table=[[default, web_page]], 
table:alias=[web_page])
-              HiveProject(t_time_sk=[$0], t_hour=[$3])
+              HiveProject(t_time_sk=[$0])
                 HiveFilter(condition=[AND(BETWEEN(false, $3, 6, 7), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-            HiveProject(hd_demo_sk=[$0], hd_dep_count=[CAST(8):INTEGER])
+            HiveProject(hd_demo_sk=[$0])
               HiveFilter(condition=[AND(=($3, 8), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
       HiveProject($f0=[$0])
         HiveAggregate(group=[{}], agg#0=[count()])
-          HiveJoin(condition=[=($1, $7)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveJoin(condition=[=($0, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
+          HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveJoin(condition=[=($2, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveProject(ws_sold_time_sk=[$1], ws_ship_hdemo_sk=[$10], 
ws_web_page_sk=[$12])
                   HiveFilter(condition=[AND(IS NOT NULL($10), IS NOT NULL($1), 
IS NOT NULL($12))])
                     HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
-                HiveProject(wp_web_page_sk=[$0], wp_char_count=[$10])
+                HiveProject(wp_web_page_sk=[$0])
                   HiveFilter(condition=[AND(BETWEEN(false, $10, 5000, 5200), 
IS NOT NULL($0))])
                     HiveTableScan(table=[[default, web_page]], 
table:alias=[web_page])
-              HiveProject(t_time_sk=[$0], t_hour=[$3])
+              HiveProject(t_time_sk=[$0])
                 HiveFilter(condition=[AND(BETWEEN(false, $3, 14, 15), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-            HiveProject(hd_demo_sk=[$0], hd_dep_count=[CAST(8):INTEGER])
+            HiveProject(hd_demo_sk=[$0])
               HiveFilter(condition=[AND(=($3, 8), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query91.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query91.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query91.q.out
index 6b58ccc..e6fe23f 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query91.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query91.q.out
@@ -78,11 +78,11 @@ CBO PLAN:
 HiveProject(call_center=[$0], call_center_name=[$1], manager=[$2], 
returns_loss=[$3])
   HiveSortLimit(sort0=[$4], dir0=[DESC-nulls-last])
     HiveProject(call_center=[$2], call_center_name=[$3], manager=[$4], 
returns_loss=[$5], (tok_function sum (tok_table_or_col cr_net_loss))=[$5])
-      HiveAggregate(group=[{7, 8, 17, 18, 19}], agg#0=[sum($12)])
-        HiveJoin(condition=[=($20, $4)], joinType=[inner], algorithm=[none], 
cost=[not available])
-          HiveJoin(condition=[=($10, $2)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveJoin(condition=[=($0, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
-              HiveProject(ca_address_sk=[$0], 
ca_gmt_offset=[CAST(-7):DECIMAL(5, 2)])
+      HiveAggregate(group=[{6, 7, 14, 15, 16}], agg#0=[sum($11)])
+        HiveJoin(condition=[=($17, $3)], joinType=[inner], algorithm=[none], 
cost=[not available])
+          HiveJoin(condition=[=($9, $1)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveProject(ca_address_sk=[$0])
                 HiveFilter(condition=[AND(=($11, -7), IS NOT NULL($0))])
                   HiveTableScan(table=[[default, customer_address]], 
table:alias=[customer_address])
               HiveJoin(condition=[=($4, $1)], joinType=[inner], 
algorithm=[none], cost=[not available])
@@ -92,19 +92,19 @@ HiveProject(call_center=[$0], call_center_name=[$1], 
manager=[$2], returns_loss=
                 HiveProject(cd_demo_sk=[$0], cd_marital_status=[$2], 
cd_education_status=[$3])
                   HiveFilter(condition=[AND(IN($3, _UTF-16LE'Unknown', 
_UTF-16LE'Advanced Degree'), IN($2, _UTF-16LE'M', _UTF-16LE'W'), IN(ROW($2, 
$3), ROW(_UTF-16LE'M', _UTF-16LE'Unknown'), ROW(_UTF-16LE'W', 
_UTF-16LE'Advanced Degree')), IS NOT NULL($0))])
                     HiveTableScan(table=[[default, customer_demographics]], 
table:alias=[customer_demographics])
-            HiveProject(cr_returned_date_sk=[$0], 
cr_returning_customer_sk=[$1], cr_call_center_sk=[$2], cr_net_loss=[$3], 
d_date_sk=[$4], d_year=[$5], d_moy=[$6], cc_call_center_sk=[$7], 
cc_call_center_id=[$8], cc_name=[$9], cc_manager=[$10])
-              HiveJoin(condition=[=($2, $7)], joinType=[inner], 
algorithm=[none], cost=[not available])
+            HiveProject(cr_returned_date_sk=[$0], 
cr_returning_customer_sk=[$1], cr_call_center_sk=[$2], cr_net_loss=[$3], 
d_date_sk=[$4], cc_call_center_sk=[$5], cc_call_center_id=[$6], cc_name=[$7], 
cc_manager=[$8])
+              HiveJoin(condition=[=($2, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
                 HiveJoin(condition=[=($0, $4)], joinType=[inner], 
algorithm=[none], cost=[not available])
                   HiveProject(cr_returned_date_sk=[$0], 
cr_returning_customer_sk=[$7], cr_call_center_sk=[$11], cr_net_loss=[$26])
                     HiveFilter(condition=[AND(IS NOT NULL($11), IS NOT 
NULL($0), IS NOT NULL($7))])
                       HiveTableScan(table=[[default, catalog_returns]], 
table:alias=[catalog_returns])
-                  HiveProject(d_date_sk=[$0], d_year=[CAST(1999):INTEGER], 
d_moy=[CAST(11):INTEGER])
+                  HiveProject(d_date_sk=[$0])
                     HiveFilter(condition=[AND(=($6, 1999), =($8, 11), IS NOT 
NULL($0))])
                       HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
                 HiveProject(cc_call_center_sk=[$0], cc_call_center_id=[$1], 
cc_name=[$6], cc_manager=[$11])
                   HiveFilter(condition=[IS NOT NULL($0)])
                     HiveTableScan(table=[[default, call_center]], 
table:alias=[call_center])
-          HiveProject(hd_demo_sk=[$0], hd_buy_potential=[$2])
+          HiveProject(hd_demo_sk=[$0])
             HiveFilter(condition=[AND(LIKE($2, _UTF-16LE'0-500%'), IS NOT 
NULL($0))])
               HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query92.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query92.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query92.q.out
index 5a0e1da..2a21fba 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query92.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query92.q.out
@@ -69,26 +69,26 @@ HiveProject(excess discount amount=[$0])
   HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[100])
     HiveProject(excess discount amount=[$0], (tok_function sum 
(tok_table_or_col ws_ext_discount_amt))=[$0])
       HiveAggregate(group=[{}], agg#0=[sum($2)])
-        HiveJoin(condition=[AND(>($2, CAST(*(1.3, $6)):DECIMAL(14, 7)), =($7, 
$1))], joinType=[inner], algorithm=[none], cost=[not available])
+        HiveJoin(condition=[AND(>($2, $5), =($6, $1))], joinType=[inner], 
algorithm=[none], cost=[not available])
           HiveJoin(condition=[=($3, $0)], joinType=[inner], algorithm=[none], 
cost=[not available])
             HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], 
ws_ext_discount_amt=[$22])
               HiveFilter(condition=[AND(IS NOT NULL($3), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
-            HiveProject(d_date_sk=[$0], d_date=[$2])
+            HiveProject(d_date_sk=[$0])
               HiveFilter(condition=[AND(BETWEEN(false, CAST($2):TIMESTAMP(9), 
1998-03-18 00:00:00, 1998-06-16 00:00:00), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
-          HiveProject(ws_item_sk=[$0], $f1=[$1], i_item_sk=[$2], 
i_manufact_id=[$3])
+          HiveProject(ws_item_sk=[$0], CAST=[$1], i_item_sk=[$2])
             HiveJoin(condition=[=($0, $2)], joinType=[inner], 
algorithm=[none], cost=[not available])
-              HiveProject(ws_item_sk=[$0], $f1=[/($1, $2)])
+              HiveProject(ws_item_sk=[$0], CAST=[CAST(*(1.3, /($1, 
$2))):DECIMAL(14, 7)])
                 HiveAggregate(group=[{1}], agg#0=[sum($2)], agg#1=[count($2)])
                   HiveJoin(condition=[=($3, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
                     HiveProject(ws_sold_date_sk=[$0], ws_item_sk=[$3], 
ws_ext_discount_amt=[$22])
                       HiveFilter(condition=[AND(IS NOT NULL($3), IS NOT 
NULL($0))])
                         HiveTableScan(table=[[default, web_sales]], 
table:alias=[web_sales])
-                    HiveProject(d_date_sk=[$0], d_date=[$2])
+                    HiveProject(d_date_sk=[$0])
                       HiveFilter(condition=[AND(BETWEEN(false, 
CAST($2):TIMESTAMP(9), 1998-03-18 00:00:00, 1998-06-16 00:00:00), IS NOT 
NULL($0))])
                         HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
-              HiveProject(i_item_sk=[$0], i_manufact_id=[CAST(269):INTEGER])
+              HiveProject(i_item_sk=[$0])
                 HiveFilter(condition=[AND(=($13, 269), IS NOT NULL($0))])
                   HiveTableScan(table=[[default, item]], table:alias=[item])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query93.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query93.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query93.q.out
index 60b7557..6a8ed39 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query93.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query93.q.out
@@ -44,16 +44,16 @@ CBO PLAN:
 HiveSortLimit(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[ASC], fetch=[100])
   HiveProject(ss_customer_sk=[$0], $f1=[$1])
     HiveAggregate(group=[{0}], agg#0=[sum($1)])
-      HiveProject(ss_customer_sk=[$1], act_sales=[CASE(IS NOT NULL($8), 
*(CAST(-($3, $8)):DECIMAL(10, 0), $4), *(CAST($3):DECIMAL(10, 0), $4))])
-        HiveJoin(condition=[AND(=($5, $0), =($7, $2))], joinType=[inner], 
algorithm=[none], cost=[not available])
-          HiveProject(ss_item_sk=[$2], ss_customer_sk=[$3], 
ss_ticket_number=[$9], ss_quantity=[$10], ss_sales_price=[$13])
+      HiveProject(ss_customer_sk=[$1], act_sales=[CASE($10, *(CAST(-($3, 
$9)):DECIMAL(10, 0), $4), $5)])
+        HiveJoin(condition=[AND(=($6, $0), =($8, $2))], joinType=[inner], 
algorithm=[none], cost=[not available])
+          HiveProject(ss_item_sk=[$2], ss_customer_sk=[$3], 
ss_ticket_number=[$9], ss_quantity=[$10], ss_sales_price=[$13], 
*=[*(CAST($10):DECIMAL(10, 0), $13)])
             HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($9))])
               HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-          HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveProject(sr_item_sk=[$2], sr_reason_sk=[$8], 
sr_ticket_number=[$9], sr_return_quantity=[$10])
+          HiveJoin(condition=[=($1, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveProject(sr_item_sk=[$2], sr_reason_sk=[$8], 
sr_ticket_number=[$9], sr_return_quantity=[$10], IS NOT NULL=[IS NOT NULL($10)])
               HiveFilter(condition=[AND(IS NOT NULL($8), IS NOT NULL($2), IS 
NOT NULL($9))])
                 HiveTableScan(table=[[default, store_returns]], 
table:alias=[store_returns])
-            HiveProject(r_reason_sk=[$0], r_reason_desc=[CAST(_UTF-16LE'Did 
not like the warranty'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" COLLATE 
"ISO-8859-1$en_US$primary"])
+            HiveProject(r_reason_sk=[$0])
               HiveFilter(condition=[AND(=($2, _UTF-16LE'Did not like the 
warranty'), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, reason]], table:alias=[reason])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query95.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query95.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query95.q.out
index c248890..6a20165 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query95.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query95.q.out
@@ -76,8 +76,8 @@ CBO PLAN:
 HiveProject(order count=[$0], total shipping cost=[$1], total net profit=[$2])
   HiveSortLimit(sort0=[$3], dir0=[ASC], fetch=[100])
     HiveProject(order count=[$0], total shipping cost=[$1], total net 
profit=[$2], (tok_functiondi count (tok_table_or_col ws_order_number))=[$0])
-      HiveAggregate(group=[{}], agg#0=[count(DISTINCT $7)], agg#1=[sum($8)], 
agg#2=[sum($9)])
-        HiveJoin(condition=[=($7, $0)], joinType=[inner], algorithm=[none], 
cost=[not available])
+      HiveAggregate(group=[{}], agg#0=[count(DISTINCT $6)], agg#1=[sum($7)], 
agg#2=[sum($8)])
+        HiveJoin(condition=[=($6, $0)], joinType=[inner], algorithm=[none], 
cost=[not available])
           HiveProject(wr_order_number=[$0])
             HiveAggregate(group=[{14}])
               HiveJoin(condition=[=($14, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
@@ -92,7 +92,7 @@ HiveProject(order count=[$0], total shipping cost=[$1], total 
net profit=[$2])
                 HiveProject(wr_returned_date_sk=[$0], 
wr_returned_time_sk=[$1], wr_item_sk=[$2], wr_refunded_customer_sk=[$3], 
wr_refunded_cdemo_sk=[$4], wr_refunded_hdemo_sk=[$5], wr_refunded_addr_sk=[$6], 
wr_returning_customer_sk=[$7], wr_returning_cdemo_sk=[$8], 
wr_returning_hdemo_sk=[$9], wr_returning_addr_sk=[$10], wr_web_page_sk=[$11], 
wr_reason_sk=[$12], wr_order_number=[$13], wr_return_quantity=[$14], 
wr_return_amt=[$15], wr_return_tax=[$16], wr_return_amt_inc_tax=[$17], 
wr_fee=[$18], wr_return_ship_cost=[$19], wr_refunded_cash=[$20], 
wr_reversed_charge=[$21], wr_account_credit=[$22], wr_net_loss=[$23], 
BLOCK__OFFSET__INSIDE__FILE=[$24], INPUT__FILE__NAME=[$25], ROW__ID=[$26])
                   HiveFilter(condition=[IS NOT NULL($13)])
                     HiveTableScan(table=[[default, web_returns]], 
table:alias=[web_returns])
-          HiveJoin(condition=[=($6, $0)], joinType=[inner], algorithm=[none], 
cost=[not available])
+          HiveJoin(condition=[=($5, $0)], joinType=[inner], algorithm=[none], 
cost=[not available])
             HiveProject(ws_order_number=[$0])
               HiveAggregate(group=[{1}])
                 HiveJoin(condition=[AND(=($1, $3), <>($0, $2))], 
joinType=[inner], algorithm=[none], cost=[not available])
@@ -102,9 +102,9 @@ HiveProject(order count=[$0], total shipping cost=[$1], 
total net profit=[$2])
                   HiveProject(ws_warehouse_sk=[$15], ws_order_number=[$17])
                     HiveFilter(condition=[IS NOT NULL($17)])
                       HiveTableScan(table=[[default, web_sales]], 
table:alias=[ws2])
-            HiveJoin(condition=[=($4, $10)], joinType=[inner], 
algorithm=[none], cost=[not available])
-              HiveJoin(condition=[=($3, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                HiveProject(ca_address_sk=[$0], 
ca_state=[CAST(_UTF-16LE'TX'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+            HiveJoin(condition=[=($3, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveJoin(condition=[=($2, $0)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                HiveProject(ca_address_sk=[$0])
                   HiveFilter(condition=[AND(=($8, _UTF-16LE'TX'), IS NOT 
NULL($0))])
                     HiveTableScan(table=[[default, customer_address]], 
table:alias=[customer_address])
                 HiveJoin(condition=[=($0, $6)], joinType=[inner], 
algorithm=[none], cost=[not available])
@@ -114,7 +114,7 @@ HiveProject(order count=[$0], total shipping cost=[$1], 
total net profit=[$2])
                   HiveProject(d_date_sk=[$0], d_date=[$2])
                     HiveFilter(condition=[AND(BETWEEN(false, 
CAST($2):TIMESTAMP(9), 1999-05-01 00:00:00, 1999-06-30 00:00:00), IS NOT 
NULL($0))])
                       HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
-              HiveProject(web_site_sk=[$0], 
web_company_name=[CAST(_UTF-16LE'pri'):VARCHAR(2147483647) CHARACTER SET 
"UTF-16LE" COLLATE "ISO-8859-1$en_US$primary"])
+              HiveProject(web_site_sk=[$0])
                 HiveFilter(condition=[AND(=($14, _UTF-16LE'pri'), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, web_site]], 
table:alias=[web_site])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query96.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query96.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query96.q.out
index 6367e98..ca9a51f 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query96.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query96.q.out
@@ -43,19 +43,19 @@ HiveProject(_o__c0=[$0])
   HiveSortLimit(sort0=[$1], dir0=[ASC], fetch=[100])
     HiveProject(_o__c0=[$0], (tok_functionstar count)=[$0])
       HiveAggregate(group=[{}], agg#0=[count()])
-        HiveJoin(condition=[=($2, $8)], joinType=[inner], algorithm=[none], 
cost=[not available])
-          HiveJoin(condition=[=($1, $6)], joinType=[inner], algorithm=[none], 
cost=[not available])
+        HiveJoin(condition=[=($2, $5)], joinType=[inner], algorithm=[none], 
cost=[not available])
+          HiveJoin(condition=[=($1, $4)], joinType=[inner], algorithm=[none], 
cost=[not available])
             HiveJoin(condition=[=($0, $3)], joinType=[inner], 
algorithm=[none], cost=[not available])
               HiveProject(ss_sold_time_sk=[$1], ss_hdemo_sk=[$5], 
ss_store_sk=[$7])
                 HiveFilter(condition=[AND(IS NOT NULL($5), IS NOT NULL($1), IS 
NOT NULL($7))])
                   HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-              HiveProject(t_time_sk=[$0], t_hour=[CAST(8):INTEGER], 
t_minute=[$4])
+              HiveProject(t_time_sk=[$0])
                 HiveFilter(condition=[AND(=($3, 8), >=($4, 30), IS NOT 
NULL($0))])
                   HiveTableScan(table=[[default, time_dim]], 
table:alias=[time_dim])
-            HiveProject(hd_demo_sk=[$0], hd_dep_count=[CAST(5):INTEGER])
+            HiveProject(hd_demo_sk=[$0])
               HiveFilter(condition=[AND(=($3, 5), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, household_demographics]], 
table:alias=[household_demographics])
-          HiveProject(s_store_sk=[$0], 
s_store_name=[CAST(_UTF-16LE'ese'):VARCHAR(2147483647) CHARACTER SET "UTF-16LE" 
COLLATE "ISO-8859-1$en_US$primary"])
+          HiveProject(s_store_sk=[$0])
             HiveFilter(condition=[AND(=($5, _UTF-16LE'ese'), IS NOT NULL($0))])
               HiveTableScan(table=[[default, store]], table:alias=[store])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query97.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query97.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query97.q.out
index 5cd8582..f79dffb 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query97.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query97.q.out
@@ -66,7 +66,7 @@ HiveSortLimit(fetch=[100])
                 HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], 
ss_customer_sk=[$3])
                   HiveFilter(condition=[IS NOT NULL($0)])
                     HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-                HiveProject(d_date_sk=[$0], d_month_seq=[$3])
+                HiveProject(d_date_sk=[$0])
                   HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), IS 
NOT NULL($0))])
                     HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
           HiveProject(cs_bill_customer_sk=[$0], cs_item_sk=[$1])
@@ -75,7 +75,7 @@ HiveSortLimit(fetch=[100])
                 HiveProject(cs_sold_date_sk=[$0], cs_bill_customer_sk=[$3], 
cs_item_sk=[$15])
                   HiveFilter(condition=[IS NOT NULL($0)])
                     HiveTableScan(table=[[default, catalog_sales]], 
table:alias=[catalog_sales])
-                HiveProject(d_date_sk=[$0], d_month_seq=[$3])
+                HiveProject(d_date_sk=[$0])
                   HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), IS 
NOT NULL($0))])
                     HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query98.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query98.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query98.q.out
index 804885c..374a6a0 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query98.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query98.q.out
@@ -81,7 +81,7 @@ HiveProject(i_item_desc=[$0], i_category=[$1], i_class=[$2], 
i_current_price=[$3
             HiveProject(ss_sold_date_sk=[$0], ss_item_sk=[$2], 
ss_ext_sales_price=[$15])
               HiveFilter(condition=[AND(IS NOT NULL($2), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, store_sales]], 
table:alias=[store_sales])
-            HiveProject(d_date_sk=[$0], d_date=[$2])
+            HiveProject(d_date_sk=[$0])
               HiveFilter(condition=[AND(BETWEEN(false, CAST($2):TIMESTAMP(9), 
2001-01-12 00:00:00, 2001-02-11 00:00:00), IS NOT NULL($0))])
                 HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/cbo_query99.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/cbo_query99.q.out 
b/ql/src/test/results/clientpositive/perf/tez/cbo_query99.q.out
index 75d0e60..8ca409d 100644
--- a/ql/src/test/results/clientpositive/perf/tez/cbo_query99.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/cbo_query99.q.out
@@ -81,26 +81,25 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 CBO PLAN:
 HiveProject(_o__c0=[$0], sm_type=[$1], cc_name=[$2], 30 days=[$3], 31-60 
days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7])
   HiveSortLimit(sort0=[$8], sort1=[$1], sort2=[$2], dir0=[ASC], dir1=[ASC], 
dir2=[ASC], fetch=[100])
-    HiveProject(_o__c0=[$0], sm_type=[$1], cc_name=[$2], 30 days=[$3], 31-60 
days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7], (tok_function 
substr (tok_table_or_col w_warehouse_name) 1 20)=[$0])
-      HiveAggregate(group=[{0, 1, 2}], agg#0=[sum($3)], agg#1=[sum($4)], 
agg#2=[sum($5)], agg#3=[sum($6)], agg#4=[sum($7)])
-        HiveProject($f0=[substr($10, 1, 20)], $f1=[$12], $f2=[$8], 
$f3=[CASE(<=(-($1, $0), 30), 1, 0)], $f4=[CASE(AND(>(-($1, $0), 30), <=(-($1, 
$0), 60)), 1, 0)], $f5=[CASE(AND(>(-($1, $0), 60), <=(-($1, $0), 90)), 1, 0)], 
$f6=[CASE(AND(>(-($1, $0), 90), <=(-($1, $0), 120)), 1, 0)], $f7=[CASE(>(-($1, 
$0), 120), 1, 0)])
-          HiveJoin(condition=[=($3, $11)], joinType=[inner], algorithm=[none], 
cost=[not available])
-            HiveJoin(condition=[=($4, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
-              HiveJoin(condition=[=($2, $7)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                HiveJoin(condition=[=($1, $5)], joinType=[inner], 
algorithm=[none], cost=[not available])
-                  HiveProject(cs_sold_date_sk=[$0], cs_ship_date_sk=[$2], 
cs_call_center_sk=[$11], cs_ship_mode_sk=[$13], cs_warehouse_sk=[$14])
-                    HiveFilter(condition=[AND(IS NOT NULL($14), IS NOT 
NULL($13), IS NOT NULL($11), IS NOT NULL($2))])
-                      HiveTableScan(table=[[default, catalog_sales]], 
table:alias=[catalog_sales])
-                  HiveProject(d_date_sk=[$0], d_month_seq=[$3])
-                    HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), 
IS NOT NULL($0))])
-                      HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
-                HiveProject(cc_call_center_sk=[$0], cc_name=[$6])
-                  HiveFilter(condition=[IS NOT NULL($0)])
-                    HiveTableScan(table=[[default, call_center]], 
table:alias=[call_center])
-              HiveProject(w_warehouse_sk=[$0], w_warehouse_name=[$2])
+    HiveProject(_o__c0=[$1], sm_type=[$2], cc_name=[$0], 30 days=[$3], 31-60 
days=[$4], 61-90 days=[$5], 91-120 days=[$6], >120 days=[$7], (tok_function 
substr (tok_table_or_col w_warehouse_name) 1 20)=[$1])
+      HiveAggregate(group=[{11, 13, 15}], agg#0=[sum($4)], agg#1=[sum($5)], 
agg#2=[sum($6)], agg#3=[sum($7)], agg#4=[sum($8)])
+        HiveJoin(condition=[=($2, $14)], joinType=[inner], algorithm=[none], 
cost=[not available])
+          HiveJoin(condition=[=($3, $12)], joinType=[inner], algorithm=[none], 
cost=[not available])
+            HiveJoin(condition=[=($1, $10)], joinType=[inner], 
algorithm=[none], cost=[not available])
+              HiveJoin(condition=[=($0, $9)], joinType=[inner], 
algorithm=[none], cost=[not available])
+                HiveProject(cs_ship_date_sk=[$2], cs_call_center_sk=[$11], 
cs_ship_mode_sk=[$13], cs_warehouse_sk=[$14], CASE=[CASE(<=(-($2, $0), 30), 1, 
0)], CASE5=[CASE(AND(>(-($2, $0), 30), <=(-($2, $0), 60)), 1, 0)], 
CASE6=[CASE(AND(>(-($2, $0), 60), <=(-($2, $0), 90)), 1, 0)], 
CASE7=[CASE(AND(>(-($2, $0), 90), <=(-($2, $0), 120)), 1, 0)], 
CASE8=[CASE(>(-($2, $0), 120), 1, 0)])
+                  HiveFilter(condition=[AND(IS NOT NULL($14), IS NOT 
NULL($13), IS NOT NULL($11), IS NOT NULL($2))])
+                    HiveTableScan(table=[[default, catalog_sales]], 
table:alias=[catalog_sales])
+                HiveProject(d_date_sk=[$0])
+                  HiveFilter(condition=[AND(BETWEEN(false, $3, 1212, 1223), IS 
NOT NULL($0))])
+                    HiveTableScan(table=[[default, date_dim]], 
table:alias=[date_dim])
+              HiveProject(cc_call_center_sk=[$0], cc_name=[$6])
                 HiveFilter(condition=[IS NOT NULL($0)])
-                  HiveTableScan(table=[[default, warehouse]], 
table:alias=[warehouse])
-            HiveProject(sm_ship_mode_sk=[$0], sm_type=[$2])
+                  HiveTableScan(table=[[default, call_center]], 
table:alias=[call_center])
+            HiveProject(w_warehouse_sk=[$0], substr=[substr($2, 1, 20)])
               HiveFilter(condition=[IS NOT NULL($0)])
-                HiveTableScan(table=[[default, ship_mode]], 
table:alias=[ship_mode])
+                HiveTableScan(table=[[default, warehouse]], 
table:alias=[warehouse])
+          HiveProject(sm_ship_mode_sk=[$0], sm_type=[$2])
+            HiveFilter(condition=[IS NOT NULL($0)])
+              HiveTableScan(table=[[default, ship_mode]], 
table:alias=[ship_mode])
 

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/query1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query1.q.out 
b/ql/src/test/results/clientpositive/perf/tez/query1.q.out
index a3de5c6..5321336 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query1.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query1.q.out
@@ -83,14 +83,14 @@ Stage-0
               Select Operator [SEL_49] (rows=816091 width=100)
                 Output:["_col0"]
                 Filter Operator [FIL_48] (rows=816091 width=324)
-                  predicate:(_col2 > _col7)
+                  predicate:(_col2 > _col6)
                   Merge Join Operator [MERGEJOIN_134] (rows=2448274 width=324)
-                    
Conds:RS_45._col1=RS_158._col1(Inner),Output:["_col2","_col6","_col7"]
+                    
Conds:RS_45._col1=RS_158._col1(Inner),Output:["_col2","_col5","_col6"]
                   <-Reducer 5 [SIMPLE_EDGE]
                     SHUFFLE [RS_45]
                       PartitionCols:_col1
                       Merge Join Operator [MERGEJOIN_132] (rows=2369298 
width=213)
-                        
Conds:RS_42._col0=RS_153._col0(Inner),Output:["_col1","_col2","_col6"]
+                        
Conds:RS_42._col0=RS_153._col0(Inner),Output:["_col1","_col2","_col5"]
                       <-Map 12 [SIMPLE_EDGE] vectorized
                         SHUFFLE [RS_153]
                           PartitionCols:_col0
@@ -108,7 +108,7 @@ Stage-0
                           <-Map 11 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_150]
                               PartitionCols:_col0
-                              Select Operator [SEL_149] (rows=35 width=90)
+                              Select Operator [SEL_149] (rows=35 width=4)
                                 Output:["_col0"]
                                 Filter Operator [FIL_148] (rows=35 width=90)
                                   predicate:((s_state = 'NM') and s_store_sk 
is not null)
@@ -140,7 +140,7 @@ Stage-0
                                       <-Map 10 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_143]
                                           PartitionCols:_col0
-                                          Select Operator [SEL_142] (rows=652 
width=8)
+                                          Select Operator [SEL_142] (rows=652 
width=4)
                                             Output:["_col0"]
                                             Filter Operator [FIL_141] 
(rows=652 width=8)
                                               predicate:((d_year = 2000) and 
d_date_sk is not null)

http://git-wip-us.apache.org/repos/asf/hive/blob/55887646/ql/src/test/results/clientpositive/perf/tez/query10.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query10.q.out 
b/ql/src/test/results/clientpositive/perf/tez/query10.q.out
index b180cbd..4fc8123 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query10.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query10.q.out
@@ -243,7 +243,7 @@ Stage-0
                                             <-Map 16 [SIMPLE_EDGE] vectorized
                                               PARTITION_ONLY_SHUFFLE [RS_193]
                                                 PartitionCols:_col0
-                                                Select Operator [SEL_192] 
(rows=201 width=12)
+                                                Select Operator [SEL_192] 
(rows=201 width=4)
                                                   Output:["_col0"]
                                                   Filter Operator [FIL_191] 
(rows=201 width=12)
                                                     predicate:((d_year = 2002) 
and d_date_sk is not null and d_moy BETWEEN 4 AND 7)

Reply via email to