You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2018/10/13 18:16:09 UTC

[3/6] hive git commit: HIVE-20704: Extend HivePreFilteringRule to support other functions (Jesus Camacho Rodriguez, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query13.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query13.q.out b/ql/src/test/results/clientpositive/perf/tez/query13.q.out
index c33e50e..53edb5e 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query13.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query13.q.out
@@ -115,166 +115,156 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Reducer 11 (BROADCAST_EDGE), Reducer 13 (BROADCAST_EDGE), Reducer 15 (BROADCAST_EDGE), Reducer 17 (BROADCAST_EDGE), Reducer 9 (BROADCAST_EDGE)
+Map 9 <- Reducer 11 (BROADCAST_EDGE), Reducer 13 (BROADCAST_EDGE), Reducer 16 (BROADCAST_EDGE), Reducer 8 (BROADCAST_EDGE)
 Reducer 11 <- Map 10 (CUSTOM_SIMPLE_EDGE)
 Reducer 13 <- Map 12 (CUSTOM_SIMPLE_EDGE)
-Reducer 15 <- Map 14 (CUSTOM_SIMPLE_EDGE)
-Reducer 17 <- Map 16 (CUSTOM_SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
+Reducer 16 <- Map 15 (CUSTOM_SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
 Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
 Reducer 4 <- Map 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 Reducer 5 <- Map 14 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Map 16 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 6 <- Map 15 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
 Reducer 7 <- Reducer 6 (CUSTOM_SIMPLE_EDGE)
-Reducer 9 <- Map 8 (CUSTOM_SIMPLE_EDGE)
+Reducer 8 <- Map 1 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 7 vectorized
-      File Output Operator [FS_167]
-        Select Operator [SEL_166] (rows=1 width=256)
+      File Output Operator [FS_162]
+        Select Operator [SEL_161] (rows=1 width=256)
           Output:["_col0","_col1","_col2","_col3"]
-          Group By Operator [GBY_165] (rows=1 width=256)
+          Group By Operator [GBY_160] (rows=1 width=256)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)","count(VALUE._col1)","sum(VALUE._col2)","count(VALUE._col3)","sum(VALUE._col4)","count(VALUE._col5)"]
           <-Reducer 6 [CUSTOM_SIMPLE_EDGE]
             PARTITION_ONLY_SHUFFLE [RS_37]
               Group By Operator [GBY_36] (rows=1 width=256)
-                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col5)","count(_col5)","sum(_col7)","count(_col7)","sum(_col8)","count(_col8)"]
-                Merge Join Operator [MERGEJOIN_121] (rows=8066665 width=1014)
-                  Conds:RS_32._col4=RS_156._col0(Inner),Output:["_col5","_col7","_col8"]
-                <-Map 16 [SIMPLE_EDGE] vectorized
-                  SHUFFLE [RS_156]
-                    PartitionCols:_col0
-                    Select Operator [SEL_155] (rows=1704 width=1910)
-                      Output:["_col0"]
-                      Filter Operator [FIL_154] (rows=1704 width=1910)
-                        predicate:s_store_sk is not null
-                        TableScan [TS_15] (rows=1704 width=1910)
-                          default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk"]
-                <-Reducer 5 [SIMPLE_EDGE]
-                  SHUFFLE [RS_32]
-                    PartitionCols:_col4
-                    Filter Operator [FIL_31] (rows=7333332 width=1014)
-                      predicate:(((_col18) IN ('KY', 'GA', 'NM') and _col9 BETWEEN 100 AND 200) or ((_col18) IN ('MT', 'OR', 'IN') and _col9 BETWEEN 150 AND 300) or ((_col18) IN ('WI', 'MO', 'WV') and _col9 BETWEEN 50 AND 250))
-                      Merge Join Operator [MERGEJOIN_120] (rows=22000000 width=1014)
-                        Conds:RS_28._col3=RS_148._col0(Inner),Output:["_col4","_col5","_col7","_col8","_col9","_col18"]
-                      <-Map 14 [SIMPLE_EDGE] vectorized
-                        SHUFFLE [RS_148]
-                          PartitionCols:_col0
-                          Select Operator [SEL_147] (rows=20000000 width=1014)
-                            Output:["_col0","_col1"]
-                            Filter Operator [FIL_146] (rows=20000000 width=1014)
-                              predicate:((ca_country = 'United States') and ca_address_sk is not null)
-                              TableScan [TS_12] (rows=40000000 width=1014)
-                                default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_country"]
-                      <-Reducer 4 [SIMPLE_EDGE]
-                        SHUFFLE [RS_28]
-                          PartitionCols:_col3
-                          Filter Operator [FIL_27] (rows=10647918 width=88)
-                            predicate:(((_col13 = 'D') and (_col14 = 'Primary') and _col6 BETWEEN 50 AND 100 and (_col16 = 1)) or ((_col13 = 'M') and (_col14 = '4 yr Degree') and _col6 BETWEEN 100 AND 150 and (_col16 = 3)) or ((_col13 = 'U') and (_col14 = 'Advanced Degree') and _col6 BETWEEN 150 AND 200 and (_col16 = 1)))
-                            Merge Join Operator [MERGEJOIN_119] (rows=255550079 width=88)
-                              Conds:RS_24._col2=RS_140._col0(Inner),Output:["_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col13","_col14","_col16"]
-                            <-Map 12 [SIMPLE_EDGE] vectorized
-                              SHUFFLE [RS_140]
-                                PartitionCols:_col0
-                                Select Operator [SEL_139] (rows=7200 width=107)
-                                  Output:["_col0","_col1"]
-                                  Filter Operator [FIL_138] (rows=7200 width=107)
-                                    predicate:((hd_dep_count) IN (3, 1) and hd_demo_sk is not null)
-                                    TableScan [TS_9] (rows=7200 width=107)
-                                      default@household_demographics,household_demographics,Tbl:COMPLETE,Col:NONE,Output:["hd_demo_sk","hd_dep_count"]
-                            <-Reducer 3 [SIMPLE_EDGE]
-                              SHUFFLE [RS_24]
-                                PartitionCols:_col2
-                                Merge Join Operator [MERGEJOIN_118] (rows=232318249 width=88)
-                                  Conds:RS_21._col1=RS_132._col0(Inner),Output:["_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col13","_col14"]
-                                <-Map 10 [SIMPLE_EDGE] vectorized
-                                  SHUFFLE [RS_132]
-                                    PartitionCols:_col0
-                                    Select Operator [SEL_131] (rows=1861800 width=385)
-                                      Output:["_col0","_col1","_col2"]
-                                      Filter Operator [FIL_130] (rows=1861800 width=385)
-                                        predicate:((cd_education_status) IN ('4 yr Degree', 'Primary', 'Advanced Degree') and (cd_marital_status) IN ('M', 'D', 'U') and cd_demo_sk is not null)
-                                        TableScan [TS_6] (rows=1861800 width=385)
-                                          default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
-                                <-Reducer 2 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_21]
-                                    PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_117] (rows=211198404 width=88)
-                                      Conds:RS_164._col0=RS_124._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                                    <-Map 8 [SIMPLE_EDGE] vectorized
-                                      PARTITION_ONLY_SHUFFLE [RS_124]
-                                        PartitionCols:_col0
-                                        Select Operator [SEL_123] (rows=36524 width=1119)
-                                          Output:["_col0"]
-                                          Filter Operator [FIL_122] (rows=36524 width=1119)
-                                            predicate:((d_year = 2001) and d_date_sk is not null)
-                                            TableScan [TS_3] (rows=73049 width=1119)
-                                              default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                                    <-Map 1 [SIMPLE_EDGE] vectorized
-                                      SHUFFLE [RS_164]
-                                        PartitionCols:_col0
-                                        Select Operator [SEL_163] (rows=191998545 width=88)
-                                          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
-                                          Filter Operator [FIL_162] (rows=191998545 width=88)
-                                            predicate:((ss_addr_sk BETWEEN DynamicValue(RS_29_customer_address_ca_address_sk_min) AND DynamicValue(RS_29_customer_address_ca_address_sk_max) and in_bloom_filter(ss_addr_sk, DynamicValue(RS_29_customer_address_ca_address_sk_bloom_filter))) and (ss_cdemo_sk BETWEEN DynamicValue(RS_22_customer_demographics_cd_demo_sk_min) AND DynamicValue(RS_22_customer_demographics_cd_demo_sk_max) and in_bloom_filter(ss_cdemo_sk, DynamicValue(RS_22_customer_demographics_cd_demo_sk_bloom_filter))) and (ss_hdemo_sk BETWEEN DynamicValue(RS_25_household_demographics_hd_demo_sk_min) AND DynamicValue(RS_25_household_demographics_hd_demo_sk_max) and in_bloom_filter(ss_hdemo_sk, DynamicValue(RS_25_household_demographics_hd_demo_sk_bloom_filter))) and (ss_sales_price BETWEEN 100 AND 150 or ss_sales_price BETWEEN 50 AND 100 or ss_sales_price BETWEEN 150 AND 200) and (ss_sold_date_sk BETWEEN DynamicValue(RS_19_date_dim_d_date_sk_min) AND DynamicValue(RS_19_date_dim
 _d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_19_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_33_store_s_store_sk_min) AND DynamicValue(RS_33_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_33_store_s_store_sk_bloom_filter))) and ss_addr_sk is not null and ss_cdemo_sk is not null and ss_hdemo_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
-                                            TableScan [TS_0] (rows=575995635 width=88)
-                                              default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_cdemo_sk","ss_hdemo_sk","ss_addr_sk","ss_store_sk","ss_quantity","ss_sales_price","ss_ext_sales_price","ss_ext_wholesale_cost","ss_net_profit"]
-                                            <-Reducer 11 [BROADCAST_EDGE] vectorized
-                                              BROADCAST [RS_137]
-                                                Group By Operator [GBY_136] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1861800)"]
-                                                <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_135]
-                                                    Group By Operator [GBY_134] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1861800)"]
-                                                      Select Operator [SEL_133] (rows=1861800 width=385)
-                                                        Output:["_col0"]
-                                                         Please refer to the previous Select Operator [SEL_131]
-                                            <-Reducer 13 [BROADCAST_EDGE] vectorized
-                                              BROADCAST [RS_145]
-                                                Group By Operator [GBY_144] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                <-Map 12 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_143]
-                                                    Group By Operator [GBY_142] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                      Select Operator [SEL_141] (rows=7200 width=107)
-                                                        Output:["_col0"]
-                                                         Please refer to the previous Select Operator [SEL_139]
-                                            <-Reducer 15 [BROADCAST_EDGE] vectorized
-                                              BROADCAST [RS_153]
-                                                Group By Operator [GBY_152] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=20000000)"]
-                                                <-Map 14 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_151]
-                                                    Group By Operator [GBY_150] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=20000000)"]
-                                                      Select Operator [SEL_149] (rows=20000000 width=1014)
-                                                        Output:["_col0"]
-                                                         Please refer to the previous Select Operator [SEL_147]
-                                            <-Reducer 17 [BROADCAST_EDGE] vectorized
-                                              BROADCAST [RS_161]
-                                                Group By Operator [GBY_160] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                <-Map 16 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                  SHUFFLE [RS_159]
-                                                    Group By Operator [GBY_158] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                      Select Operator [SEL_157] (rows=1704 width=1910)
-                                                        Output:["_col0"]
-                                                         Please refer to the previous Select Operator [SEL_155]
-                                            <-Reducer 9 [BROADCAST_EDGE] vectorized
-                                              BROADCAST [RS_129]
-                                                Group By Operator [GBY_128] (rows=1 width=12)
-                                                  Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                                <-Map 8 [CUSTOM_SIMPLE_EDGE] vectorized
-                                                  PARTITION_ONLY_SHUFFLE [RS_127]
-                                                    Group By Operator [GBY_126] (rows=1 width=12)
-                                                      Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                                      Select Operator [SEL_125] (rows=36524 width=1119)
-                                                        Output:["_col0"]
-                                                         Please refer to the previous Select Operator [SEL_123]
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col6)","count(_col6)","sum(_col8)","count(_col8)","sum(_col9)","count(_col9)"]
+                Select Operator [SEL_35] (rows=1431552 width=88)
+                  Output:["_col6","_col8","_col9"]
+                  Filter Operator [FIL_34] (rows=1431552 width=88)
+                    predicate:(((_col19 = 'D') and (_col20 = 'Primary') and _col7 BETWEEN 50 AND 100 and (_col14 = 1)) or ((_col19 = 'M') and (_col20 = '4 yr Degree') and _col7 BETWEEN 100 AND 150 and (_col14 = 3)) or ((_col19 = 'U') and (_col20 = 'Advanced Degree') and _col7 BETWEEN 150 AND 200 and (_col14 = 1)))
+                    Merge Join Operator [MERGEJOIN_121] (rows=34357287 width=88)
+                      Conds:RS_31._col2=RS_148._col0(Inner),Output:["_col6","_col7","_col8","_col9","_col14","_col19","_col20"]
+                    <-Map 15 [SIMPLE_EDGE] vectorized
+                      SHUFFLE [RS_148]
+                        PartitionCols:_col0
+                        Select Operator [SEL_147] (rows=1861800 width=385)
+                          Output:["_col0","_col1","_col2"]
+                          Filter Operator [FIL_146] (rows=1861800 width=385)
+                            predicate:((cd_education_status) IN ('4 yr Degree', 'Primary', 'Advanced Degree') and (cd_marital_status) IN ('M', 'D', 'U') and cd_demo_sk is not null)
+                            TableScan [TS_15] (rows=1861800 width=385)
+                              default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
+                    <-Reducer 5 [SIMPLE_EDGE]
+                      SHUFFLE [RS_31]
+                        PartitionCols:_col2
+                        Filter Operator [FIL_30] (rows=31233897 width=88)
+                          predicate:(((_col16) IN ('KY', 'GA', 'NM') and _col10 BETWEEN 100 AND 200) or ((_col16) IN ('MT', 'OR', 'IN') and _col10 BETWEEN 150 AND 300) or ((_col16) IN ('WI', 'MO', 'WV') and _col10 BETWEEN 50 AND 250))
+                          Merge Join Operator [MERGEJOIN_120] (rows=93701693 width=88)
+                            Conds:RS_27._col4=RS_159._col0(Inner),Output:["_col2","_col6","_col7","_col8","_col9","_col10","_col14","_col16"]
+                          <-Map 14 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_159]
+                              PartitionCols:_col0
+                              Select Operator [SEL_158] (rows=20000000 width=1014)
+                                Output:["_col0","_col1"]
+                                Filter Operator [FIL_157] (rows=20000000 width=1014)
+                                  predicate:((ca_country = 'United States') and (ca_state) IN ('KY', 'GA', 'NM', 'MT', 'OR', 'IN', 'WI', 'MO', 'WV') and ca_address_sk is not null)
+                                  TableScan [TS_12] (rows=40000000 width=1014)
+                                    default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_country"]
+                          <-Reducer 4 [SIMPLE_EDGE]
+                            SHUFFLE [RS_27]
+                              PartitionCols:_col4
+                              Merge Join Operator [MERGEJOIN_119] (rows=85183356 width=88)
+                                Conds:RS_24._col3=RS_140._col0(Inner),Output:["_col2","_col4","_col6","_col7","_col8","_col9","_col10","_col14"]
+                              <-Map 12 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_140]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_139] (rows=7200 width=107)
+                                    Output:["_col0","_col1"]
+                                    Filter Operator [FIL_138] (rows=7200 width=107)
+                                      predicate:((hd_dep_count) IN (3, 1) and hd_demo_sk is not null)
+                                      TableScan [TS_9] (rows=7200 width=107)
+                                        default@household_demographics,household_demographics,Tbl:COMPLETE,Col:NONE,Output:["hd_demo_sk","hd_dep_count"]
+                              <-Reducer 3 [SIMPLE_EDGE]
+                                SHUFFLE [RS_24]
+                                  PartitionCols:_col3
+                                  Merge Join Operator [MERGEJOIN_118] (rows=77439413 width=88)
+                                    Conds:RS_21._col1=RS_132._col0(Inner),Output:["_col2","_col3","_col4","_col6","_col7","_col8","_col9","_col10"]
+                                  <-Map 10 [SIMPLE_EDGE] vectorized
+                                    SHUFFLE [RS_132]
+                                      PartitionCols:_col0
+                                      Select Operator [SEL_131] (rows=36524 width=1119)
+                                        Output:["_col0"]
+                                        Filter Operator [FIL_130] (rows=36524 width=1119)
+                                          predicate:((d_year = 2001) and d_date_sk is not null)
+                                          TableScan [TS_6] (rows=73049 width=1119)
+                                            default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
+                                  <-Reducer 2 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_21]
+                                      PartitionCols:_col1
+                                      Merge Join Operator [MERGEJOIN_117] (rows=70399465 width=88)
+                                        Conds:RS_124._col0=RS_156._col4(Inner),Output:["_col1","_col2","_col3","_col4","_col6","_col7","_col8","_col9","_col10"]
+                                      <-Map 1 [SIMPLE_EDGE] vectorized
+                                        PARTITION_ONLY_SHUFFLE [RS_124]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_123] (rows=1704 width=1910)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_122] (rows=1704 width=1910)
+                                              predicate:s_store_sk is not null
+                                              TableScan [TS_0] (rows=1704 width=1910)
+                                                default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk"]
+                                      <-Map 9 [SIMPLE_EDGE] vectorized
+                                        SHUFFLE [RS_156]
+                                          PartitionCols:_col4
+                                          Select Operator [SEL_155] (rows=63999513 width=88)
+                                            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9"]
+                                            Filter Operator [FIL_154] (rows=63999513 width=88)
+                                              predicate:((ss_cdemo_sk BETWEEN DynamicValue(RS_32_customer_demographics_cd_demo_sk_min) AND DynamicValue(RS_32_customer_demographics_cd_demo_sk_max) and in_bloom_filter(ss_cdemo_sk, DynamicValue(RS_32_customer_demographics_cd_demo_sk_bloom_filter))) and (ss_hdemo_sk BETWEEN DynamicValue(RS_25_household_demographics_hd_demo_sk_min) AND DynamicValue(RS_25_household_demographics_hd_demo_sk_max) and in_bloom_filter(ss_hdemo_sk, DynamicValue(RS_25_household_demographics_hd_demo_sk_bloom_filter))) and (ss_net_profit BETWEEN 100 AND 200 or ss_net_profit BETWEEN 150 AND 300 or ss_net_profit BETWEEN 50 AND 250) and (ss_sales_price BETWEEN 100 AND 150 or ss_sales_price BETWEEN 50 AND 100 or ss_sales_price BETWEEN 150 AND 200) and (ss_sold_date_sk BETWEEN DynamicValue(RS_22_date_dim_d_date_sk_min) AND DynamicValue(RS_22_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_22_date_dim_d_date_sk_bloom_filter))) and (ss_store_
 sk BETWEEN DynamicValue(RS_18_store_s_store_sk_min) AND DynamicValue(RS_18_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_18_store_s_store_sk_bloom_filter))) and ss_addr_sk is not null and ss_cdemo_sk is not null and ss_hdemo_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
+                                              TableScan [TS_3] (rows=575995635 width=88)
+                                                default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_cdemo_sk","ss_hdemo_sk","ss_addr_sk","ss_store_sk","ss_quantity","ss_sales_price","ss_ext_sales_price","ss_ext_wholesale_cost","ss_net_profit"]
+                                              <-Reducer 11 [BROADCAST_EDGE] vectorized
+                                                BROADCAST [RS_137]
+                                                  Group By Operator [GBY_136] (rows=1 width=12)
+                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                  <-Map 10 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                    SHUFFLE [RS_135]
+                                                      Group By Operator [GBY_134] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                        Select Operator [SEL_133] (rows=36524 width=1119)
+                                                          Output:["_col0"]
+                                                           Please refer to the previous Select Operator [SEL_131]
+                                              <-Reducer 13 [BROADCAST_EDGE] vectorized
+                                                BROADCAST [RS_145]
+                                                  Group By Operator [GBY_144] (rows=1 width=12)
+                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                  <-Map 12 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                    SHUFFLE [RS_143]
+                                                      Group By Operator [GBY_142] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                        Select Operator [SEL_141] (rows=7200 width=107)
+                                                          Output:["_col0"]
+                                                           Please refer to the previous Select Operator [SEL_139]
+                                              <-Reducer 16 [BROADCAST_EDGE] vectorized
+                                                BROADCAST [RS_153]
+                                                  Group By Operator [GBY_152] (rows=1 width=12)
+                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1861800)"]
+                                                  <-Map 15 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                    SHUFFLE [RS_151]
+                                                      Group By Operator [GBY_150] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1861800)"]
+                                                        Select Operator [SEL_149] (rows=1861800 width=385)
+                                                          Output:["_col0"]
+                                                           Please refer to the previous Select Operator [SEL_147]
+                                              <-Reducer 8 [BROADCAST_EDGE] vectorized
+                                                BROADCAST [RS_129]
+                                                  Group By Operator [GBY_128] (rows=1 width=12)
+                                                    Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                                  <-Map 1 [CUSTOM_SIMPLE_EDGE] vectorized
+                                                    PARTITION_ONLY_SHUFFLE [RS_127]
+                                                      Group By Operator [GBY_126] (rows=1 width=12)
+                                                        Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                        Select Operator [SEL_125] (rows=1704 width=1910)
+                                                          Output:["_col0"]
+                                                           Please refer to the previous Select Operator [SEL_123]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query47.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query47.q.out b/ql/src/test/results/clientpositive/perf/tez/query47.q.out
index 0ba3fbf..f9c21aa 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query47.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query47.q.out
@@ -152,30 +152,30 @@ Stage-0
                         Select Operator [SEL_328] (rows=63887519 width=88)
                           Output:["rank_window_1","_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                           Filter Operator [FIL_327] (rows=63887519 width=88)
-                            predicate:((_col0 > 0) and (_col1 = 2000) and rank_window_1 is not null)
+                            predicate:((_col0 > 0) and (_col3 = 2000) and rank_window_1 is not null)
                             PTF Operator [PTF_326] (rows=383325119 width=88)
-                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS LAST, _col2 ASC NULLS LAST","partition by:":"_col4, _col3, _col5, _col6"}]
+                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS LAST, _col4 ASC NULLS LAST","partition by:":"_col2, _col1, _col5, _col6"}]
                               Select Operator [SEL_325] (rows=383325119 width=88)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
                               <-Reducer 10 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_324]
-                                  PartitionCols:_col3, _col2, _col4, _col5
+                                  PartitionCols:_col1, _col0, _col4, _col5
                                   Select Operator [SEL_323] (rows=383325119 width=88)
                                     Output:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                                     PTF Operator [PTF_322] (rows=383325119 width=88)
-                                      Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS FIRST, _col2 ASC NULLS FIRST, _col4 ASC NULLS FIRST, _col5 ASC NULLS FIRST, _col0 ASC NULLS FIRST","partition by:":"_col3, _col2, _col4, _col5, _col0"}]
+                                      Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST, _col0 ASC NULLS FIRST, _col4 ASC NULLS FIRST, _col5 ASC NULLS FIRST, _col2 ASC NULLS FIRST","partition by:":"_col1, _col0, _col4, _col5, _col2"}]
                                       Select Operator [SEL_321] (rows=383325119 width=88)
                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                                       <-Reducer 5 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_310]
-                                          PartitionCols:_col3, _col2, _col4, _col5, _col0
+                                          PartitionCols:_col1, _col0, _col4, _col5, _col2
                                           Group By Operator [GBY_307] (rows=383325119 width=88)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4, KEY._col5
                                           <-Reducer 4 [SIMPLE_EDGE]
                                             SHUFFLE [RS_93]
                                               PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
                                               Group By Operator [GBY_92] (rows=766650239 width=88)
-                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col8, _col9, _col11, _col12
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)"],keys:_col8, _col9, _col5, _col6, _col11, _col12
                                                 Merge Join Operator [MERGEJOIN_278] (rows=766650239 width=88)
                                                   Conds:RS_88._col2=RS_298._col0(Inner),Output:["_col3","_col5","_col6","_col8","_col9","_col11","_col12"]
                                                 <-Map 16 [SIMPLE_EDGE] vectorized
@@ -212,7 +212,7 @@ Stage-0
                                                             Select Operator [SEL_281] (rows=73049 width=1119)
                                                               Output:["_col0","_col1","_col2"]
                                                               Filter Operator [FIL_280] (rows=73049 width=1119)
-                                                                predicate:(((struct(d_year,d_moy)) IN (const struct(1999,12), const struct(2001,1)) or (d_year = 2000)) and d_date_sk is not null)
+                                                                predicate:(((d_year = 2000) or (struct(d_year,d_moy)) IN (const struct(1999,12), const struct(2001,1))) and (d_year) IN (2000, 1999, 2001) and d_date_sk is not null)
                                                                 TableScan [TS_73] (rows=73049 width=1119)
                                                                   default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_moy"]
                                                         <-Map 1 [SIMPLE_EDGE] vectorized
@@ -265,12 +265,12 @@ Stage-0
                       Filter Operator [FIL_313] (rows=383325119 width=88)
                         predicate:rank_window_0 is not null
                         PTF Operator [PTF_312] (rows=383325119 width=88)
-                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS LAST, _col1 ASC NULLS LAST","partition by:":"_col3, _col2, _col4, _col5"}]
+                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4, _col5"}]
                           Select Operator [SEL_311] (rows=383325119 width=88)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_308]
-                              PartitionCols:_col3, _col2, _col4, _col5
+                              PartitionCols:_col1, _col0, _col4, _col5
                                Please refer to the previous Group By Operator [GBY_307]
                 <-Reducer 9 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_320]
@@ -280,11 +280,11 @@ Stage-0
                       Filter Operator [FIL_318] (rows=383325119 width=88)
                         predicate:rank_window_0 is not null
                         PTF Operator [PTF_317] (rows=383325119 width=88)
-                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS LAST, _col1 ASC NULLS LAST","partition by:":"_col3, _col2, _col4, _col5"}]
+                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4, _col5"}]
                           Select Operator [SEL_316] (rows=383325119 width=88)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_309]
-                              PartitionCols:_col3, _col2, _col4, _col5
+                              PartitionCols:_col1, _col0, _col4, _col5
                                Please refer to the previous Group By Operator [GBY_307]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query48.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query48.q.out b/ql/src/test/results/clientpositive/perf/tez/query48.q.out
index e07c160..ffb9aa2 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query48.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query48.q.out
@@ -143,135 +143,125 @@ POSTHOOK: Output: hdfs://### HDFS PATH ###
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Map 1 <- Reducer 10 (BROADCAST_EDGE), Reducer 12 (BROADCAST_EDGE), Reducer 14 (BROADCAST_EDGE), Reducer 8 (BROADCAST_EDGE)
+Map 8 <- Reducer 10 (BROADCAST_EDGE), Reducer 12 (BROADCAST_EDGE), Reducer 7 (BROADCAST_EDGE)
 Reducer 10 <- Map 9 (CUSTOM_SIMPLE_EDGE)
 Reducer 12 <- Map 11 (CUSTOM_SIMPLE_EDGE)
-Reducer 14 <- Map 13 (CUSTOM_SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
 Reducer 3 <- Map 9 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
 Reducer 4 <- Map 11 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
 Reducer 5 <- Map 13 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
 Reducer 6 <- Reducer 5 (CUSTOM_SIMPLE_EDGE)
-Reducer 8 <- Map 7 (CUSTOM_SIMPLE_EDGE)
+Reducer 7 <- Map 1 (CUSTOM_SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:-1
     Stage-1
       Reducer 6 vectorized
-      File Output Operator [FS_133]
-        Group By Operator [GBY_132] (rows=1 width=8)
+      File Output Operator [FS_128]
+        Group By Operator [GBY_127] (rows=1 width=8)
           Output:["_col0"],aggregations:["sum(VALUE._col0)"]
         <-Reducer 5 [CUSTOM_SIMPLE_EDGE]
           PARTITION_ONLY_SHUFFLE [RS_30]
             Group By Operator [GBY_29] (rows=1 width=8)
-              Output:["_col0"],aggregations:["sum(_col4)"]
-              Merge Join Operator [MERGEJOIN_96] (rows=93701696 width=88)
-                Conds:RS_25._col3=RS_123._col0(Inner),Output:["_col4"]
-              <-Map 13 [SIMPLE_EDGE] vectorized
-                SHUFFLE [RS_123]
-                  PartitionCols:_col0
-                  Select Operator [SEL_122] (rows=1704 width=1910)
-                    Output:["_col0"]
-                    Filter Operator [FIL_121] (rows=1704 width=1910)
-                      predicate:s_store_sk is not null
-                      TableScan [TS_12] (rows=1704 width=1910)
-                        default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk"]
-              <-Reducer 4 [SIMPLE_EDGE]
-                SHUFFLE [RS_25]
-                  PartitionCols:_col3
-                  Filter Operator [FIL_24] (rows=85183359 width=88)
-                    predicate:(((_col13) IN ('KY', 'GA', 'NM') and _col6 BETWEEN 0 AND 2000) or ((_col13) IN ('MT', 'OR', 'IN') and _col6 BETWEEN 150 AND 3000) or ((_col13) IN ('WI', 'MO', 'WV') and _col6 BETWEEN 50 AND 25000))
-                    Merge Join Operator [MERGEJOIN_95] (rows=255550079 width=88)
-                      Conds:RS_21._col2=RS_115._col0(Inner),Output:["_col3","_col4","_col6","_col13"]
-                    <-Map 11 [SIMPLE_EDGE] vectorized
-                      SHUFFLE [RS_115]
-                        PartitionCols:_col0
-                        Select Operator [SEL_114] (rows=20000000 width=1014)
-                          Output:["_col0","_col1"]
-                          Filter Operator [FIL_113] (rows=20000000 width=1014)
-                            predicate:((ca_country = 'United States') and ca_address_sk is not null)
-                            TableScan [TS_9] (rows=40000000 width=1014)
-                              default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_country"]
-                    <-Reducer 3 [SIMPLE_EDGE]
-                      SHUFFLE [RS_21]
-                        PartitionCols:_col2
-                        Merge Join Operator [MERGEJOIN_94] (rows=232318249 width=88)
-                          Conds:RS_18._col1=RS_107._col0(Inner),Output:["_col2","_col3","_col4","_col6"]
-                        <-Map 9 [SIMPLE_EDGE] vectorized
-                          SHUFFLE [RS_107]
-                            PartitionCols:_col0
-                            Select Operator [SEL_106] (rows=465450 width=385)
-                              Output:["_col0"]
-                              Filter Operator [FIL_105] (rows=465450 width=385)
-                                predicate:((cd_education_status = '4 yr Degree') and (cd_marital_status = 'M') and cd_demo_sk is not null)
-                                TableScan [TS_6] (rows=1861800 width=385)
-                                  default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
-                        <-Reducer 2 [SIMPLE_EDGE]
-                          SHUFFLE [RS_18]
-                            PartitionCols:_col1
-                            Merge Join Operator [MERGEJOIN_93] (rows=211198404 width=88)
-                              Conds:RS_131._col0=RS_99._col0(Inner),Output:["_col1","_col2","_col3","_col4","_col6"]
-                            <-Map 7 [SIMPLE_EDGE] vectorized
-                              PARTITION_ONLY_SHUFFLE [RS_99]
-                                PartitionCols:_col0
-                                Select Operator [SEL_98] (rows=36524 width=1119)
-                                  Output:["_col0"]
-                                  Filter Operator [FIL_97] (rows=36524 width=1119)
-                                    predicate:((d_year = 1998) and d_date_sk is not null)
-                                    TableScan [TS_3] (rows=73049 width=1119)
-                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                            <-Map 1 [SIMPLE_EDGE] vectorized
-                              SHUFFLE [RS_131]
-                                PartitionCols:_col0
-                                Select Operator [SEL_130] (rows=191998545 width=88)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col6"]
-                                  Filter Operator [FIL_129] (rows=191998545 width=88)
-                                    predicate:((ss_addr_sk BETWEEN DynamicValue(RS_22_customer_address_ca_address_sk_min) AND DynamicValue(RS_22_customer_address_ca_address_sk_max) and in_bloom_filter(ss_addr_sk, DynamicValue(RS_22_customer_address_ca_address_sk_bloom_filter))) and (ss_cdemo_sk BETWEEN DynamicValue(RS_19_customer_demographics_cd_demo_sk_min) AND DynamicValue(RS_19_customer_demographics_cd_demo_sk_max) and in_bloom_filter(ss_cdemo_sk, DynamicValue(RS_19_customer_demographics_cd_demo_sk_bloom_filter))) and (ss_sales_price BETWEEN 100 AND 150 or ss_sales_price BETWEEN 50 AND 100 or ss_sales_price BETWEEN 150 AND 200) and (ss_sold_date_sk BETWEEN DynamicValue(RS_16_date_dim_d_date_sk_min) AND DynamicValue(RS_16_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_16_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_26_store_s_store_sk_min) AND DynamicValue(RS_26_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, Dyna
 micValue(RS_26_store_s_store_sk_bloom_filter))) and ss_addr_sk is not null and ss_cdemo_sk is not null and ss_sold_date_sk is not null and ss_store_sk is not null)
-                                    TableScan [TS_0] (rows=575995635 width=88)
-                                      default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_cdemo_sk","ss_addr_sk","ss_store_sk","ss_quantity","ss_sales_price","ss_net_profit"]
-                                    <-Reducer 10 [BROADCAST_EDGE] vectorized
-                                      BROADCAST [RS_112]
-                                        Group By Operator [GBY_111] (rows=1 width=12)
-                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                        <-Map 9 [CUSTOM_SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_110]
-                                            Group By Operator [GBY_109] (rows=1 width=12)
-                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                              Select Operator [SEL_108] (rows=465450 width=385)
-                                                Output:["_col0"]
-                                                 Please refer to the previous Select Operator [SEL_106]
-                                    <-Reducer 12 [BROADCAST_EDGE] vectorized
-                                      BROADCAST [RS_120]
-                                        Group By Operator [GBY_119] (rows=1 width=12)
-                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=20000000)"]
-                                        <-Map 11 [CUSTOM_SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_118]
-                                            Group By Operator [GBY_117] (rows=1 width=12)
-                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=20000000)"]
-                                              Select Operator [SEL_116] (rows=20000000 width=1014)
-                                                Output:["_col0"]
-                                                 Please refer to the previous Select Operator [SEL_114]
-                                    <-Reducer 14 [BROADCAST_EDGE] vectorized
-                                      BROADCAST [RS_128]
-                                        Group By Operator [GBY_127] (rows=1 width=12)
-                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                        <-Map 13 [CUSTOM_SIMPLE_EDGE] vectorized
-                                          SHUFFLE [RS_126]
-                                            Group By Operator [GBY_125] (rows=1 width=12)
-                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                              Select Operator [SEL_124] (rows=1704 width=1910)
-                                                Output:["_col0"]
-                                                 Please refer to the previous Select Operator [SEL_122]
-                                    <-Reducer 8 [BROADCAST_EDGE] vectorized
-                                      BROADCAST [RS_104]
-                                        Group By Operator [GBY_103] (rows=1 width=12)
-                                          Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
-                                        <-Map 7 [CUSTOM_SIMPLE_EDGE] vectorized
-                                          PARTITION_ONLY_SHUFFLE [RS_102]
-                                            Group By Operator [GBY_101] (rows=1 width=12)
-                                              Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
-                                              Select Operator [SEL_100] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                 Please refer to the previous Select Operator [SEL_98]
+              Output:["_col0"],aggregations:["sum(_col5)"]
+              Select Operator [SEL_28] (rows=31233897 width=88)
+                Output:["_col5"]
+                Filter Operator [FIL_27] (rows=31233897 width=88)
+                  predicate:(((_col14) IN ('KY', 'GA', 'NM') and _col7 BETWEEN 0 AND 2000) or ((_col14) IN ('MT', 'OR', 'IN') and _col7 BETWEEN 150 AND 3000) or ((_col14) IN ('WI', 'MO', 'WV') and _col7 BETWEEN 50 AND 25000))
+                  Merge Join Operator [MERGEJOIN_96] (rows=93701693 width=88)
+                    Conds:RS_24._col3=RS_126._col0(Inner),Output:["_col5","_col7","_col14"]
+                  <-Map 13 [SIMPLE_EDGE] vectorized
+                    SHUFFLE [RS_126]
+                      PartitionCols:_col0
+                      Select Operator [SEL_125] (rows=20000000 width=1014)
+                        Output:["_col0","_col1"]
+                        Filter Operator [FIL_124] (rows=20000000 width=1014)
+                          predicate:((ca_country = 'United States') and (ca_state) IN ('KY', 'GA', 'NM', 'MT', 'OR', 'IN', 'WI', 'MO', 'WV') and ca_address_sk is not null)
+                          TableScan [TS_12] (rows=40000000 width=1014)
+                            default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_country"]
+                  <-Reducer 4 [SIMPLE_EDGE]
+                    SHUFFLE [RS_24]
+                      PartitionCols:_col3
+                      Merge Join Operator [MERGEJOIN_95] (rows=85183356 width=88)
+                        Conds:RS_21._col2=RS_115._col0(Inner),Output:["_col3","_col5","_col7"]
+                      <-Map 11 [SIMPLE_EDGE] vectorized
+                        SHUFFLE [RS_115]
+                          PartitionCols:_col0
+                          Select Operator [SEL_114] (rows=465450 width=385)
+                            Output:["_col0"]
+                            Filter Operator [FIL_113] (rows=465450 width=385)
+                              predicate:((cd_education_status = '4 yr Degree') and (cd_marital_status = 'M') and cd_demo_sk is not null)
+                              TableScan [TS_9] (rows=1861800 width=385)
+                                default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
+                      <-Reducer 3 [SIMPLE_EDGE]
+                        SHUFFLE [RS_21]
+                          PartitionCols:_col2
+                          Merge Join Operator [MERGEJOIN_94] (rows=77439413 width=88)
+                            Conds:RS_18._col1=RS_107._col0(Inner),Output:["_col2","_col3","_col5","_col7"]
+                          <-Map 9 [SIMPLE_EDGE] vectorized
+                            SHUFFLE [RS_107]
+                              PartitionCols:_col0
+                              Select Operator [SEL_106] (rows=36524 width=1119)
+                                Output:["_col0"]
+                                Filter Operator [FIL_105] (rows=36524 width=1119)
+                                  predicate:((d_year = 1998) and d_date_sk is not null)
+                                  TableScan [TS_6] (rows=73049 width=1119)
+                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
+                          <-Reducer 2 [SIMPLE_EDGE]
+                            SHUFFLE [RS_18]
+                              PartitionCols:_col1
+                              Merge Join Operator [MERGEJOIN_93] (rows=70399465 width=88)
+                                Conds:RS_99._col0=RS_123._col3(Inner),Output:["_col1","_col2","_col3","_col5","_col7"]
+                              <-Map 1 [SIMPLE_EDGE] vectorized
+                                PARTITION_ONLY_SHUFFLE [RS_99]
+                                  PartitionCols:_col0
+                                  Select Operator [SEL_98] (rows=1704 width=1910)
+                                    Output:["_col0"]
+                                    Filter Operator [FIL_97] (rows=1704 width=1910)
+                                      predicate:s_store_sk is not null
+                                      TableScan [TS_0] (rows=1704 width=1910)
+                                        default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk"]
+                              <-Map 8 [SIMPLE_EDGE] vectorized
+                                SHUFFLE [RS_123]
+                                  PartitionCols:_col3
+                                  Select Operator [SEL_122] (rows=63999513 width=88)
+                                    Output:["_col0","_col1","_col2","_col3","_col4","_col6"]
+                                    Filter Operator [FIL_121] (rows=63999513 width=88)
+                                      predicate:((ss_cdemo_sk BETWEEN DynamicValue(RS_22_customer_demographics_cd_demo_sk_min) AND DynamicValue(RS_22_customer_demographics_cd_demo_sk_max) and in_bloom_filter(ss_cdemo_sk, DynamicValue(RS_22_customer_demographics_cd_demo_sk_bloom_filter))) and (ss_net_profit BETWEEN 0 AND 2000 or ss_net_profit BETWEEN 150 AND 3000 or ss_net_profit BETWEEN 50 AND 25000) and (ss_sales_price BETWEEN 100 AND 150 or ss_sales_price BETWEEN 50 AND 100 or ss_sales_price BETWEEN 150 AND 200) and (ss_sold_date_sk BETWEEN DynamicValue(RS_19_date_dim_d_date_sk_min) AND DynamicValue(RS_19_date_dim_d_date_sk_max) and in_bloom_filter(ss_sold_date_sk, DynamicValue(RS_19_date_dim_d_date_sk_bloom_filter))) and (ss_store_sk BETWEEN DynamicValue(RS_15_store_s_store_sk_min) AND DynamicValue(RS_15_store_s_store_sk_max) and in_bloom_filter(ss_store_sk, DynamicValue(RS_15_store_s_store_sk_bloom_filter))) and ss_addr_sk is not null and ss_cdemo_sk is not null and ss_sold_date
 _sk is not null and ss_store_sk is not null)
+                                      TableScan [TS_3] (rows=575995635 width=88)
+                                        default@store_sales,store_sales,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_cdemo_sk","ss_addr_sk","ss_store_sk","ss_quantity","ss_sales_price","ss_net_profit"]
+                                      <-Reducer 10 [BROADCAST_EDGE] vectorized
+                                        BROADCAST [RS_112]
+                                          Group By Operator [GBY_111] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                          <-Map 9 [CUSTOM_SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_110]
+                                              Group By Operator [GBY_109] (rows=1 width=12)
+                                                Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                Select Operator [SEL_108] (rows=36524 width=1119)
+                                                  Output:["_col0"]
+                                                   Please refer to the previous Select Operator [SEL_106]
+                                      <-Reducer 12 [BROADCAST_EDGE] vectorized
+                                        BROADCAST [RS_120]
+                                          Group By Operator [GBY_119] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                          <-Map 11 [CUSTOM_SIMPLE_EDGE] vectorized
+                                            SHUFFLE [RS_118]
+                                              Group By Operator [GBY_117] (rows=1 width=12)
+                                                Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                Select Operator [SEL_116] (rows=465450 width=385)
+                                                  Output:["_col0"]
+                                                   Please refer to the previous Select Operator [SEL_114]
+                                      <-Reducer 7 [BROADCAST_EDGE] vectorized
+                                        BROADCAST [RS_104]
+                                          Group By Operator [GBY_103] (rows=1 width=12)
+                                            Output:["_col0","_col1","_col2"],aggregations:["min(VALUE._col0)","max(VALUE._col1)","bloom_filter(VALUE._col2, expectedEntries=1000000)"]
+                                          <-Map 1 [CUSTOM_SIMPLE_EDGE] vectorized
+                                            PARTITION_ONLY_SHUFFLE [RS_102]
+                                              Group By Operator [GBY_101] (rows=1 width=12)
+                                                Output:["_col0","_col1","_col2"],aggregations:["min(_col0)","max(_col0)","bloom_filter(_col0, expectedEntries=1000000)"]
+                                                Select Operator [SEL_100] (rows=1704 width=1910)
+                                                  Output:["_col0"]
+                                                   Please refer to the previous Select Operator [SEL_98]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query53.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query53.q.out b/ql/src/test/results/clientpositive/perf/tez/query53.q.out
index fec6b41..87857e8 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query53.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query53.q.out
@@ -140,7 +140,7 @@ Stage-0
                                           Select Operator [SEL_86] (rows=462000 width=1436)
                                             Output:["_col0","_col4"]
                                             Filter Operator [FIL_85] (rows=462000 width=1436)
-                                              predicate:((((i_category) IN ('Books', 'Children', 'Electronics') and (i_class) IN ('personal', 'portable', 'reference', 'self-help') and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) or ((i_category) IN ('Women', 'Music', 'Men') and (i_class) IN ('accessories', 'classical', 'fragrances', 'pants') and (i_brand) IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1'))) and i_item_sk is not null)
+                                              predicate:((((i_category) IN ('Books', 'Children', 'Electronics') and (i_class) IN ('personal', 'portable', 'reference', 'self-help') and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) or ((i_category) IN ('Women', 'Music', 'Men') and (i_class) IN ('accessories', 'classical', 'fragrances', 'pants') and (i_brand) IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1'))) and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9', 'amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1') and (i_category) IN ('Books', 'Children', 'Electronics', 'Women', 'Music', 'Men') and (i_class) IN ('personal', 'portable', 'reference', 'self-help', 'accessories', 'classical', 'fragrances', 'pants') and i_item_sk is not null)
                                               TableScan [TS_3] (rows=462000 width=1436)
                                                 default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_brand","i_class","i_category","i_manufact_id"]
                                       <-Map 1 [SIMPLE_EDGE] vectorized

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query57.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query57.q.out b/ql/src/test/results/clientpositive/perf/tez/query57.q.out
index 1d1f870..7299f9f 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query57.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query57.q.out
@@ -146,30 +146,30 @@ Stage-0
                         Select Operator [SEL_328] (rows=31942874 width=135)
                           Output:["rank_window_1","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                           Filter Operator [FIL_327] (rows=31942874 width=135)
-                            predicate:((_col0 > 0) and (_col1 = 2000) and rank_window_1 is not null)
+                            predicate:((_col0 > 0) and (_col3 = 2000) and rank_window_1 is not null)
                             PTF Operator [PTF_326] (rows=191657247 width=135)
-                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS LAST, _col2 ASC NULLS LAST","partition by:":"_col5, _col4, _col3"}]
+                              Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col3 ASC NULLS LAST, _col4 ASC NULLS LAST","partition by:":"_col2, _col1, _col5"}]
                               Select Operator [SEL_325] (rows=191657247 width=135)
                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
                               <-Reducer 10 [SIMPLE_EDGE] vectorized
                                 SHUFFLE [RS_324]
-                                  PartitionCols:_col4, _col3, _col2
+                                  PartitionCols:_col1, _col0, _col4
                                   Select Operator [SEL_323] (rows=191657247 width=135)
                                     Output:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5"]
                                     PTF Operator [PTF_322] (rows=191657247 width=135)
-                                      Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col4 ASC NULLS FIRST, _col3 ASC NULLS FIRST, _col2 ASC NULLS FIRST, _col0 ASC NULLS FIRST","partition by:":"_col4, _col3, _col2, _col0"}]
+                                      Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col1 ASC NULLS FIRST, _col0 ASC NULLS FIRST, _col4 ASC NULLS FIRST, _col2 ASC NULLS FIRST","partition by:":"_col1, _col0, _col4, _col2"}]
                                       Select Operator [SEL_321] (rows=191657247 width=135)
                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                                       <-Reducer 5 [SIMPLE_EDGE] vectorized
                                         SHUFFLE [RS_310]
-                                          PartitionCols:_col4, _col3, _col2, _col0
+                                          PartitionCols:_col1, _col0, _col4, _col2
                                           Group By Operator [GBY_307] (rows=191657247 width=135)
                                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1, KEY._col2, KEY._col3, KEY._col4
                                           <-Reducer 4 [SIMPLE_EDGE]
                                             SHUFFLE [RS_93]
                                               PartitionCols:_col0, _col1, _col2, _col3, _col4
                                               Group By Operator [GBY_92] (rows=383314495 width=135)
-                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col8, _col10, _col11
+                                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)"],keys:_col10, _col11, _col5, _col6, _col8
                                                 Merge Join Operator [MERGEJOIN_278] (rows=383314495 width=135)
                                                   Conds:RS_88._col2=RS_298._col0(Inner),Output:["_col3","_col5","_col6","_col8","_col10","_col11"]
                                                 <-Map 16 [SIMPLE_EDGE] vectorized
@@ -206,7 +206,7 @@ Stage-0
                                                             Select Operator [SEL_281] (rows=73049 width=1119)
                                                               Output:["_col0","_col1","_col2"]
                                                               Filter Operator [FIL_280] (rows=73049 width=1119)
-                                                                predicate:(((struct(d_year,d_moy)) IN (const struct(1999,12), const struct(2001,1)) or (d_year = 2000)) and d_date_sk is not null)
+                                                                predicate:(((d_year = 2000) or (struct(d_year,d_moy)) IN (const struct(1999,12), const struct(2001,1))) and (d_year) IN (2000, 1999, 2001) and d_date_sk is not null)
                                                                 TableScan [TS_73] (rows=73049 width=1119)
                                                                   default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year","d_moy"]
                                                         <-Map 1 [SIMPLE_EDGE] vectorized
@@ -259,12 +259,12 @@ Stage-0
                       Filter Operator [FIL_313] (rows=191657247 width=135)
                         predicate:rank_window_0 is not null
                         PTF Operator [PTF_312] (rows=191657247 width=135)
-                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS LAST, _col1 ASC NULLS LAST","partition by:":"_col4, _col3, _col2"}]
+                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4"}]
                           Select Operator [SEL_311] (rows=191657247 width=135)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_308]
-                              PartitionCols:_col4, _col3, _col2
+                              PartitionCols:_col1, _col0, _col4
                                Please refer to the previous Group By Operator [GBY_307]
                 <-Reducer 9 [SIMPLE_EDGE] vectorized
                   SHUFFLE [RS_320]
@@ -274,11 +274,11 @@ Stage-0
                       Filter Operator [FIL_318] (rows=191657247 width=135)
                         predicate:rank_window_0 is not null
                         PTF Operator [PTF_317] (rows=191657247 width=135)
-                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col0 ASC NULLS LAST, _col1 ASC NULLS LAST","partition by:":"_col4, _col3, _col2"}]
+                          Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col2 ASC NULLS LAST, _col3 ASC NULLS LAST","partition by:":"_col1, _col0, _col4"}]
                           Select Operator [SEL_316] (rows=191657247 width=135)
                             Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                           <-Reducer 5 [SIMPLE_EDGE] vectorized
                             SHUFFLE [RS_309]
-                              PartitionCols:_col4, _col3, _col2
+                              PartitionCols:_col1, _col0, _col4
                                Please refer to the previous Group By Operator [GBY_307]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/f0b76e24/ql/src/test/results/clientpositive/perf/tez/query63.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/tez/query63.q.out b/ql/src/test/results/clientpositive/perf/tez/query63.q.out
index 941ee5e..d05da86 100644
--- a/ql/src/test/results/clientpositive/perf/tez/query63.q.out
+++ b/ql/src/test/results/clientpositive/perf/tez/query63.q.out
@@ -142,7 +142,7 @@ Stage-0
                                           Select Operator [SEL_86] (rows=462000 width=1436)
                                             Output:["_col0","_col4"]
                                             Filter Operator [FIL_85] (rows=462000 width=1436)
-                                              predicate:((((i_category) IN ('Books', 'Children', 'Electronics') and (i_class) IN ('personal', 'portable', 'refernece', 'self-help') and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) or ((i_category) IN ('Women', 'Music', 'Men') and (i_class) IN ('accessories', 'classical', 'fragrances', 'pants') and (i_brand) IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1'))) and i_item_sk is not null)
+                                              predicate:((((i_category) IN ('Books', 'Children', 'Electronics') and (i_class) IN ('personal', 'portable', 'refernece', 'self-help') and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) or ((i_category) IN ('Women', 'Music', 'Men') and (i_class) IN ('accessories', 'classical', 'fragrances', 'pants') and (i_brand) IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1'))) and (i_brand) IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9', 'amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1') and (i_category) IN ('Books', 'Children', 'Electronics', 'Women', 'Music', 'Men') and (i_class) IN ('personal', 'portable', 'refernece', 'self-help', 'accessories', 'classical', 'fragrances', 'pants') and i_item_sk is not null)
                                               TableScan [TS_3] (rows=462000 width=1436)
                                                 default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_brand","i_class","i_category","i_manager_id"]
                                       <-Map 1 [SIMPLE_EDGE] vectorized