You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2017/05/10 05:09:20 UTC

[3/6] hive git commit: HIVE-16330 : Improve plans for scalar subquery with aggregates (Vineet Garg via Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/a113ede9/ql/src/test/results/clientpositive/perf/query1.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query1.q.out b/ql/src/test/results/clientpositive/perf/query1.q.out
index 07828da..d84c76d 100644
--- a/ql/src/test/results/clientpositive/perf/query1.q.out
+++ b/ql/src/test/results/clientpositive/perf/query1.q.out
@@ -47,175 +47,127 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 13 <- Map 12 (SIMPLE_EDGE), Map 15 (SIMPLE_EDGE)
-Reducer 14 <- Reducer 13 (SIMPLE_EDGE)
-Reducer 17 <- Map 16 (SIMPLE_EDGE), Map 19 (SIMPLE_EDGE)
-Reducer 18 <- Reducer 17 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE)
+Reducer 13 <- Reducer 12 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 8 (SIMPLE_EDGE)
 Reducer 3 <- Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Map 10 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Map 11 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 14 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
-Reducer 7 <- Reducer 18 (SIMPLE_EDGE), Reducer 6 (SIMPLE_EDGE)
-Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+Reducer 4 <- Map 9 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Map 10 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 13 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
-      Reducer 8
-      File Output Operator [FS_82]
-        Limit [LIM_81] (rows=100 width=860)
+      Reducer 7
+      File Output Operator [FS_54]
+        Limit [LIM_53] (rows=100 width=860)
           Number of rows:100
-          Select Operator [SEL_80] (rows=35493335 width=860)
+          Select Operator [SEL_52] (rows=32266667 width=860)
             Output:["_col0"]
-          <-Reducer 7 [SIMPLE_EDGE]
-            SHUFFLE [RS_79]
-              Select Operator [SEL_78] (rows=35493335 width=860)
+          <-Reducer 6 [SIMPLE_EDGE]
+            SHUFFLE [RS_51]
+              Select Operator [SEL_50] (rows=32266667 width=860)
                 Output:["_col0"]
-                Filter Operator [FIL_77] (rows=35493335 width=860)
-                  predicate:(_col2 > CASE WHEN (_col10 is null) THEN (null) ELSE (_col9) END)
-                  Merge Join Operator [MERGEJOIN_114] (rows=106480005 width=860)
-                    Conds:RS_74._col1=RS_75._col2(Left Outer),Output:["_col2","_col6","_col9","_col10"]
-                  <-Reducer 18 [SIMPLE_EDGE]
-                    SHUFFLE [RS_75]
+                Filter Operator [FIL_49] (rows=32266667 width=860)
+                  predicate:(_col2 > CASE WHEN (_col8 is null) THEN (null) ELSE (_col7) END)
+                  Merge Join Operator [MERGEJOIN_78] (rows=96800003 width=860)
+                    Conds:RS_45._col1=RS_46._col2(Left Outer),Output:["_col2","_col6","_col7","_col8"]
+                  <-Reducer 13 [SIMPLE_EDGE]
+                    SHUFFLE [RS_46]
                       PartitionCols:_col2
-                      Select Operator [SEL_73] (rows=15837566 width=77)
+                      Select Operator [SEL_38] (rows=15837566 width=77)
                         Output:["_col0","_col1","_col2"]
-                        Group By Operator [GBY_72] (rows=15837566 width=77)
+                        Group By Operator [GBY_37] (rows=15837566 width=77)
                           Output:["_col0","_col1"],aggregations:["avg(_col2)"],keys:_col1
-                          Select Operator [SEL_68] (rows=31675133 width=77)
+                          Select Operator [SEL_33] (rows=31675133 width=77)
                             Output:["_col1","_col2"]
-                            Group By Operator [GBY_67] (rows=31675133 width=77)
+                            Group By Operator [GBY_32] (rows=31675133 width=77)
                               Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                            <-Reducer 17 [SIMPLE_EDGE]
-                              SHUFFLE [RS_66]
+                            <-Reducer 12 [SIMPLE_EDGE]
+                              SHUFFLE [RS_31]
                                 PartitionCols:_col0
-                                Group By Operator [GBY_65] (rows=63350266 width=77)
+                                Group By Operator [GBY_30] (rows=63350266 width=77)
                                   Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                  Merge Join Operator [MERGEJOIN_112] (rows=63350266 width=77)
-                                    Conds:RS_61._col0=RS_62._col0(Inner),Output:["_col1","_col2","_col3"]
-                                  <-Map 16 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_61]
+                                  Merge Join Operator [MERGEJOIN_77] (rows=63350266 width=77)
+                                    Conds:RS_26._col0=RS_27._col0(Inner),Output:["_col1","_col2","_col3"]
+                                  <-Map 11 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_26]
                                       PartitionCols:_col0
-                                      Select Operator [SEL_57] (rows=57591150 width=77)
+                                      Select Operator [SEL_22] (rows=57591150 width=77)
                                         Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_106] (rows=57591150 width=77)
+                                        Filter Operator [FIL_72] (rows=57591150 width=77)
                                           predicate:(sr_returned_date_sk is not null and sr_store_sk is not null)
-                                          TableScan [TS_55] (rows=57591150 width=77)
+                                          TableScan [TS_20] (rows=57591150 width=77)
                                             default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_customer_sk","sr_store_sk","sr_fee"]
-                                  <-Map 19 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_62]
+                                  <-Map 14 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_27]
                                       PartitionCols:_col0
-                                      Select Operator [SEL_60] (rows=36524 width=1119)
+                                      Select Operator [SEL_25] (rows=36524 width=1119)
                                         Output:["_col0"]
-                                        Filter Operator [FIL_107] (rows=36524 width=1119)
+                                        Filter Operator [FIL_73] (rows=36524 width=1119)
                                           predicate:((d_year = 2000) and d_date_sk is not null)
-                                          TableScan [TS_58] (rows=73049 width=1119)
+                                          TableScan [TS_23] (rows=73049 width=1119)
                                             default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                  <-Reducer 6 [SIMPLE_EDGE]
-                    SHUFFLE [RS_74]
+                  <-Reducer 5 [SIMPLE_EDGE]
+                    SHUFFLE [RS_45]
                       PartitionCols:_col1
-                      Merge Join Operator [MERGEJOIN_113] (rows=96800003 width=860)
-                        Conds:RS_51._col1=RS_52._col0(Left Outer),Output:["_col1","_col2","_col6"]
-                      <-Reducer 14 [SIMPLE_EDGE]
-                        SHUFFLE [RS_52]
+                      Merge Join Operator [MERGEJOIN_76] (rows=88000001 width=860)
+                        Conds:RS_42._col0=RS_43._col0(Inner),Output:["_col1","_col2","_col6"]
+                      <-Map 10 [SIMPLE_EDGE]
+                        SHUFFLE [RS_43]
                           PartitionCols:_col0
-                          Select Operator [SEL_44] (rows=2639594 width=77)
-                            Output:["_col0"]
-                            Filter Operator [FIL_43] (rows=2639594 width=77)
-                              predicate:(sq_count_check(_col1) <= 1)
-                              Group By Operator [GBY_42] (rows=7918783 width=77)
-                                Output:["_col0","_col1"],aggregations:["count()"],keys:_col0
-                                Group By Operator [GBY_37] (rows=15837566 width=77)
-                                  Output:["_col0"],keys:_col1
-                                  Select Operator [SEL_33] (rows=31675133 width=77)
-                                    Output:["_col1"]
-                                    Group By Operator [GBY_32] (rows=31675133 width=77)
-                                      Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                                    <-Reducer 13 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_31]
-                                        PartitionCols:_col0
-                                        Group By Operator [GBY_30] (rows=63350266 width=77)
-                                          Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                          Merge Join Operator [MERGEJOIN_111] (rows=63350266 width=77)
-                                            Conds:RS_26._col0=RS_27._col0(Inner),Output:["_col1","_col2","_col3"]
-                                          <-Map 12 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_26]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_22] (rows=57591150 width=77)
-                                                Output:["_col0","_col1","_col2","_col3"]
-                                                Filter Operator [FIL_104] (rows=57591150 width=77)
-                                                  predicate:(sr_returned_date_sk is not null and sr_store_sk is not null)
-                                                  TableScan [TS_20] (rows=57591150 width=77)
-                                                    default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_customer_sk","sr_store_sk","sr_fee"]
-                                          <-Map 15 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_27]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_25] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_105] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2000) and d_date_sk is not null)
-                                                  TableScan [TS_23] (rows=73049 width=1119)
-                                                    default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                      <-Reducer 5 [SIMPLE_EDGE]
-                        SHUFFLE [RS_51]
-                          PartitionCols:_col1
-                          Merge Join Operator [MERGEJOIN_110] (rows=88000001 width=860)
-                            Conds:RS_48._col0=RS_49._col0(Inner),Output:["_col1","_col2","_col6"]
-                          <-Map 11 [SIMPLE_EDGE]
-                            SHUFFLE [RS_49]
-                              PartitionCols:_col0
-                              Select Operator [SEL_19] (rows=80000000 width=860)
-                                Output:["_col0","_col1"]
-                                Filter Operator [FIL_103] (rows=80000000 width=860)
-                                  predicate:c_customer_sk is not null
-                                  TableScan [TS_17] (rows=80000000 width=860)
-                                    default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id"]
-                          <-Reducer 4 [SIMPLE_EDGE]
-                            SHUFFLE [RS_48]
+                          Select Operator [SEL_19] (rows=80000000 width=860)
+                            Output:["_col0","_col1"]
+                            Filter Operator [FIL_71] (rows=80000000 width=860)
+                              predicate:c_customer_sk is not null
+                              TableScan [TS_17] (rows=80000000 width=860)
+                                default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id"]
+                      <-Reducer 4 [SIMPLE_EDGE]
+                        SHUFFLE [RS_42]
+                          PartitionCols:_col0
+                          Merge Join Operator [MERGEJOIN_75] (rows=34842647 width=77)
+                            Conds:RS_39._col1=RS_40._col0(Inner),Output:["_col0","_col1","_col2"]
+                          <-Map 9 [SIMPLE_EDGE]
+                            SHUFFLE [RS_40]
                               PartitionCols:_col0
-                              Merge Join Operator [MERGEJOIN_109] (rows=34842647 width=77)
-                                Conds:RS_45._col1=RS_46._col0(Inner),Output:["_col0","_col1","_col2"]
-                              <-Map 10 [SIMPLE_EDGE]
-                                SHUFFLE [RS_46]
-                                  PartitionCols:_col0
-                                  Select Operator [SEL_16] (rows=852 width=1910)
-                                    Output:["_col0"]
-                                    Filter Operator [FIL_102] (rows=852 width=1910)
-                                      predicate:((s_state = 'NM') and s_store_sk is not null)
-                                      TableScan [TS_14] (rows=1704 width=1910)
-                                        default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_state"]
-                              <-Reducer 3 [SIMPLE_EDGE]
-                                SHUFFLE [RS_45]
-                                  PartitionCols:_col1
-                                  Select Operator [SEL_13] (rows=31675133 width=77)
-                                    Output:["_col0","_col1","_col2"]
-                                    Group By Operator [GBY_12] (rows=31675133 width=77)
-                                      Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                                    <-Reducer 2 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_11]
-                                        PartitionCols:_col0, _col1
-                                        Group By Operator [GBY_10] (rows=63350266 width=77)
-                                          Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
-                                          Merge Join Operator [MERGEJOIN_108] (rows=63350266 width=77)
-                                            Conds:RS_6._col0=RS_7._col0(Inner),Output:["_col1","_col2","_col3"]
-                                          <-Map 1 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_6]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_2] (rows=57591150 width=77)
-                                                Output:["_col0","_col1","_col2","_col3"]
-                                                Filter Operator [FIL_100] (rows=57591150 width=77)
-                                                  predicate:(sr_returned_date_sk is not null and sr_store_sk is not null and sr_customer_sk is not null)
-                                                  TableScan [TS_0] (rows=57591150 width=77)
-                                                    default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_customer_sk","sr_store_sk","sr_fee"]
-                                          <-Map 9 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_7]
-                                              PartitionCols:_col0
-                                              Select Operator [SEL_5] (rows=36524 width=1119)
-                                                Output:["_col0"]
-                                                Filter Operator [FIL_101] (rows=36524 width=1119)
-                                                  predicate:((d_year = 2000) 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"]
+                              Select Operator [SEL_16] (rows=852 width=1910)
+                                Output:["_col0"]
+                                Filter Operator [FIL_70] (rows=852 width=1910)
+                                  predicate:((s_state = 'NM') and s_store_sk is not null)
+                                  TableScan [TS_14] (rows=1704 width=1910)
+                                    default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_state"]
+                          <-Reducer 3 [SIMPLE_EDGE]
+                            SHUFFLE [RS_39]
+                              PartitionCols:_col1
+                              Select Operator [SEL_13] (rows=31675133 width=77)
+                                Output:["_col0","_col1","_col2"]
+                                Group By Operator [GBY_12] (rows=31675133 width=77)
+                                  Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
+                                <-Reducer 2 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_11]
+                                    PartitionCols:_col0, _col1
+                                    Group By Operator [GBY_10] (rows=63350266 width=77)
+                                      Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col2, _col1
+                                      Merge Join Operator [MERGEJOIN_74] (rows=63350266 width=77)
+                                        Conds:RS_6._col0=RS_7._col0(Inner),Output:["_col1","_col2","_col3"]
+                                      <-Map 1 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_6]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_2] (rows=57591150 width=77)
+                                            Output:["_col0","_col1","_col2","_col3"]
+                                            Filter Operator [FIL_68] (rows=57591150 width=77)
+                                              predicate:(sr_returned_date_sk is not null and sr_store_sk is not null and sr_customer_sk is not null)
+                                              TableScan [TS_0] (rows=57591150 width=77)
+                                                default@store_returns,store_returns,Tbl:COMPLETE,Col:NONE,Output:["sr_returned_date_sk","sr_customer_sk","sr_store_sk","sr_fee"]
+                                      <-Map 8 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_7]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_5] (rows=36524 width=1119)
+                                            Output:["_col0"]
+                                            Filter Operator [FIL_69] (rows=36524 width=1119)
+                                              predicate:((d_year = 2000) 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"]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/a113ede9/ql/src/test/results/clientpositive/perf/query30.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query30.q.out b/ql/src/test/results/clientpositive/perf/query30.q.out
index 72871f4..4b7d949 100644
--- a/ql/src/test/results/clientpositive/perf/query30.q.out
+++ b/ql/src/test/results/clientpositive/perf/query30.q.out
@@ -59,222 +59,159 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Reducer 9 (SIMPLE_EDGE)
-Reducer 11 <- Reducer 10 (SIMPLE_EDGE), Reducer 17 (SIMPLE_EDGE)
-Reducer 15 <- Map 14 (SIMPLE_EDGE), Map 18 (SIMPLE_EDGE)
-Reducer 16 <- Map 19 (SIMPLE_EDGE), Reducer 15 (SIMPLE_EDGE)
-Reducer 17 <- Reducer 16 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
-Reducer 21 <- Map 20 (SIMPLE_EDGE), Map 24 (SIMPLE_EDGE)
-Reducer 22 <- Map 25 (SIMPLE_EDGE), Reducer 21 (SIMPLE_EDGE)
-Reducer 23 <- Reducer 22 (SIMPLE_EDGE)
-Reducer 3 <- Reducer 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 23 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 4 (SIMPLE_EDGE)
-Reducer 8 <- Map 12 (SIMPLE_EDGE), Map 7 (SIMPLE_EDGE)
-Reducer 9 <- Map 13 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+Reducer 10 <- Reducer 16 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 14 <- Map 13 (SIMPLE_EDGE), Map 17 (SIMPLE_EDGE)
+Reducer 15 <- Map 18 (SIMPLE_EDGE), Reducer 14 (SIMPLE_EDGE)
+Reducer 16 <- Reducer 15 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Map 5 (SIMPLE_EDGE)
+Reducer 3 <- Reducer 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 3 (SIMPLE_EDGE)
+Reducer 7 <- Map 11 (SIMPLE_EDGE), Map 6 (SIMPLE_EDGE)
+Reducer 8 <- Map 12 (SIMPLE_EDGE), Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
-      Reducer 5
-      File Output Operator [FS_101]
-        Limit [LIM_100] (rows=100 width=860)
+      Reducer 4
+      File Output Operator [FS_67]
+        Limit [LIM_66] (rows=100 width=860)
           Number of rows:100
-          Select Operator [SEL_99] (rows=35493335 width=860)
+          Select Operator [SEL_65] (rows=32266667 width=860)
             Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
-          <-Reducer 4 [SIMPLE_EDGE]
-            SHUFFLE [RS_98]
-              Select Operator [SEL_97] (rows=35493335 width=860)
+          <-Reducer 3 [SIMPLE_EDGE]
+            SHUFFLE [RS_64]
+              Select Operator [SEL_63] (rows=32266667 width=860)
                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12"]
-                Filter Operator [FIL_96] (rows=35493335 width=860)
-                  predicate:(_col2 > CASE WHEN (_col22 is null) THEN (null) ELSE (_col21) END)
-                  Merge Join Operator [MERGEJOIN_153] (rows=106480005 width=860)
-                    Conds:RS_93._col1=RS_94._col2(Left Outer),Output:["_col2","_col6","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col21","_col22"]
-                  <-Reducer 23 [SIMPLE_EDGE]
-                    SHUFFLE [RS_94]
-                      PartitionCols:_col2
-                      Select Operator [SEL_92] (rows=11000000 width=1014)
-                        Output:["_col0","_col1","_col2"]
-                        Group By Operator [GBY_91] (rows=11000000 width=1014)
-                          Output:["_col0","_col1"],aggregations:["avg(_col2)"],keys:_col0
-                          Select Operator [SEL_87] (rows=22000000 width=1014)
-                            Output:["_col0","_col2"]
-                            Group By Operator [GBY_86] (rows=22000000 width=1014)
-                              Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                            <-Reducer 22 [SIMPLE_EDGE]
-                              SHUFFLE [RS_85]
-                                PartitionCols:_col0
-                                Group By Operator [GBY_84] (rows=44000000 width=1014)
-                                  Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col7, _col1
-                                  Merge Join Operator [MERGEJOIN_150] (rows=44000000 width=1014)
-                                    Conds:RS_80._col2=RS_81._col0(Inner),Output:["_col1","_col3","_col7"]
-                                  <-Map 25 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_81]
-                                      PartitionCols:_col0
-                                      Select Operator [SEL_76] (rows=40000000 width=1014)
-                                        Output:["_col0","_col1"]
-                                        Filter Operator [FIL_143] (rows=40000000 width=1014)
-                                          predicate:(ca_address_sk is not null and ca_state is not null)
-                                          TableScan [TS_74] (rows=40000000 width=1014)
-                                            default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
-                                  <-Reducer 21 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_80]
-                                      PartitionCols:_col2
-                                      Merge Join Operator [MERGEJOIN_149] (rows=15838314 width=92)
-                                        Conds:RS_77._col0=RS_78._col0(Inner),Output:["_col1","_col2","_col3"]
-                                      <-Map 20 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_77]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_70] (rows=14398467 width=92)
-                                            Output:["_col0","_col1","_col2","_col3"]
-                                            Filter Operator [FIL_141] (rows=14398467 width=92)
-                                              predicate:(wr_returned_date_sk is not null and wr_returning_addr_sk is not null)
-                                              TableScan [TS_68] (rows=14398467 width=92)
-                                                default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_returned_date_sk","wr_returning_customer_sk","wr_returning_addr_sk","wr_return_amt"]
-                                      <-Map 24 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_78]
-                                          PartitionCols:_col0
-                                          Select Operator [SEL_73] (rows=36524 width=1119)
-                                            Output:["_col0"]
-                                            Filter Operator [FIL_142] (rows=36524 width=1119)
-                                              predicate:((d_year = 2002) and d_date_sk is not null)
-                                              TableScan [TS_71] (rows=73049 width=1119)
-                                                default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                  <-Reducer 3 [SIMPLE_EDGE]
-                    SHUFFLE [RS_93]
-                      PartitionCols:_col1
-                      Select Operator [SEL_67] (rows=96800003 width=860)
-                        Output:["_col1","_col2","_col6","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18"]
-                        Merge Join Operator [MERGEJOIN_152] (rows=96800003 width=860)
-                          Conds:RS_64._col0=RS_65._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col17","_col18"]
-                        <-Reducer 11 [SIMPLE_EDGE]
-                          SHUFFLE [RS_65]
-                            PartitionCols:_col0
-                            Merge Join Operator [MERGEJOIN_151] (rows=24200000 width=1014)
-                              Conds:RS_57._col1=RS_58._col0(Left Outer),Output:["_col0","_col1","_col2"]
-                            <-Reducer 10 [SIMPLE_EDGE]
-                              SHUFFLE [RS_57]
-                                PartitionCols:_col1
-                                Select Operator [SEL_25] (rows=22000000 width=1014)
-                                  Output:["_col0","_col1","_col2"]
-                                  Group By Operator [GBY_24] (rows=22000000 width=1014)
+                Filter Operator [FIL_62] (rows=32266667 width=860)
+                  predicate:(_col2 > CASE WHEN (_col20 is null) THEN (null) ELSE (_col19) END)
+                  Select Operator [SEL_61] (rows=96800003 width=860)
+                    Output:["_col2","_col6","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15","_col16","_col17","_col18","_col19","_col20"]
+                    Merge Join Operator [MERGEJOIN_105] (rows=96800003 width=860)
+                      Conds:RS_58._col0=RS_59._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col18","_col19","_col20"]
+                    <-Reducer 10 [SIMPLE_EDGE]
+                      SHUFFLE [RS_59]
+                        PartitionCols:_col0
+                        Merge Join Operator [MERGEJOIN_104] (rows=24200000 width=1014)
+                          Conds:RS_51._col1=RS_52._col2(Left Outer),Output:["_col0","_col2","_col3","_col4"]
+                        <-Reducer 16 [SIMPLE_EDGE]
+                          SHUFFLE [RS_52]
+                            PartitionCols:_col2
+                            Select Operator [SEL_50] (rows=11000000 width=1014)
+                              Output:["_col0","_col1","_col2"]
+                              Group By Operator [GBY_49] (rows=11000000 width=1014)
+                                Output:["_col0","_col1"],aggregations:["avg(_col2)"],keys:_col0
+                                Select Operator [SEL_45] (rows=22000000 width=1014)
+                                  Output:["_col0","_col2"]
+                                  Group By Operator [GBY_44] (rows=22000000 width=1014)
                                     Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                                  <-Reducer 9 [SIMPLE_EDGE]
-                                    SHUFFLE [RS_23]
-                                      PartitionCols:_col0, _col1
-                                      Group By Operator [GBY_22] (rows=44000000 width=1014)
+                                  <-Reducer 15 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_43]
+                                      PartitionCols:_col0
+                                      Group By Operator [GBY_42] (rows=44000000 width=1014)
                                         Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col7, _col1
-                                        Merge Join Operator [MERGEJOIN_146] (rows=44000000 width=1014)
-                                          Conds:RS_18._col2=RS_19._col0(Inner),Output:["_col1","_col3","_col7"]
-                                        <-Map 13 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_19]
+                                        Merge Join Operator [MERGEJOIN_103] (rows=44000000 width=1014)
+                                          Conds:RS_38._col2=RS_39._col0(Inner),Output:["_col1","_col3","_col7"]
+                                        <-Map 18 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_39]
                                             PartitionCols:_col0
-                                            Select Operator [SEL_14] (rows=40000000 width=1014)
+                                            Select Operator [SEL_34] (rows=40000000 width=1014)
                                               Output:["_col0","_col1"]
-                                              Filter Operator [FIL_137] (rows=40000000 width=1014)
-                                                predicate:ca_address_sk is not null
-                                                TableScan [TS_12] (rows=40000000 width=1014)
+                                              Filter Operator [FIL_98] (rows=40000000 width=1014)
+                                                predicate:(ca_address_sk is not null and ca_state is not null)
+                                                TableScan [TS_32] (rows=40000000 width=1014)
                                                   default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
-                                        <-Reducer 8 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_18]
+                                        <-Reducer 14 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_38]
                                             PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_145] (rows=15838314 width=92)
-                                              Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col1","_col2","_col3"]
-                                            <-Map 12 [SIMPLE_EDGE]
-                                              SHUFFLE [RS_16]
+                                            Merge Join Operator [MERGEJOIN_102] (rows=15838314 width=92)
+                                              Conds:RS_35._col0=RS_36._col0(Inner),Output:["_col1","_col2","_col3"]
+                                            <-Map 13 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_35]
+                                                PartitionCols:_col0
+                                                Select Operator [SEL_28] (rows=14398467 width=92)
+                                                  Output:["_col0","_col1","_col2","_col3"]
+                                                  Filter Operator [FIL_96] (rows=14398467 width=92)
+                                                    predicate:(wr_returned_date_sk is not null and wr_returning_addr_sk is not null)
+                                                    TableScan [TS_26] (rows=14398467 width=92)
+                                                      default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_returned_date_sk","wr_returning_customer_sk","wr_returning_addr_sk","wr_return_amt"]
+                                            <-Map 17 [SIMPLE_EDGE]
+                                              SHUFFLE [RS_36]
                                                 PartitionCols:_col0
-                                                Select Operator [SEL_11] (rows=36524 width=1119)
+                                                Select Operator [SEL_31] (rows=36524 width=1119)
                                                   Output:["_col0"]
-                                                  Filter Operator [FIL_136] (rows=36524 width=1119)
+                                                  Filter Operator [FIL_97] (rows=36524 width=1119)
                                                     predicate:((d_year = 2002) and d_date_sk is not null)
-                                                    TableScan [TS_9] (rows=73049 width=1119)
+                                                    TableScan [TS_29] (rows=73049 width=1119)
                                                       default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
-                                            <-Map 7 [SIMPLE_EDGE]
-                                              SHUFFLE [RS_15]
-                                                PartitionCols:_col0
-                                                Select Operator [SEL_8] (rows=14398467 width=92)
-                                                  Output:["_col0","_col1","_col2","_col3"]
-                                                  Filter Operator [FIL_135] (rows=14398467 width=92)
-                                                    predicate:(wr_returned_date_sk is not null and wr_returning_addr_sk is not null and wr_returning_customer_sk is not null)
-                                                    TableScan [TS_6] (rows=14398467 width=92)
-                                                      default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_returned_date_sk","wr_returning_customer_sk","wr_returning_addr_sk","wr_return_amt"]
-                            <-Reducer 17 [SIMPLE_EDGE]
-                              SHUFFLE [RS_58]
-                                PartitionCols:_col0
-                                Select Operator [SEL_56] (rows=1833333 width=1014)
-                                  Output:["_col0"]
-                                  Filter Operator [FIL_55] (rows=1833333 width=1014)
-                                    predicate:(sq_count_check(_col1) <= 1)
-                                    Group By Operator [GBY_54] (rows=5500000 width=1014)
-                                      Output:["_col0","_col1"],aggregations:["count()"],keys:_col0
-                                      Group By Operator [GBY_49] (rows=11000000 width=1014)
-                                        Output:["_col0"],keys:_col0
-                                        Select Operator [SEL_45] (rows=22000000 width=1014)
-                                          Output:["_col0"]
-                                          Group By Operator [GBY_44] (rows=22000000 width=1014)
-                                            Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
-                                          <-Reducer 16 [SIMPLE_EDGE]
-                                            SHUFFLE [RS_43]
-                                              PartitionCols:_col0
-                                              Group By Operator [GBY_42] (rows=44000000 width=1014)
-                                                Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col7, _col1
-                                                Merge Join Operator [MERGEJOIN_148] (rows=44000000 width=1014)
-                                                  Conds:RS_38._col2=RS_39._col0(Inner),Output:["_col1","_col3","_col7"]
-                                                <-Map 19 [SIMPLE_EDGE]
-                                                  SHUFFLE [RS_39]
-                                                    PartitionCols:_col0
-                                                    Select Operator [SEL_34] (rows=40000000 width=1014)
-                                                      Output:["_col0","_col1"]
-                                                      Filter Operator [FIL_140] (rows=40000000 width=1014)
-                                                        predicate:(ca_address_sk is not null and ca_state is not null)
-                                                        TableScan [TS_32] (rows=40000000 width=1014)
-                                                          default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
-                                                <-Reducer 15 [SIMPLE_EDGE]
-                                                  SHUFFLE [RS_38]
-                                                    PartitionCols:_col2
-                                                    Merge Join Operator [MERGEJOIN_147] (rows=15838314 width=92)
-                                                      Conds:RS_35._col0=RS_36._col0(Inner),Output:["_col1","_col2","_col3"]
-                                                    <-Map 14 [SIMPLE_EDGE]
-                                                      SHUFFLE [RS_35]
-                                                        PartitionCols:_col0
-                                                        Select Operator [SEL_28] (rows=14398467 width=92)
-                                                          Output:["_col0","_col1","_col2","_col3"]
-                                                          Filter Operator [FIL_138] (rows=14398467 width=92)
-                                                            predicate:(wr_returned_date_sk is not null and wr_returning_addr_sk is not null)
-                                                            TableScan [TS_26] (rows=14398467 width=92)
-                                                              default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_returned_date_sk","wr_returning_customer_sk","wr_returning_addr_sk","wr_return_amt"]
-                                                    <-Map 18 [SIMPLE_EDGE]
-                                                      SHUFFLE [RS_36]
-                                                        PartitionCols:_col0
-                                                        Select Operator [SEL_31] (rows=36524 width=1119)
-                                                          Output:["_col0"]
-                                                          Filter Operator [FIL_139] (rows=36524 width=1119)
-                                                            predicate:((d_year = 2002) and d_date_sk is not null)
-                                                            TableScan [TS_29] (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_64]
+                        <-Reducer 9 [SIMPLE_EDGE]
+                          SHUFFLE [RS_51]
+                            PartitionCols:_col1
+                            Select Operator [SEL_25] (rows=22000000 width=1014)
+                              Output:["_col0","_col1","_col2"]
+                              Group By Operator [GBY_24] (rows=22000000 width=1014)
+                                Output:["_col0","_col1","_col2"],aggregations:["sum(VALUE._col0)"],keys:KEY._col0, KEY._col1
+                              <-Reducer 8 [SIMPLE_EDGE]
+                                SHUFFLE [RS_23]
+                                  PartitionCols:_col0, _col1
+                                  Group By Operator [GBY_22] (rows=44000000 width=1014)
+                                    Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col7, _col1
+                                    Merge Join Operator [MERGEJOIN_101] (rows=44000000 width=1014)
+                                      Conds:RS_18._col2=RS_19._col0(Inner),Output:["_col1","_col3","_col7"]
+                                    <-Map 12 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_19]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_14] (rows=40000000 width=1014)
+                                          Output:["_col0","_col1"]
+                                          Filter Operator [FIL_95] (rows=40000000 width=1014)
+                                            predicate: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"]
+                                    <-Reducer 7 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_18]
+                                        PartitionCols:_col2
+                                        Merge Join Operator [MERGEJOIN_100] (rows=15838314 width=92)
+                                          Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col1","_col2","_col3"]
+                                        <-Map 11 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_16]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_11] (rows=36524 width=1119)
+                                              Output:["_col0"]
+                                              Filter Operator [FIL_94] (rows=36524 width=1119)
+                                                predicate:((d_year = 2002) and d_date_sk is not null)
+                                                TableScan [TS_9] (rows=73049 width=1119)
+                                                  default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_year"]
+                                        <-Map 6 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_15]
+                                            PartitionCols:_col0
+                                            Select Operator [SEL_8] (rows=14398467 width=92)
+                                              Output:["_col0","_col1","_col2","_col3"]
+                                              Filter Operator [FIL_93] (rows=14398467 width=92)
+                                                predicate:(wr_returned_date_sk is not null and wr_returning_addr_sk is not null and wr_returning_customer_sk is not null)
+                                                TableScan [TS_6] (rows=14398467 width=92)
+                                                  default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_returned_date_sk","wr_returning_customer_sk","wr_returning_addr_sk","wr_return_amt"]
+                    <-Reducer 2 [SIMPLE_EDGE]
+                      SHUFFLE [RS_58]
+                        PartitionCols:_col0
+                        Merge Join Operator [MERGEJOIN_99] (rows=88000001 width=860)
+                          Conds:RS_55._col2=RS_56._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
+                        <-Map 1 [SIMPLE_EDGE]
+                          SHUFFLE [RS_55]
+                            PartitionCols:_col2
+                            Select Operator [SEL_2] (rows=80000000 width=860)
+                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
+                              Filter Operator [FIL_91] (rows=80000000 width=860)
+                                predicate:(c_customer_sk is not null and c_current_addr_sk is not null)
+                                TableScan [TS_0] (rows=80000000 width=860)
+                                  default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id","c_current_addr_sk","c_salutation","c_first_name","c_last_name","c_preferred_cust_flag","c_birth_day","c_birth_month","c_birth_year","c_birth_country","c_login","c_email_address","c_last_review_date"]
+                        <-Map 5 [SIMPLE_EDGE]
+                          SHUFFLE [RS_56]
                             PartitionCols:_col0
-                            Merge Join Operator [MERGEJOIN_144] (rows=88000001 width=860)
-                              Conds:RS_61._col2=RS_62._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                            <-Map 1 [SIMPLE_EDGE]
-                              SHUFFLE [RS_61]
-                                PartitionCols:_col2
-                                Select Operator [SEL_2] (rows=80000000 width=860)
-                                  Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13"]
-                                  Filter Operator [FIL_133] (rows=80000000 width=860)
-                                    predicate:(c_customer_sk is not null and c_current_addr_sk is not null)
-                                    TableScan [TS_0] (rows=80000000 width=860)
-                                      default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_customer_id","c_current_addr_sk","c_salutation","c_first_name","c_last_name","c_preferred_cust_flag","c_birth_day","c_birth_month","c_birth_year","c_birth_country","c_login","c_email_address","c_last_review_date"]
-                            <-Map 6 [SIMPLE_EDGE]
-                              SHUFFLE [RS_62]
-                                PartitionCols:_col0
-                                Select Operator [SEL_5] (rows=20000000 width=1014)
-                                  Output:["_col0"]
-                                  Filter Operator [FIL_134] (rows=20000000 width=1014)
-                                    predicate:((ca_state = 'IL') and ca_address_sk is not null)
-                                    TableScan [TS_3] (rows=40000000 width=1014)
-                                      default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
+                            Select Operator [SEL_5] (rows=20000000 width=1014)
+                              Output:["_col0"]
+                              Filter Operator [FIL_92] (rows=20000000 width=1014)
+                                predicate:((ca_state = 'IL') and ca_address_sk is not null)
+                                TableScan [TS_3] (rows=40000000 width=1014)
+                                  default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/a113ede9/ql/src/test/results/clientpositive/perf/query6.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query6.q.out b/ql/src/test/results/clientpositive/perf/query6.q.out
index aede0d7..183c2ec 100644
--- a/ql/src/test/results/clientpositive/perf/query6.q.out
+++ b/ql/src/test/results/clientpositive/perf/query6.q.out
@@ -1,4 +1,4 @@
-Warning: Shuffle Join MERGEJOIN[129][tables = [$hdt$_5, $hdt$_6]] in Stage 'Reducer 17' is a cross product
+Warning: Shuffle Join MERGEJOIN[111][tables = [$hdt$_5, $hdt$_6]] in Stage 'Reducer 16' is a cross product
 PREHOOK: query: explain select  a.ca_state state, count(*) cnt
  from customer_address a
      ,customer c
@@ -50,207 +50,180 @@ POSTHOOK: type: QUERY
 Plan optimized by CBO.
 
 Vertex dependency in root stage
-Reducer 10 <- Map 9 (SIMPLE_EDGE)
-Reducer 13 <- Map 12 (SIMPLE_EDGE), Map 14 (SIMPLE_EDGE)
-Reducer 16 <- Map 15 (SIMPLE_EDGE)
-Reducer 17 <- Reducer 16 (CUSTOM_SIMPLE_EDGE), Reducer 21 (CUSTOM_SIMPLE_EDGE)
-Reducer 18 <- Map 22 (SIMPLE_EDGE), Reducer 17 (SIMPLE_EDGE)
-Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 10 (SIMPLE_EDGE)
-Reducer 20 <- Map 19 (SIMPLE_EDGE)
-Reducer 21 <- Reducer 20 (CUSTOM_SIMPLE_EDGE)
-Reducer 24 <- Map 23 (SIMPLE_EDGE)
-Reducer 3 <- Map 11 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
-Reducer 4 <- Reducer 13 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
-Reducer 5 <- Reducer 18 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
-Reducer 6 <- Reducer 24 (SIMPLE_EDGE), Reducer 5 (SIMPLE_EDGE)
+Reducer 12 <- Map 11 (SIMPLE_EDGE), Map 13 (SIMPLE_EDGE)
+Reducer 15 <- Map 14 (SIMPLE_EDGE)
+Reducer 16 <- Reducer 15 (CUSTOM_SIMPLE_EDGE), Reducer 20 (CUSTOM_SIMPLE_EDGE)
+Reducer 17 <- Map 21 (SIMPLE_EDGE), Reducer 16 (SIMPLE_EDGE)
+Reducer 19 <- Map 18 (SIMPLE_EDGE)
+Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 9 (SIMPLE_EDGE)
+Reducer 20 <- Reducer 19 (CUSTOM_SIMPLE_EDGE)
+Reducer 3 <- Map 10 (SIMPLE_EDGE), Reducer 2 (SIMPLE_EDGE)
+Reducer 4 <- Reducer 12 (SIMPLE_EDGE), Reducer 3 (SIMPLE_EDGE)
+Reducer 5 <- Reducer 17 (SIMPLE_EDGE), Reducer 4 (SIMPLE_EDGE)
+Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
 Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
-Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+Reducer 9 <- Map 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
     limit:100
     Stage-1
-      Reducer 8
-      File Output Operator [FS_93]
-        Limit [LIM_92] (rows=100 width=88)
+      Reducer 7
+      File Output Operator [FS_77]
+        Limit [LIM_76] (rows=100 width=88)
           Number of rows:100
-          Select Operator [SEL_91] (rows=46850848 width=88)
+          Select Operator [SEL_75] (rows=42591679 width=88)
             Output:["_col0","_col1"]
-          <-Reducer 7 [SIMPLE_EDGE]
-            SHUFFLE [RS_90]
-              Filter Operator [FIL_88] (rows=46850848 width=88)
+          <-Reducer 6 [SIMPLE_EDGE]
+            SHUFFLE [RS_74]
+              Filter Operator [FIL_72] (rows=42591679 width=88)
                 predicate:(_col1 >= 10)
-                Group By Operator [GBY_87] (rows=140552546 width=88)
+                Group By Operator [GBY_71] (rows=127775039 width=88)
                   Output:["_col0","_col1"],aggregations:["count(VALUE._col0)"],keys:KEY._col0
-                <-Reducer 6 [SIMPLE_EDGE]
-                  SHUFFLE [RS_86]
+                <-Reducer 5 [SIMPLE_EDGE]
+                  SHUFFLE [RS_70]
                     PartitionCols:_col0
-                    Group By Operator [GBY_85] (rows=281105093 width=88)
+                    Group By Operator [GBY_69] (rows=255550079 width=88)
                       Output:["_col0","_col1"],aggregations:["count()"],keys:_col1
-                      Select Operator [SEL_84] (rows=281105093 width=88)
+                      Select Operator [SEL_68] (rows=255550079 width=88)
                         Output:["_col1"]
-                        Filter Operator [FIL_83] (rows=281105093 width=88)
-                          predicate:(_col10 > (1.2 * CASE WHEN (_col17 is null) THEN (null) ELSE (_col16) END))
-                          Merge Join Operator [MERGEJOIN_133] (rows=843315281 width=88)
-                            Conds:RS_80._col11=RS_81._col2(Left Outer),Output:["_col1","_col10","_col16","_col17"]
-                          <-Reducer 24 [SIMPLE_EDGE]
-                            SHUFFLE [RS_81]
-                              PartitionCols:_col2
-                              Select Operator [SEL_79] (rows=231000 width=1436)
-                                Output:["_col0","_col1","_col2"]
-                                Group By Operator [GBY_78] (rows=231000 width=1436)
-                                  Output:["_col0","_col1"],aggregations:["avg(VALUE._col0)"],keys:KEY._col0
-                                <-Map 23 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_77]
-                                    PartitionCols:_col0
-                                    Group By Operator [GBY_76] (rows=462000 width=1436)
-                                      Output:["_col0","_col1"],aggregations:["avg(i_current_price)"],keys:i_category
-                                      Filter Operator [FIL_125] (rows=462000 width=1436)
-                                        predicate:i_category is not null
-                                        TableScan [TS_73] (rows=462000 width=1436)
-                                          default@item,j,Tbl:COMPLETE,Col:NONE,Output:["i_current_price","i_category"]
-                          <-Reducer 5 [SIMPLE_EDGE]
-                            SHUFFLE [RS_80]
-                              PartitionCols:_col11
-                              Select Operator [SEL_72] (rows=766650239 width=88)
-                                Output:["_col1","_col10","_col11"]
-                                Merge Join Operator [MERGEJOIN_132] (rows=766650239 width=88)
-                                  Conds:RS_69._col5=RS_70._col0(Inner),Output:["_col1","_col2","_col11"]
-                                <-Reducer 18 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_70]
+                        Filter Operator [FIL_67] (rows=255550079 width=88)
+                          predicate:(_col10 > (1.2 * CASE WHEN (_col15 is null) THEN (null) ELSE (_col14) END))
+                          Select Operator [SEL_66] (rows=766650239 width=88)
+                            Output:["_col1","_col10","_col14","_col15"]
+                            Merge Join Operator [MERGEJOIN_114] (rows=766650239 width=88)
+                              Conds:RS_63._col6=RS_64._col0(Inner),Output:["_col1","_col3","_col4","_col12"]
+                            <-Reducer 17 [SIMPLE_EDGE]
+                              SHUFFLE [RS_64]
+                                PartitionCols:_col0
+                                Select Operator [SEL_53] (rows=80353 width=1119)
+                                  Output:["_col0"]
+                                  Merge Join Operator [MERGEJOIN_112] (rows=80353 width=1119)
+                                    Conds:RS_50._col0=RS_51._col1(Inner),Output:["_col2"]
+                                  <-Map 21 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_51]
+                                      PartitionCols:_col1
+                                      Select Operator [SEL_46] (rows=73049 width=1119)
+                                        Output:["_col0","_col1"]
+                                        Filter Operator [FIL_107] (rows=73049 width=1119)
+                                          predicate:(d_date_sk is not null and d_month_seq is not null)
+                                          TableScan [TS_44] (rows=73049 width=1119)
+                                            default@date_dim,d,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_month_seq"]
+                                  <-Reducer 16 [SIMPLE_EDGE]
+                                    SHUFFLE [RS_50]
+                                      PartitionCols:_col0
+                                      Merge Join Operator [MERGEJOIN_111] (rows=9131 width=1128)
+                                        Conds:(Inner),Output:["_col0"]
+                                      <-Reducer 15 [CUSTOM_SIMPLE_EDGE]
+                                        PARTITION_ONLY_SHUFFLE [RS_47]
+                                          Group By Operator [GBY_28] (rows=9131 width=1119)
+                                            Output:["_col0"],keys:KEY._col0
+                                          <-Map 14 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_27]
+                                              PartitionCols:_col0
+                                              Group By Operator [GBY_26] (rows=18262 width=1119)
+                                                Output:["_col0"],keys:d_month_seq
+                                                Select Operator [SEL_25] (rows=18262 width=1119)
+                                                  Output:["d_month_seq"]
+                                                  Filter Operator [FIL_105] (rows=18262 width=1119)
+                                                    predicate:((d_year = 2000) and (d_moy = 2) and d_month_seq is not null)
+                                                    TableScan [TS_23] (rows=73049 width=1119)
+                                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_year","d_moy"]
+                                      <-Reducer 20 [CUSTOM_SIMPLE_EDGE]
+                                        PARTITION_ONLY_SHUFFLE [RS_48]
+                                          Select Operator [SEL_43] (rows=1 width=8)
+                                            Filter Operator [FIL_42] (rows=1 width=8)
+                                              predicate:(sq_count_check(_col0) <= 1)
+                                              Group By Operator [GBY_40] (rows=1 width=8)
+                                                Output:["_col0"],aggregations:["count(VALUE._col0)"]
+                                              <-Reducer 19 [CUSTOM_SIMPLE_EDGE]
+                                                PARTITION_ONLY_SHUFFLE [RS_39]
+                                                  Group By Operator [GBY_38] (rows=1 width=8)
+                                                    Output:["_col0"],aggregations:["count()"]
+                                                    Select Operator [SEL_36] (rows=9131 width=1119)
+                                                      Group By Operator [GBY_35] (rows=9131 width=1119)
+                                                        Output:["_col0"],keys:KEY._col0
+                                                      <-Map 18 [SIMPLE_EDGE]
+                                                        SHUFFLE [RS_34]
+                                                          PartitionCols:_col0
+                                                          Group By Operator [GBY_33] (rows=18262 width=1119)
+                                                            Output:["_col0"],keys:d_month_seq
+                                                            Select Operator [SEL_32] (rows=18262 width=1119)
+                                                              Output:["d_month_seq"]
+                                                              Filter Operator [FIL_106] (rows=18262 width=1119)
+                                                                predicate:((d_year = 2000) and (d_moy = 2))
+                                                                TableScan [TS_30] (rows=73049 width=1119)
+                                                                  default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_year","d_moy"]
+                            <-Reducer 4 [SIMPLE_EDGE]
+                              SHUFFLE [RS_63]
+                                PartitionCols:_col6
+                                Merge Join Operator [MERGEJOIN_113] (rows=696954748 width=88)
+                                  Conds:RS_60._col8=RS_61._col0(Inner),Output:["_col1","_col3","_col4","_col6","_col12"]
+                                <-Reducer 12 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_61]
                                     PartitionCols:_col0
-                                    Select Operator [SEL_59] (rows=80353 width=1119)
-                                      Output:["_col0"]
-                                      Merge Join Operator [MERGEJOIN_130] (rows=80353 width=1119)
-                                        Conds:RS_56._col0=RS_57._col1(Inner),Output:["_col2"]
-                                      <-Map 22 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_57]
-                                          PartitionCols:_col1
-                                          Select Operator [SEL_52] (rows=73049 width=1119)
-                                            Output:["_col0","_col1"]
-                                            Filter Operator [FIL_124] (rows=73049 width=1119)
-                                              predicate:(d_date_sk is not null and d_month_seq is not null)
-                                              TableScan [TS_50] (rows=73049 width=1119)
-                                                default@date_dim,d,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_month_seq"]
-                                      <-Reducer 17 [SIMPLE_EDGE]
-                                        SHUFFLE [RS_56]
-                                          PartitionCols:_col0
-                                          Merge Join Operator [MERGEJOIN_129] (rows=9131 width=1128)
-                                            Conds:(Inner),Output:["_col0"]
-                                          <-Reducer 16 [CUSTOM_SIMPLE_EDGE]
-                                            PARTITION_ONLY_SHUFFLE [RS_53]
-                                              Group By Operator [GBY_34] (rows=9131 width=1119)
-                                                Output:["_col0"],keys:KEY._col0
-                                              <-Map 15 [SIMPLE_EDGE]
-                                                SHUFFLE [RS_33]
-                                                  PartitionCols:_col0
-                                                  Group By Operator [GBY_32] (rows=18262 width=1119)
-                                                    Output:["_col0"],keys:d_month_seq
-                                                    Select Operator [SEL_31] (rows=18262 width=1119)
-                                                      Output:["d_month_seq"]
-                                                      Filter Operator [FIL_122] (rows=18262 width=1119)
-                                                        predicate:((d_year = 2000) and (d_moy = 2) and d_month_seq is not null)
-                                                        TableScan [TS_29] (rows=73049 width=1119)
-                                                          default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_year","d_moy"]
-                                          <-Reducer 21 [CUSTOM_SIMPLE_EDGE]
-                                            PARTITION_ONLY_SHUFFLE [RS_54]
-                                              Select Operator [SEL_49] (rows=1 width=8)
-                                                Filter Operator [FIL_48] (rows=1 width=8)
-                                                  predicate:(sq_count_check(_col0) <= 1)
-                                                  Group By Operator [GBY_46] (rows=1 width=8)
-                                                    Output:["_col0"],aggregations:["count(VALUE._col0)"]
-                                                  <-Reducer 20 [CUSTOM_SIMPLE_EDGE]
-                                                    PARTITION_ONLY_SHUFFLE [RS_45]
-                                                      Group By Operator [GBY_44] (rows=1 width=8)
-                                                        Output:["_col0"],aggregations:["count()"]
-                                                        Select Operator [SEL_42] (rows=9131 width=1119)
-                                                          Group By Operator [GBY_41] (rows=9131 width=1119)
-                                                            Output:["_col0"],keys:KEY._col0
-                                                          <-Map 19 [SIMPLE_EDGE]
-                                                            SHUFFLE [RS_40]
-                                                              PartitionCols:_col0
-                                                              Group By Operator [GBY_39] (rows=18262 width=1119)
-                                                                Output:["_col0"],keys:d_month_seq
-                                                                Select Operator [SEL_38] (rows=18262 width=1119)
-                                                                  Output:["d_month_seq"]
-                                                                  Filter Operator [FIL_123] (rows=18262 width=1119)
-                                                                    predicate:((d_year = 2000) and (d_moy = 2))
-                                                                    TableScan [TS_36] (rows=73049 width=1119)
-                                                                      default@date_dim,date_dim,Tbl:COMPLETE,Col:NONE,Output:["d_month_seq","d_year","d_moy"]
-                                <-Reducer 4 [SIMPLE_EDGE]
-                                  SHUFFLE [RS_69]
-                                    PartitionCols:_col5
-                                    Merge Join Operator [MERGEJOIN_131] (rows=696954748 width=88)
-                                      Conds:RS_66._col7=RS_67._col0(Inner),Output:["_col1","_col2","_col5","_col11"]
-                                    <-Reducer 13 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_67]
+                                    Merge Join Operator [MERGEJOIN_110] (rows=88000001 width=860)
+                                      Conds:RS_19._col1=RS_20._col0(Inner),Output:["_col0","_col3"]
+                                    <-Map 11 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_19]
+                                        PartitionCols:_col1
+                                        Select Operator [SEL_15] (rows=80000000 width=860)
+                                          Output:["_col0","_col1"]
+                                          Filter Operator [FIL_103] (rows=80000000 width=860)
+                                            predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
+                                            TableScan [TS_13] (rows=80000000 width=860)
+                                              default@customer,c,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
+                                    <-Map 13 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_20]
+                                        PartitionCols:_col0
+                                        Select Operator [SEL_18] (rows=40000000 width=1014)
+                                          Output:["_col0","_col1"]
+                                          Filter Operator [FIL_104] (rows=40000000 width=1014)
+                                            predicate:ca_address_sk is not null
+                                            TableScan [TS_16] (rows=40000000 width=1014)
+                                              default@customer_address,a,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
+                                <-Reducer 3 [SIMPLE_EDGE]
+                                  SHUFFLE [RS_60]
+                                    PartitionCols:_col8
+                                    Merge Join Operator [MERGEJOIN_109] (rows=633595212 width=88)
+                                      Conds:RS_57._col0=RS_58._col1(Inner),Output:["_col1","_col3","_col4","_col6","_col8"]
+                                    <-Map 10 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_58]
+                                        PartitionCols:_col1
+                                        Select Operator [SEL_12] (rows=575995635 width=88)
+                                          Output:["_col0","_col1","_col2"]
+                                          Filter Operator [FIL_102] (rows=575995635 width=88)
+                                            predicate:(ss_customer_sk is not null and ss_sold_date_sk is not null and ss_item_sk is not null)
+                                            TableScan [TS_10] (rows=575995635 width=88)
+                                              default@store_sales,s,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk"]
+                                    <-Reducer 2 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_57]
                                         PartitionCols:_col0
-                                        Merge Join Operator [MERGEJOIN_128] (rows=88000001 width=860)
-                                          Conds:RS_25._col1=RS_26._col0(Inner),Output:["_col0","_col3"]
-                                        <-Map 12 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_25]
-                                            PartitionCols:_col1
-                                            Select Operator [SEL_21] (rows=80000000 width=860)
-                                              Output:["_col0","_col1"]
-                                              Filter Operator [FIL_120] (rows=80000000 width=860)
-                                                predicate:(c_current_addr_sk is not null and c_customer_sk is not null)
-                                                TableScan [TS_19] (rows=80000000 width=860)
-                                                  default@customer,c,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_addr_sk"]
-                                        <-Map 14 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_26]
-                                            PartitionCols:_col0
-                                            Select Operator [SEL_24] (rows=40000000 width=1014)
-                                              Output:["_col0","_col1"]
-                                              Filter Operator [FIL_121] (rows=40000000 width=1014)
-                                                predicate:ca_address_sk is not null
-                                                TableScan [TS_22] (rows=40000000 width=1014)
-                                                  default@customer_address,a,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state"]
-                                    <-Reducer 3 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_66]
-                                        PartitionCols:_col7
-                                        Merge Join Operator [MERGEJOIN_127] (rows=633595212 width=88)
-                                          Conds:RS_63._col0=RS_64._col1(Inner),Output:["_col1","_col2","_col5","_col7"]
-                                        <-Map 11 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_64]
-                                            PartitionCols:_col1
-                                            Select Operator [SEL_18] (rows=575995635 width=88)
+                                        Merge Join Operator [MERGEJOIN_108] (rows=508200 width=1436)
+                                          Conds:RS_54._col2=RS_55._col2(Left Outer),Output:["_col0","_col1","_col3","_col4"]
+                                        <-Map 1 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_54]
+                                            PartitionCols:_col2
+                                            Select Operator [SEL_2] (rows=462000 width=1436)
                                               Output:["_col0","_col1","_col2"]
-                                              Filter Operator [FIL_119] (rows=575995635 width=88)
-                                                predicate:(ss_customer_sk is not null and ss_sold_date_sk is not null and ss_item_sk is not null)
-                                                TableScan [TS_16] (rows=575995635 width=88)
-                                                  default@store_sales,s,Tbl:COMPLETE,Col:NONE,Output:["ss_sold_date_sk","ss_item_sk","ss_customer_sk"]
-                                        <-Reducer 2 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_63]
-                                            PartitionCols:_col0
-                                            Merge Join Operator [MERGEJOIN_126] (rows=508200 width=1436)
-                                              Conds:RS_60._col2=RS_61._col0(Left Outer),Output:["_col0","_col1","_col2"]
-                                            <-Map 1 [SIMPLE_EDGE]
-                                              SHUFFLE [RS_60]
-                                                PartitionCols:_col2
-                                                Select Operator [SEL_2] (rows=462000 width=1436)
-                                                  Output:["_col0","_col1","_col2"]
-                                                  Filter Operator [FIL_117] (rows=462000 width=1436)
-                                                    predicate:i_item_sk is not null
-                                                    TableScan [TS_0] (rows=462000 width=1436)
-                                                      default@item,i,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_current_price","i_category"]
-                                            <-Reducer 10 [SIMPLE_EDGE]
-                                              SHUFFLE [RS_61]
-                                                PartitionCols:_col0
-                                                Select Operator [SEL_15] (rows=38500 width=1436)
-                                                  Output:["_col0"]
-                                                  Filter Operator [FIL_14] (rows=38500 width=1436)
-                                                    predicate:(sq_count_check(_col1) <= 1)
-                                                    Group By Operator [GBY_13] (rows=115500 width=1436)
-                                                      Output:["_col0","_col1"],aggregations:["count()"],keys:_col0
-                                                      Group By Operator [GBY_8] (rows=231000 width=1436)
-                                                        Output:["_col0"],keys:KEY._col0
-                                                      <-Map 9 [SIMPLE_EDGE]
-                                                        SHUFFLE [RS_7]
-                                                          PartitionCols:_col0
-                                                          Group By Operator [GBY_6] (rows=462000 width=1436)
-                                                            Output:["_col0"],keys:i_category
-                                                            Filter Operator [FIL_118] (rows=462000 width=1436)
-                                                              predicate:i_category is not null
-                                                              TableScan [TS_3] (rows=462000 width=1436)
-                                                                default@item,j,Tbl:COMPLETE,Col:NONE,Output:["i_category"]
+                                              Filter Operator [FIL_100] (rows=462000 width=1436)
+                                                predicate:i_item_sk is not null
+                                                TableScan [TS_0] (rows=462000 width=1436)
+                                                  default@item,i,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_current_price","i_category"]
+                                        <-Reducer 9 [SIMPLE_EDGE]
+                                          SHUFFLE [RS_55]
+                                            PartitionCols:_col2
+                                            Select Operator [SEL_9] (rows=231000 width=1436)
+                                              Output:["_col0","_col1","_col2"]
+                                              Group By Operator [GBY_8] (rows=231000 width=1436)
+                                                Output:["_col0","_col1"],aggregations:["avg(VALUE._col0)"],keys:KEY._col0
+                                              <-Map 8 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_7]
+                                                  PartitionCols:_col0
+                                                  Group By Operator [GBY_6] (rows=462000 width=1436)
+                                                    Output:["_col0","_col1"],aggregations:["avg(i_current_price)"],keys:i_category
+                                                    Filter Operator [FIL_101] (rows=462000 width=1436)
+                                                      predicate:i_category is not null
+                                                      TableScan [TS_3] (rows=462000 width=1436)
+                                                        default@item,j,Tbl:COMPLETE,Col:NONE,Output:["i_current_price","i_category"]