You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by we...@apache.org on 2017/05/24 23:52:22 UTC

[48/54] [abbrv] hive git commit: HIVE-15160: Can't order by an unselected column (Pengcheng Xiong, reviewed by Ashutosh Chauhan)

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/perf/query81.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query81.q.out b/ql/src/test/results/clientpositive/perf/query81.q.out
index dfd4639..3acee4d 100644
--- a/ql/src/test/results/clientpositive/perf/query81.q.out
+++ b/ql/src/test/results/clientpositive/perf/query81.q.out
@@ -72,143 +72,145 @@ Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
-    limit:100
+    limit:-1
     Stage-1
       Reducer 4
-      File Output Operator [FS_67]
-        Limit [LIM_66] (rows=100 width=860)
-          Number of rows:100
-          Select Operator [SEL_65] (rows=32266667 width=860)
-            Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
-          <-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","_col11","_col12","_col13","_col14","_col15"]
-                Filter Operator [FIL_62] (rows=32266667 width=860)
-                  predicate:(_col2 > CASE WHEN (_col22 is null) THEN (null) ELSE (_col21) END)
-                  Select Operator [SEL_61] (rows=96800003 width=860)
-                    Output:["_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col11","_col12","_col13","_col14","_col16","_col18","_col19","_col20","_col21","_col22"]
-                    Merge Join Operator [MERGEJOIN_105] (rows=96800003 width=860)
-                      Conds:RS_58._col0=RS_59._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col7","_col8","_col9","_col10","_col11","_col12","_col14","_col15","_col16","_col17","_col20","_col21","_col22"]
-                    <-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 13 [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 12 [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_103] (rows=44000000 width=1014)
-                                          Conds:RS_38._col2=RS_39._col0(Inner),Output:["_col1","_col3","_col7"]
-                                        <-Map 15 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_39]
-                                            PartitionCols:_col0
-                                            Select Operator [SEL_34] (rows=40000000 width=1014)
-                                              Output:["_col0","_col1"]
-                                              Filter Operator [FIL_98] (rows=40000000 width=1014)
-                                                predicate:(ca_address_sk is not null and ca_state 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 11 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_38]
-                                            PartitionCols:_col2
-                                            Merge Join Operator [MERGEJOIN_102] (rows=31678769 width=106)
-                                              Conds:RS_35._col0=RS_36._col0(Inner),Output:["_col1","_col2","_col3"]
-                                            <-Map 14 [SIMPLE_EDGE]
-                                              SHUFFLE [RS_36]
-                                                PartitionCols:_col0
-                                                Select Operator [SEL_31] (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_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_35]
-                                                PartitionCols:_col0
-                                                Select Operator [SEL_28] (rows=28798881 width=106)
-                                                  Output:["_col0","_col1","_col2","_col3"]
-                                                  Filter Operator [FIL_96] (rows=28798881 width=106)
-                                                    predicate:(cr_returned_date_sk is not null and cr_returning_addr_sk is not null)
-                                                    TableScan [TS_6] (rows=28798881 width=106)
-                                                      default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_returned_date_sk","cr_returning_customer_sk","cr_returning_addr_sk","cr_return_amt_inc_tax"]
-                        <-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 15 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_19]
+      File Output Operator [FS_68]
+        Select Operator [SEL_67] (rows=100 width=860)
+          Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14","_col15"]
+          Limit [LIM_66] (rows=100 width=860)
+            Number of rows:100
+            Select Operator [SEL_65] (rows=32266667 width=860)
+              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8","_col9","_col10","_col11","_col12","_col13","_col14"]
+            <-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","_col13","_col14"]
+                  Filter Operator [FIL_62] (rows=32266667 width=860)
+                    predicate:(_col2 > CASE WHEN (_col22 is null) THEN (null) ELSE (_col21) END)
+                    Select Operator [SEL_61] (rows=96800003 width=860)
+                      Output:["_col2","_col4","_col5","_col6","_col7","_col8","_col9","_col11","_col12","_col13","_col14","_col16","_col18","_col19","_col20","_col21","_col22"]
+                      Merge Join Operator [MERGEJOIN_106] (rows=96800003 width=860)
+                        Conds:RS_58._col0=RS_59._col0(Inner),Output:["_col1","_col3","_col4","_col5","_col7","_col8","_col9","_col10","_col11","_col12","_col14","_col15","_col16","_col17","_col20","_col21","_col22"]
+                      <-Reducer 10 [SIMPLE_EDGE]
+                        SHUFFLE [RS_59]
+                          PartitionCols:_col0
+                          Merge Join Operator [MERGEJOIN_105] (rows=24200000 width=1014)
+                            Conds:RS_51._col1=RS_52._col2(Left Outer),Output:["_col0","_col2","_col3","_col4"]
+                          <-Reducer 13 [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 12 [SIMPLE_EDGE]
+                                      SHUFFLE [RS_43]
                                         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
-                                             Please refer to the previous TableScan [TS_12]
-                                    <-Reducer 7 [SIMPLE_EDGE]
-                                      SHUFFLE [RS_18]
-                                        PartitionCols:_col2
-                                        Merge Join Operator [MERGEJOIN_100] (rows=31678769 width=106)
-                                          Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col1","_col2","_col3"]
-                                        <-Map 14 [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 = 1998) and d_date_sk is not null)
-                                                 Please refer to the previous TableScan [TS_9]
-                                        <-Map 6 [SIMPLE_EDGE]
-                                          SHUFFLE [RS_15]
-                                            PartitionCols:_col0
-                                            Select Operator [SEL_8] (rows=28798881 width=106)
-                                              Output:["_col0","_col1","_col2","_col3"]
-                                              Filter Operator [FIL_93] (rows=28798881 width=106)
-                                                predicate:(cr_returned_date_sk is not null and cr_returning_addr_sk is not null and cr_returning_customer_sk is not null)
-                                                 Please refer to the previous TableScan [TS_6]
-                    <-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","_col7","_col8","_col9","_col10","_col11","_col12","_col14","_col15","_col16","_col17"]
-                        <-Map 1 [SIMPLE_EDGE]
-                          SHUFFLE [RS_55]
-                            PartitionCols:_col2
-                            Select Operator [SEL_2] (rows=80000000 width=860)
-                              Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
-                              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"]
-                        <-Map 5 [SIMPLE_EDGE]
-                          SHUFFLE [RS_56]
-                            PartitionCols:_col0
-                            Select Operator [SEL_5] (rows=20000000 width=1014)
-                              Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col8","_col9","_col10","_col11"]
-                              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_street_number","ca_street_name","ca_street_type","ca_suite_number","ca_city","ca_county","ca_state","ca_zip","ca_country","ca_gmt_offset","ca_location_type"]
+                                        Group By Operator [GBY_42] (rows=44000000 width=1014)
+                                          Output:["_col0","_col1","_col2"],aggregations:["sum(_col3)"],keys:_col7, _col1
+                                          Merge Join Operator [MERGEJOIN_104] (rows=44000000 width=1014)
+                                            Conds:RS_38._col2=RS_39._col0(Inner),Output:["_col1","_col3","_col7"]
+                                          <-Map 15 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_39]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_34] (rows=40000000 width=1014)
+                                                Output:["_col0","_col1"]
+                                                Filter Operator [FIL_99] (rows=40000000 width=1014)
+                                                  predicate:(ca_address_sk is not null and ca_state 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 11 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_38]
+                                              PartitionCols:_col2
+                                              Merge Join Operator [MERGEJOIN_103] (rows=31678769 width=106)
+                                                Conds:RS_35._col0=RS_36._col0(Inner),Output:["_col1","_col2","_col3"]
+                                              <-Map 14 [SIMPLE_EDGE]
+                                                SHUFFLE [RS_36]
+                                                  PartitionCols:_col0
+                                                  Select Operator [SEL_31] (rows=36524 width=1119)
+                                                    Output:["_col0"]
+                                                    Filter Operator [FIL_98] (rows=36524 width=1119)
+                                                      predicate:((d_year = 1998) 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_35]
+                                                  PartitionCols:_col0
+                                                  Select Operator [SEL_28] (rows=28798881 width=106)
+                                                    Output:["_col0","_col1","_col2","_col3"]
+                                                    Filter Operator [FIL_97] (rows=28798881 width=106)
+                                                      predicate:(cr_returned_date_sk is not null and cr_returning_addr_sk is not null)
+                                                      TableScan [TS_6] (rows=28798881 width=106)
+                                                        default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_returned_date_sk","cr_returning_customer_sk","cr_returning_addr_sk","cr_return_amt_inc_tax"]
+                          <-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_102] (rows=44000000 width=1014)
+                                        Conds:RS_18._col2=RS_19._col0(Inner),Output:["_col1","_col3","_col7"]
+                                      <-Map 15 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_19]
+                                          PartitionCols:_col0
+                                          Select Operator [SEL_14] (rows=40000000 width=1014)
+                                            Output:["_col0","_col1"]
+                                            Filter Operator [FIL_96] (rows=40000000 width=1014)
+                                              predicate:ca_address_sk is not null
+                                               Please refer to the previous TableScan [TS_12]
+                                      <-Reducer 7 [SIMPLE_EDGE]
+                                        SHUFFLE [RS_18]
+                                          PartitionCols:_col2
+                                          Merge Join Operator [MERGEJOIN_101] (rows=31678769 width=106)
+                                            Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col1","_col2","_col3"]
+                                          <-Map 14 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_16]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_11] (rows=36524 width=1119)
+                                                Output:["_col0"]
+                                                Filter Operator [FIL_95] (rows=36524 width=1119)
+                                                  predicate:((d_year = 1998) and d_date_sk is not null)
+                                                   Please refer to the previous TableScan [TS_9]
+                                          <-Map 6 [SIMPLE_EDGE]
+                                            SHUFFLE [RS_15]
+                                              PartitionCols:_col0
+                                              Select Operator [SEL_8] (rows=28798881 width=106)
+                                                Output:["_col0","_col1","_col2","_col3"]
+                                                Filter Operator [FIL_94] (rows=28798881 width=106)
+                                                  predicate:(cr_returned_date_sk is not null and cr_returning_addr_sk is not null and cr_returning_customer_sk is not null)
+                                                   Please refer to the previous TableScan [TS_6]
+                      <-Reducer 2 [SIMPLE_EDGE]
+                        SHUFFLE [RS_58]
+                          PartitionCols:_col0
+                          Merge Join Operator [MERGEJOIN_100] (rows=88000001 width=860)
+                            Conds:RS_55._col2=RS_56._col0(Inner),Output:["_col0","_col1","_col3","_col4","_col5","_col7","_col8","_col9","_col10","_col11","_col12","_col14","_col15","_col16","_col17"]
+                          <-Map 1 [SIMPLE_EDGE]
+                            SHUFFLE [RS_55]
+                              PartitionCols:_col2
+                              Select Operator [SEL_2] (rows=80000000 width=860)
+                                Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
+                                Filter Operator [FIL_92] (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"]
+                          <-Map 5 [SIMPLE_EDGE]
+                            SHUFFLE [RS_56]
+                              PartitionCols:_col0
+                              Select Operator [SEL_5] (rows=20000000 width=1014)
+                                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col8","_col9","_col10","_col11"]
+                                Filter Operator [FIL_93] (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_street_number","ca_street_name","ca_street_type","ca_suite_number","ca_city","ca_county","ca_state","ca_zip","ca_country","ca_gmt_offset","ca_location_type"]
 

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/perf/query85.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query85.q.out b/ql/src/test/results/clientpositive/perf/query85.q.out
index ba8659e..82df27b 100644
--- a/ql/src/test/results/clientpositive/perf/query85.q.out
+++ b/ql/src/test/results/clientpositive/perf/query85.q.out
@@ -17,10 +17,10 @@ Reducer 9 <- Reducer 8 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
-    limit:100
+    limit:-1
     Stage-1
       Reducer 10
-      File Output Operator [FS_55]
+      File Output Operator [FS_56]
         Limit [LIM_54] (rows=100 width=385)
           Number of rows:100
           Select Operator [SEL_53] (rows=1023990 width=385)
@@ -36,14 +36,14 @@ Stage-0
                     PartitionCols:_col0
                     Group By Operator [GBY_48] (rows=2047980 width=385)
                       Output:["_col0","_col1","_col2","_col3"],aggregations:["avg(_col5)","avg(_col17)","avg(_col16)"],keys:_col19
-                      Merge Join Operator [MERGEJOIN_105] (rows=2047980 width=385)
+                      Merge Join Operator [MERGEJOIN_106] (rows=2047980 width=385)
                         Conds:RS_44._col13, _col24, _col25=RS_45._col0, _col1, _col2(Inner),Output:["_col5","_col16","_col17","_col19"]
                       <-Map 16 [SIMPLE_EDGE]
                         SHUFFLE [RS_45]
                           PartitionCols:_col0, _col1, _col2
                           Select Operator [SEL_23] (rows=1861800 width=385)
                             Output:["_col0","_col1","_col2"]
-                            Filter Operator [FIL_98] (rows=1861800 width=385)
+                            Filter Operator [FIL_99] (rows=1861800 width=385)
                               predicate:(((cd_education_status = '4 yr Degree') or (cd_education_status = 'Primary') or (cd_education_status = 'Advanced Degree')) and ((cd_marital_status = 'M') or (cd_marital_status = 'D') or (cd_marital_status = 'U')) and cd_demo_sk is not null and cd_marital_status is not null and cd_education_status is not null)
                               TableScan [TS_18] (rows=1861800 width=385)
                                 default@customer_demographics,cd1,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
@@ -52,14 +52,14 @@ Stage-0
                           PartitionCols:_col13, _col24, _col25
                           Filter Operator [FIL_43] (rows=393687 width=135)
                             predicate:(((_col24 = 'M') and (_col25 = '4 yr Degree') and _col6 BETWEEN 100 AND 150) or ((_col24 = 'D') and (_col25 = 'Primary') and _col6 BETWEEN 50 AND 100) or ((_col24 = 'U') and (_col25 = 'Advanced Degree') and _col6 BETWEEN 150 AND 200))
-                            Merge Join Operator [MERGEJOIN_104] (rows=4724247 width=135)
+                            Merge Join Operator [MERGEJOIN_105] (rows=4724247 width=135)
                               Conds:RS_40._col11=RS_41._col0(Inner),Output:["_col5","_col6","_col13","_col16","_col17","_col19","_col24","_col25"]
                             <-Map 16 [SIMPLE_EDGE]
                               SHUFFLE [RS_41]
                                 PartitionCols:_col0
                                 Select Operator [SEL_20] (rows=1861800 width=385)
                                   Output:["_col0","_col1","_col2"]
-                                  Filter Operator [FIL_97] (rows=1861800 width=385)
+                                  Filter Operator [FIL_98] (rows=1861800 width=385)
                                     predicate:(((cd_education_status = '4 yr Degree') or (cd_education_status = 'Primary') or (cd_education_status = 'Advanced Degree')) and ((cd_marital_status = 'M') or (cd_marital_status = 'D') or (cd_marital_status = 'U')) and cd_demo_sk is not null and cd_marital_status is not null and cd_education_status is not null)
                                      Please refer to the previous TableScan [TS_18]
                             <-Reducer 6 [SIMPLE_EDGE]
@@ -67,70 +67,70 @@ Stage-0
                                 PartitionCols:_col11
                                 Filter Operator [FIL_39] (rows=4294770 width=135)
                                   predicate:(((_col21) IN ('KY', 'GA', 'NM') and _col7 BETWEEN 100 AND 200) or ((_col21) IN ('MT', 'OR', 'IN') and _col7 BETWEEN 150 AND 300) or ((_col21) IN ('WI', 'MO', 'WV') and _col7 BETWEEN 50 AND 250))
-                                  Merge Join Operator [MERGEJOIN_103] (rows=25768635 width=135)
+                                  Merge Join Operator [MERGEJOIN_104] (rows=25768635 width=135)
                                     Conds:RS_36._col12=RS_37._col0(Inner),Output:["_col5","_col6","_col7","_col11","_col13","_col16","_col17","_col19","_col21"]
                                   <-Map 15 [SIMPLE_EDGE]
                                     SHUFFLE [RS_37]
                                       PartitionCols:_col0
                                       Select Operator [SEL_17] (rows=10000000 width=1014)
                                         Output:["_col0","_col1"]
-                                        Filter Operator [FIL_96] (rows=10000000 width=1014)
+                                        Filter Operator [FIL_97] (rows=10000000 width=1014)
                                           predicate:((ca_state) IN ('KY', 'GA', 'NM', 'MT', 'OR', 'IN', 'WI', 'MO', 'WV') and (ca_country = 'United States') and ca_address_sk is not null)
                                           TableScan [TS_15] (rows=40000000 width=1014)
                                             default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_state","ca_country"]
                                   <-Reducer 5 [SIMPLE_EDGE]
                                     SHUFFLE [RS_36]
                                       PartitionCols:_col12
-                                      Merge Join Operator [MERGEJOIN_102] (rows=23426032 width=135)
+                                      Merge Join Operator [MERGEJOIN_103] (rows=23426032 width=135)
                                         Conds:RS_33._col14=RS_34._col0(Inner),Output:["_col5","_col6","_col7","_col11","_col12","_col13","_col16","_col17","_col19"]
                                       <-Map 14 [SIMPLE_EDGE]
                                         SHUFFLE [RS_34]
                                           PartitionCols:_col0
                                           Select Operator [SEL_14] (rows=72 width=200)
                                             Output:["_col0","_col1"]
-                                            Filter Operator [FIL_95] (rows=72 width=200)
+                                            Filter Operator [FIL_96] (rows=72 width=200)
                                               predicate:r_reason_sk is not null
                                               TableScan [TS_12] (rows=72 width=200)
                                                 default@reason,reason,Tbl:COMPLETE,Col:NONE,Output:["r_reason_sk","r_reason_desc"]
                                       <-Reducer 4 [SIMPLE_EDGE]
                                         SHUFFLE [RS_33]
                                           PartitionCols:_col14
-                                          Merge Join Operator [MERGEJOIN_101] (rows=21296393 width=135)
+                                          Merge Join Operator [MERGEJOIN_102] (rows=21296393 width=135)
                                             Conds:RS_30._col2, _col4=RS_31._col0, _col5(Inner),Output:["_col5","_col6","_col7","_col11","_col12","_col13","_col14","_col16","_col17"]
                                           <-Map 13 [SIMPLE_EDGE]
                                             SHUFFLE [RS_31]
                                               PartitionCols:_col0, _col5
                                               Select Operator [SEL_11] (rows=14398467 width=92)
                                                 Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                                                Filter Operator [FIL_94] (rows=14398467 width=92)
+                                                Filter Operator [FIL_95] (rows=14398467 width=92)
                                                   predicate:(wr_item_sk is not null and wr_order_number is not null and wr_refunded_cdemo_sk is not null and wr_returning_cdemo_sk is not null and wr_refunded_addr_sk is not null and wr_reason_sk is not null)
                                                   TableScan [TS_9] (rows=14398467 width=92)
                                                     default@web_returns,web_returns,Tbl:COMPLETE,Col:NONE,Output:["wr_item_sk","wr_refunded_cdemo_sk","wr_refunded_addr_sk","wr_returning_cdemo_sk","wr_reason_sk","wr_order_number","wr_fee","wr_refunded_cash"]
                                           <-Reducer 3 [SIMPLE_EDGE]
                                             SHUFFLE [RS_30]
                                               PartitionCols:_col2, _col4
-                                              Merge Join Operator [MERGEJOIN_100] (rows=19360357 width=135)
+                                              Merge Join Operator [MERGEJOIN_101] (rows=19360357 width=135)
                                                 Conds:RS_27._col1=RS_28._col0(Inner),Output:["_col2","_col4","_col5","_col6","_col7"]
                                               <-Map 12 [SIMPLE_EDGE]
                                                 SHUFFLE [RS_28]
                                                   PartitionCols:_col0
                                                   Select Operator [SEL_8] (rows=36524 width=1119)
                                                     Output:["_col0"]
-                                                    Filter Operator [FIL_93] (rows=36524 width=1119)
+                                                    Filter Operator [FIL_94] (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_27]
                                                   PartitionCols:_col1
-                                                  Merge Join Operator [MERGEJOIN_99] (rows=17600325 width=135)
+                                                  Merge Join Operator [MERGEJOIN_100] (rows=17600325 width=135)
                                                     Conds:RS_24._col0=RS_25._col2(Inner),Output:["_col1","_col2","_col4","_col5","_col6","_col7"]
                                                   <-Map 1 [SIMPLE_EDGE]
                                                     SHUFFLE [RS_24]
                                                       PartitionCols:_col0
                                                       Select Operator [SEL_2] (rows=4602 width=585)
                                                         Output:["_col0"]
-                                                        Filter Operator [FIL_91] (rows=4602 width=585)
+                                                        Filter Operator [FIL_92] (rows=4602 width=585)
                                                           predicate:wp_web_page_sk is not null
                                                           TableScan [TS_0] (rows=4602 width=585)
                                                             default@web_page,web_page,Tbl:COMPLETE,Col:NONE,Output:["wp_web_page_sk"]
@@ -139,7 +139,7 @@ Stage-0
                                                       PartitionCols:_col2
                                                       Select Operator [SEL_5] (rows=16000296 width=135)
                                                         Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
-                                                        Filter Operator [FIL_92] (rows=16000296 width=135)
+                                                        Filter Operator [FIL_93] (rows=16000296 width=135)
                                                           predicate:((ws_sales_price BETWEEN 100 AND 150 or ws_sales_price BETWEEN 50 AND 100 or ws_sales_price BETWEEN 150 AND 200) and (ws_net_profit BETWEEN 100 AND 200 or ws_net_profit BETWEEN 150 AND 300 or ws_net_profit BETWEEN 50 AND 250) and ws_order_number is not null and ws_item_sk is not null and ws_web_page_sk is not null and ws_sold_date_sk is not null)
                                                           TableScan [TS_3] (rows=144002668 width=135)
                                                             default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_sold_date_sk","ws_item_sk","ws_web_page_sk","ws_order_number","ws_quantity","ws_sales_price","ws_net_profit"]

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/perf/query86.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query86.q.out b/ql/src/test/results/clientpositive/perf/query86.q.out
index 734e6a4..bc86291 100644
--- a/ql/src/test/results/clientpositive/perf/query86.q.out
+++ b/ql/src/test/results/clientpositive/perf/query86.q.out
@@ -59,10 +59,10 @@ Reducer 6 <- Reducer 5 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
-    limit:100
+    limit:-1
     Stage-1
       Reducer 6
-      File Output Operator [FS_29]
+      File Output Operator [FS_30]
         Limit [LIM_28] (rows=100 width=135)
           Number of rows:100
           Select Operator [SEL_27] (rows=261364852 width=135)
@@ -70,7 +70,7 @@ Stage-0
           <-Reducer 5 [SIMPLE_EDGE]
             SHUFFLE [RS_26]
               Select Operator [SEL_24] (rows=261364852 width=135)
-                Output:["_col0","_col1","_col2","_col3","_col4"]
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5"]
                 PTF Operator [PTF_23] (rows=261364852 width=135)
                   Function definitions:[{},{"name:":"windowingtablefunction","order by:":"_col4 DESC NULLS LAST","partition by:":"(grouping(_col5, 1) + grouping(_col5, 0)), CASE WHEN ((grouping(_col5, 0) = 0)) THEN (_col0) ELSE (null) END"}]
                   Select Operator [SEL_22] (rows=261364852 width=135)
@@ -89,28 +89,28 @@ Stage-0
                               Output:["_col0","_col1","_col2","_col3"],aggregations:["sum(_col2)"],keys:_col0, _col1, 0
                               Select Operator [SEL_15] (rows=174243235 width=135)
                                 Output:["_col0","_col1","_col2"]
-                                Merge Join Operator [MERGEJOIN_39] (rows=174243235 width=135)
+                                Merge Join Operator [MERGEJOIN_40] (rows=174243235 width=135)
                                   Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col2","_col6","_col7"]
                                 <-Map 8 [SIMPLE_EDGE]
                                   SHUFFLE [RS_13]
                                     PartitionCols:_col0
                                     Select Operator [SEL_8] (rows=462000 width=1436)
                                       Output:["_col0","_col1","_col2"]
-                                      Filter Operator [FIL_37] (rows=462000 width=1436)
+                                      Filter Operator [FIL_38] (rows=462000 width=1436)
                                         predicate:i_item_sk is not null
                                         TableScan [TS_6] (rows=462000 width=1436)
                                           default@item,item,Tbl:COMPLETE,Col:NONE,Output:["i_item_sk","i_class","i_category"]
                                 <-Reducer 2 [SIMPLE_EDGE]
                                   SHUFFLE [RS_12]
                                     PartitionCols:_col1
-                                    Merge Join Operator [MERGEJOIN_38] (rows=158402938 width=135)
+                                    Merge Join Operator [MERGEJOIN_39] (rows=158402938 width=135)
                                       Conds:RS_9._col0=RS_10._col0(Inner),Output:["_col1","_col2"]
                                     <-Map 1 [SIMPLE_EDGE]
                                       SHUFFLE [RS_9]
                                         PartitionCols:_col0
                                         Select Operator [SEL_2] (rows=144002668 width=135)
                                           Output:["_col0","_col1","_col2"]
-                                          Filter Operator [FIL_35] (rows=144002668 width=135)
+                                          Filter Operator [FIL_36] (rows=144002668 width=135)
                                             predicate:(ws_sold_date_sk is not null and ws_item_sk is not null)
                                             TableScan [TS_0] (rows=144002668 width=135)
                                               default@web_sales,web_sales,Tbl:COMPLETE,Col:NONE,Output:["ws_sold_date_sk","ws_item_sk","ws_net_paid"]
@@ -119,7 +119,7 @@ Stage-0
                                         PartitionCols:_col0
                                         Select Operator [SEL_5] (rows=8116 width=1119)
                                           Output:["_col0"]
-                                          Filter Operator [FIL_36] (rows=8116 width=1119)
+                                          Filter Operator [FIL_37] (rows=8116 width=1119)
                                             predicate:(d_month_seq BETWEEN 1212 AND 1223 and d_date_sk is not null)
                                             TableScan [TS_3] (rows=73049 width=1119)
                                               default@date_dim,d1,Tbl:COMPLETE,Col:NONE,Output:["d_date_sk","d_month_seq"]

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/perf/query89.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query89.q.out b/ql/src/test/results/clientpositive/perf/query89.q.out
index 66481f7..27467bd 100644
--- a/ql/src/test/results/clientpositive/perf/query89.q.out
+++ b/ql/src/test/results/clientpositive/perf/query89.q.out
@@ -64,10 +64,10 @@ Reducer 7 <- Reducer 6 (SIMPLE_EDGE)
 
 Stage-0
   Fetch Operator
-    limit:100
+    limit:-1
     Stage-1
       Reducer 7
-      File Output Operator [FS_36]
+      File Output Operator [FS_37]
         Limit [LIM_35] (rows=100 width=88)
           Number of rows:100
           Select Operator [SEL_34] (rows=191662559 width=88)
@@ -75,8 +75,8 @@ Stage-0
           <-Reducer 6 [SIMPLE_EDGE]
             SHUFFLE [RS_33]
               Select Operator [SEL_30] (rows=191662559 width=88)
-                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7"]
-                Filter Operator [FIL_46] (rows=191662559 width=88)
+                Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6","_col7","_col8"]
+                Filter Operator [FIL_47] (rows=191662559 width=88)
                   predicate:CASE WHEN ((avg_window_0 <> 0)) THEN (((abs((_col6 - avg_window_0)) / avg_window_0) > 0.1)) ELSE (null) END
                   Select Operator [SEL_29] (rows=383325119 width=88)
                     Output:["avg_window_0","_col0","_col1","_col2","_col3","_col4","_col5","_col6"]
@@ -96,42 +96,42 @@ Stage-0
                                 PartitionCols:_col0, _col1, _col2, _col3, _col4, _col5
                                 Group By Operator [GBY_22] (rows=766650239 width=88)
                                   Output:["_col0","_col1","_col2","_col3","_col4","_col5","_col6"],aggregations:["sum(_col3)"],keys:_col5, _col6, _col7, _col10, _col12, _col13
-                                  Merge Join Operator [MERGEJOIN_53] (rows=766650239 width=88)
+                                  Merge Join Operator [MERGEJOIN_54] (rows=766650239 width=88)
                                     Conds:RS_18._col2=RS_19._col0(Inner),Output:["_col3","_col5","_col6","_col7","_col10","_col12","_col13"]
                                   <-Map 10 [SIMPLE_EDGE]
                                     SHUFFLE [RS_19]
                                       PartitionCols:_col0
                                       Select Operator [SEL_11] (rows=1704 width=1910)
                                         Output:["_col0","_col1","_col2"]
-                                        Filter Operator [FIL_50] (rows=1704 width=1910)
+                                        Filter Operator [FIL_51] (rows=1704 width=1910)
                                           predicate:s_store_sk is not null
                                           TableScan [TS_9] (rows=1704 width=1910)
                                             default@store,store,Tbl:COMPLETE,Col:NONE,Output:["s_store_sk","s_store_name","s_company_name"]
                                   <-Reducer 3 [SIMPLE_EDGE]
                                     SHUFFLE [RS_18]
                                       PartitionCols:_col2
-                                      Merge Join Operator [MERGEJOIN_52] (rows=696954748 width=88)
+                                      Merge Join Operator [MERGEJOIN_53] (rows=696954748 width=88)
                                         Conds:RS_15._col0=RS_16._col0(Inner),Output:["_col2","_col3","_col5","_col6","_col7","_col10"]
                                       <-Map 9 [SIMPLE_EDGE]
                                         SHUFFLE [RS_16]
                                           PartitionCols:_col0
                                           Select Operator [SEL_8] (rows=36525 width=1119)
                                             Output:["_col0","_col2"]
-                                            Filter Operator [FIL_49] (rows=36525 width=1119)
+                                            Filter Operator [FIL_50] (rows=36525 width=1119)
                                               predicate:((d_year) IN (2000) 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","d_moy"]
                                       <-Reducer 2 [SIMPLE_EDGE]
                                         SHUFFLE [RS_15]
                                           PartitionCols:_col0
-                                          Merge Join Operator [MERGEJOIN_51] (rows=633595212 width=88)
+                                          Merge Join Operator [MERGEJOIN_52] (rows=633595212 width=88)
                                             Conds:RS_12._col1=RS_13._col0(Inner),Output:["_col0","_col2","_col3","_col5","_col6","_col7"]
                                           <-Map 1 [SIMPLE_EDGE]
                                             SHUFFLE [RS_12]
                                               PartitionCols:_col1
                                               Select Operator [SEL_2] (rows=575995635 width=88)
                                                 Output:["_col0","_col1","_col2","_col3"]
-                                                Filter Operator [FIL_47] (rows=575995635 width=88)
+                                                Filter Operator [FIL_48] (rows=575995635 width=88)
                                                   predicate:(ss_item_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_item_sk","ss_store_sk","ss_sales_price"]
@@ -140,7 +140,7 @@ Stage-0
                                               PartitionCols:_col0
                                               Select Operator [SEL_5] (rows=231000 width=1436)
                                                 Output:["_col0","_col1","_col2","_col3"]
-                                                Filter Operator [FIL_48] (rows=231000 width=1436)
+                                                Filter Operator [FIL_49] (rows=231000 width=1436)
                                                   predicate:(((i_class) IN ('wallpaper', 'parenting', 'musical') or (i_class) IN ('womens', 'birdal', 'pants')) and ((i_category) IN ('Home', 'Books', 'Electronics') or (i_category) IN ('Shoes', 'Jewelry', 'Men')) and (((i_category) IN ('Home', 'Books', 'Electronics') and (i_class) IN ('wallpaper', 'parenting', 'musical')) or ((i_category) IN ('Shoes', 'Jewelry', 'Men') and (i_class) IN ('womens', 'birdal', '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"]

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/perf/query91.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/query91.q.out b/ql/src/test/results/clientpositive/perf/query91.q.out
index e592bba..0ee7e43 100644
--- a/ql/src/test/results/clientpositive/perf/query91.q.out
+++ b/ql/src/test/results/clientpositive/perf/query91.q.out
@@ -19,7 +19,7 @@ Stage-0
     limit:-1
     Stage-1
       Reducer 6
-      File Output Operator [FS_47]
+      File Output Operator [FS_48]
         Select Operator [SEL_46] (rows=58564004 width=860)
           Output:["_col0","_col1","_col2","_col3"]
         <-Reducer 5 [SIMPLE_EDGE]
@@ -33,49 +33,49 @@ Stage-0
                   PartitionCols:_col0, _col1, _col2, _col3, _col4
                   Group By Operator [GBY_41] (rows=117128008 width=860)
                     Output:["_col0","_col1","_col2","_col3","_col4","_col5"],aggregations:["sum(_col3)"],keys:_col8, _col9, _col10, _col18, _col19
-                    Merge Join Operator [MERGEJOIN_81] (rows=117128008 width=860)
+                    Merge Join Operator [MERGEJOIN_82] (rows=117128008 width=860)
                       Conds:RS_37._col1=RS_38._col2(Inner),Output:["_col3","_col8","_col9","_col10","_col18","_col19"]
                     <-Reducer 12 [SIMPLE_EDGE]
                       SHUFFLE [RS_38]
                         PartitionCols:_col2
                         Select Operator [SEL_30] (rows=106480005 width=860)
                           Output:["_col2","_col7","_col8"]
-                          Merge Join Operator [MERGEJOIN_80] (rows=106480005 width=860)
+                          Merge Join Operator [MERGEJOIN_81] (rows=106480005 width=860)
                             Conds:RS_27._col2=RS_28._col0(Inner),Output:["_col0","_col5","_col6"]
                           <-Map 15 [SIMPLE_EDGE]
                             SHUFFLE [RS_28]
                               PartitionCols:_col0
                               Select Operator [SEL_20] (rows=3600 width=107)
                                 Output:["_col0"]
-                                Filter Operator [FIL_75] (rows=3600 width=107)
+                                Filter Operator [FIL_76] (rows=3600 width=107)
                                   predicate:((hd_buy_potential like '0-500%') and hd_demo_sk is not null)
                                   TableScan [TS_18] (rows=7200 width=107)
                                     default@household_demographics,household_demographics,Tbl:COMPLETE,Col:NONE,Output:["hd_demo_sk","hd_buy_potential"]
                           <-Reducer 11 [SIMPLE_EDGE]
                             SHUFFLE [RS_27]
                               PartitionCols:_col2
-                              Merge Join Operator [MERGEJOIN_79] (rows=96800003 width=860)
+                              Merge Join Operator [MERGEJOIN_80] (rows=96800003 width=860)
                                 Conds:RS_24._col3=RS_25._col0(Inner),Output:["_col0","_col2","_col5","_col6"]
                               <-Map 14 [SIMPLE_EDGE]
                                 SHUFFLE [RS_25]
                                   PartitionCols:_col0
                                   Select Operator [SEL_17] (rows=20000000 width=1014)
                                     Output:["_col0"]
-                                    Filter Operator [FIL_74] (rows=20000000 width=1014)
+                                    Filter Operator [FIL_75] (rows=20000000 width=1014)
                                       predicate:((ca_gmt_offset = -7) and ca_address_sk is not null)
                                       TableScan [TS_15] (rows=40000000 width=1014)
                                         default@customer_address,customer_address,Tbl:COMPLETE,Col:NONE,Output:["ca_address_sk","ca_gmt_offset"]
                               <-Reducer 10 [SIMPLE_EDGE]
                                 SHUFFLE [RS_24]
                                   PartitionCols:_col3
-                                  Merge Join Operator [MERGEJOIN_78] (rows=88000001 width=860)
+                                  Merge Join Operator [MERGEJOIN_79] (rows=88000001 width=860)
                                     Conds:RS_21._col1=RS_22._col0(Inner),Output:["_col0","_col2","_col3","_col5","_col6"]
                                   <-Map 13 [SIMPLE_EDGE]
                                     SHUFFLE [RS_22]
                                       PartitionCols:_col0
                                       Select Operator [SEL_14] (rows=930900 width=385)
                                         Output:["_col0","_col1","_col2"]
-                                        Filter Operator [FIL_73] (rows=930900 width=385)
+                                        Filter Operator [FIL_74] (rows=930900 width=385)
                                           predicate:(((cd_education_status = 'Unknown') or (cd_education_status = 'Advanced Degree')) and ((cd_marital_status = 'M') or (cd_marital_status = 'W')) and (((cd_marital_status = 'M') and (cd_education_status = 'Unknown')) or ((cd_marital_status = 'W') and (cd_education_status = 'Advanced Degree'))) and cd_demo_sk is not null)
                                           TableScan [TS_12] (rows=1861800 width=385)
                                             default@customer_demographics,customer_demographics,Tbl:COMPLETE,Col:NONE,Output:["cd_demo_sk","cd_marital_status","cd_education_status"]
@@ -84,35 +84,35 @@ Stage-0
                                       PartitionCols:_col1
                                       Select Operator [SEL_11] (rows=80000000 width=860)
                                         Output:["_col0","_col1","_col2","_col3"]
-                                        Filter Operator [FIL_72] (rows=80000000 width=860)
+                                        Filter Operator [FIL_73] (rows=80000000 width=860)
                                           predicate:(c_customer_sk is not null and c_current_addr_sk is not null and c_current_cdemo_sk is not null and c_current_hdemo_sk is not null)
                                           TableScan [TS_9] (rows=80000000 width=860)
                                             default@customer,customer,Tbl:COMPLETE,Col:NONE,Output:["c_customer_sk","c_current_cdemo_sk","c_current_hdemo_sk","c_current_addr_sk"]
                     <-Reducer 3 [SIMPLE_EDGE]
                       SHUFFLE [RS_37]
                         PartitionCols:_col1
-                        Merge Join Operator [MERGEJOIN_77] (rows=34846646 width=106)
+                        Merge Join Operator [MERGEJOIN_78] (rows=34846646 width=106)
                           Conds:RS_34._col2=RS_35._col0(Inner),Output:["_col1","_col3","_col8","_col9","_col10"]
                         <-Map 8 [SIMPLE_EDGE]
                           SHUFFLE [RS_35]
                             PartitionCols:_col0
                             Select Operator [SEL_8] (rows=60 width=2045)
                               Output:["_col0","_col1","_col2","_col3"]
-                              Filter Operator [FIL_71] (rows=60 width=2045)
+                              Filter Operator [FIL_72] (rows=60 width=2045)
                                 predicate:cc_call_center_sk is not null
                                 TableScan [TS_6] (rows=60 width=2045)
                                   default@call_center,call_center,Tbl:COMPLETE,Col:NONE,Output:["cc_call_center_sk","cc_call_center_id","cc_name","cc_manager"]
                         <-Reducer 2 [SIMPLE_EDGE]
                           SHUFFLE [RS_34]
                             PartitionCols:_col2
-                            Merge Join Operator [MERGEJOIN_76] (rows=31678769 width=106)
+                            Merge Join Operator [MERGEJOIN_77] (rows=31678769 width=106)
                               Conds:RS_31._col0=RS_32._col0(Inner),Output:["_col1","_col2","_col3"]
                             <-Map 1 [SIMPLE_EDGE]
                               SHUFFLE [RS_31]
                                 PartitionCols:_col0
                                 Select Operator [SEL_2] (rows=28798881 width=106)
                                   Output:["_col0","_col1","_col2","_col3"]
-                                  Filter Operator [FIL_69] (rows=28798881 width=106)
+                                  Filter Operator [FIL_70] (rows=28798881 width=106)
                                     predicate:(cr_call_center_sk is not null and cr_returned_date_sk is not null and cr_returning_customer_sk is not null)
                                     TableScan [TS_0] (rows=28798881 width=106)
                                       default@catalog_returns,catalog_returns,Tbl:COMPLETE,Col:NONE,Output:["cr_returned_date_sk","cr_returning_customer_sk","cr_call_center_sk","cr_net_loss"]
@@ -121,7 +121,7 @@ Stage-0
                                 PartitionCols:_col0
                                 Select Operator [SEL_5] (rows=18262 width=1119)
                                   Output:["_col0"]
-                                  Filter Operator [FIL_70] (rows=18262 width=1119)
+                                  Filter Operator [FIL_71] (rows=18262 width=1119)
                                     predicate:((d_year = 1999) and (d_moy = 11) 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","d_moy"]

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/pointlookup2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup2.q.out b/ql/src/test/results/clientpositive/pointlookup2.q.out
index 3438c74..158e885 100644
--- a/ql/src/test/results/clientpositive/pointlookup2.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup2.q.out
@@ -374,7 +374,7 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1, $hdt$_1:t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:$hdt$_0:t1, $hdt$_0:$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -385,24 +385,28 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: int), _col4 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
+            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
 #### A masked pattern was here ####
-            NumFilesPerFileSink: 1
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  column.name.delimiter ,
-                  columns _col0,_col1,_col3,_col4
-                  columns.types int,string,int,string
-                  escape.delim \
-                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    column.name.delimiter ,
+                    columns _col0,_col1,_col2,_col3
+                    columns.types int,string,int,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -415,7 +419,7 @@ STAGE PLANS:
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
               tag: -1
-              value expressions: _col1 (type: string), _col3 (type: int), _col4 (type: string)
+              value expressions: _col1 (type: string), _col2 (type: int), _col3 (type: string)
               auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
@@ -427,7 +431,7 @@ STAGE PLANS:
             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
             properties:
               column.name.delimiter ,
-              columns _col0,_col1,_col3,_col4
+              columns _col0,_col1,_col2,_col3
               columns.types int,string,int,string
               escape.delim \
               serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -437,7 +441,7 @@ STAGE PLANS:
               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
               properties:
                 column.name.delimiter ,
-                columns _col0,_col1,_col3,_col4
+                columns _col0,_col1,_col2,_col3
                 columns.types int,string,int,string
                 escape.delim \
                 serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -640,8 +644,8 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds=2000-04-08 [$hdt$_0:t1]
-        /pcr_t1/ds=2000-04-09 [$hdt$_1:t2]
+        /pcr_t1/ds=2000-04-08 [$hdt$_0:$hdt$_0:t1]
+        /pcr_t1/ds=2000-04-09 [$hdt$_0:$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -652,24 +656,28 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3, _col4
           Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: int), _col4 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
+            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
 #### A masked pattern was here ####
-            NumFilesPerFileSink: 1
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  column.name.delimiter ,
-                  columns _col0,_col1,_col3,_col4
-                  columns.types int,string,int,string
-                  escape.delim \
-                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    column.name.delimiter ,
+                    columns _col0,_col1,_col2,_col3
+                    columns.types int,string,int,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -682,7 +690,7 @@ STAGE PLANS:
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
               tag: -1
-              value expressions: _col1 (type: string), _col3 (type: int), _col4 (type: string)
+              value expressions: _col1 (type: string), _col2 (type: int), _col3 (type: string)
               auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
@@ -694,7 +702,7 @@ STAGE PLANS:
             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
             properties:
               column.name.delimiter ,
-              columns _col0,_col1,_col3,_col4
+              columns _col0,_col1,_col2,_col3
               columns.types int,string,int,string
               escape.delim \
               serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -704,7 +712,7 @@ STAGE PLANS:
               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
               properties:
                 column.name.delimiter ,
-                columns _col0,_col1,_col3,_col4
+                columns _col0,_col1,_col2,_col3
                 columns.types int,string,int,string
                 escape.delim \
                 serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/pointlookup3.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/pointlookup3.q.out b/ql/src/test/results/clientpositive/pointlookup3.q.out
index 2c3e39f..eb61e17 100644
--- a/ql/src/test/results/clientpositive/pointlookup3.q.out
+++ b/ql/src/test/results/clientpositive/pointlookup3.q.out
@@ -307,7 +307,7 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [pcr_t1]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:pcr_t1]
       Needs Tagging: false
       Reduce Operator Tree:
         Select Operator
@@ -458,7 +458,7 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:t1, $hdt$_1:t2]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:$hdt$_0:t1, $hdt$_0:$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -469,24 +469,28 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6
           Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
 #### A masked pattern was here ####
-            NumFilesPerFileSink: 1
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  column.name.delimiter ,
-                  columns _col0,_col1,_col3,_col4,_col5,_col6
-                  columns.types int,string,string,int,string,string
-                  escape.delim \
-                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    column.name.delimiter ,
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int,string,string,int,string,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -499,7 +503,7 @@ STAGE PLANS:
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
               tag: -1
-              value expressions: _col1 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col6 (type: string)
+              value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: string)
               auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
@@ -511,7 +515,7 @@ STAGE PLANS:
             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
             properties:
               column.name.delimiter ,
-              columns _col0,_col1,_col3,_col4,_col5,_col6
+              columns _col0,_col1,_col2,_col3,_col4,_col5
               columns.types int,string,string,int,string,string
               escape.delim \
               serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -521,7 +525,7 @@ STAGE PLANS:
               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
               properties:
                 column.name.delimiter ,
-                columns _col0,_col1,_col3,_col4,_col5,_col6
+                columns _col0,_col1,_col2,_col3,_col4,_col5
                 columns.types int,string,string,int,string,string
                 escape.delim \
                 serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -726,8 +730,8 @@ STAGE PLANS:
               name: default.pcr_t1
             name: default.pcr_t1
       Truncated Path -> Alias:
-        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:t1]
-        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [$hdt$_1:t2]
+        /pcr_t1/ds1=2000-04-08/ds2=2001-04-08 [$hdt$_0:$hdt$_0:t1]
+        /pcr_t1/ds1=2000-04-09/ds2=2001-04-09 [$hdt$_0:$hdt$_1:t2]
       Needs Tagging: true
       Reduce Operator Tree:
         Join Operator
@@ -738,24 +742,28 @@ STAGE PLANS:
             1 _col0 (type: int)
           outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col7
           Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            GlobalTableId: 0
+          Select Operator
+            expressions: _col0 (type: int), _col1 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col7 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+            Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
 #### A masked pattern was here ####
-            NumFilesPerFileSink: 1
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                properties:
-                  column.name.delimiter ,
-                  columns _col0,_col1,_col3,_col4,_col5,_col7
-                  columns.types int,string,string,int,string,string
-                  escape.delim \
-                  serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
-            TotalFiles: 1
-            GatherStats: false
-            MultiFileSpray: false
+              NumFilesPerFileSink: 1
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  properties:
+                    column.name.delimiter ,
+                    columns _col0,_col1,_col2,_col3,_col4,_col5
+                    columns.types int,string,string,int,string,string
+                    escape.delim \
+                    serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+              TotalFiles: 1
+              GatherStats: false
+              MultiFileSpray: false
 
   Stage: Stage-2
     Map Reduce
@@ -768,7 +776,7 @@ STAGE PLANS:
               sort order: +
               Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
               tag: -1
-              value expressions: _col1 (type: string), _col3 (type: string), _col4 (type: int), _col5 (type: string), _col7 (type: string)
+              value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: int), _col4 (type: string), _col5 (type: string)
               auto parallelism: false
       Path -> Alias:
 #### A masked pattern was here ####
@@ -780,7 +788,7 @@ STAGE PLANS:
             output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
             properties:
               column.name.delimiter ,
-              columns _col0,_col1,_col3,_col4,_col5,_col7
+              columns _col0,_col1,_col2,_col3,_col4,_col5
               columns.types int,string,string,int,string,string
               escape.delim \
               serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
@@ -790,7 +798,7 @@ STAGE PLANS:
               output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
               properties:
                 column.name.delimiter ,
-                columns _col0,_col1,_col3,_col4,_col5,_col7
+                columns _col0,_col1,_col2,_col3,_col4,_col5
                 columns.types int,string,string,int,string,string
                 escape.delim \
                 serialization.lib org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/ppd_udf_case.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/ppd_udf_case.q.out b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
index 7678d03..3cf8e81 100644
--- a/ql/src/test/results/clientpositive/ppd_udf_case.q.out
+++ b/ql/src/test/results/clientpositive/ppd_udf_case.q.out
@@ -71,19 +71,23 @@ STAGE PLANS:
             1 
           outputColumnNames: _col1, _col3, _col5, _col7
           Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          Select Operator
+            expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col7 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
+            Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
   Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col7 (type: string)
+              key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
               sort order: ++++
               Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
       Reduce Operator Tree:
@@ -215,19 +219,23 @@ STAGE PLANS:
             1 
           outputColumnNames: _col1, _col3, _col5, _col7
           Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
-          File Output Operator
-            compressed: false
-            table:
-                input format: org.apache.hadoop.mapred.SequenceFileInputFormat
-                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
-                serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
+          Select Operator
+            expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col7 (type: string)
+            outputColumnNames: _col0, _col1, _col2, _col3
+            Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
+            File Output Operator
+              compressed: false
+              table:
+                  input format: org.apache.hadoop.mapred.SequenceFileInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                  serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
   Stage: Stage-2
     Map Reduce
       Map Operator Tree:
           TableScan
             Reduce Output Operator
-              key expressions: _col1 (type: string), _col3 (type: string), _col5 (type: string), _col7 (type: string)
+              key expressions: _col0 (type: string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
               sort order: ++++
               Statistics: Num rows: 250000 Data size: 5562000 Basic stats: COMPLETE Column stats: NONE
       Reduce Operator Tree:

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
index bcb50cf..38ea9bd 100644
--- a/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
+++ b/ql/src/test/results/clientpositive/spark/dynamic_rdd_cache.q.out
@@ -1071,13 +1071,13 @@ STAGE PLANS:
                 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                 Select Operator
                   expressions: _col1 (type: int), _col2 (type: int), _col3 (type: double), _col4 (type: double), _col6 (type: int), _col7 (type: int), _col8 (type: double), _col9 (type: double)
-                  outputColumnNames: _col0, _col1, _col3, _col4, _col5, _col6, _col8, _col9
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, _col6, _col7
                   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
                   Reduce Output Operator
-                    key expressions: _col0 (type: int), _col1 (type: int), _col3 (type: double), _col4 (type: double), _col8 (type: double), _col9 (type: double)
+                    key expressions: _col0 (type: int), _col1 (type: int), _col2 (type: double), _col3 (type: double), _col6 (type: double), _col7 (type: double)
                     sort order: ++++++
                     Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column stats: NONE
-                    value expressions: _col5 (type: int), _col6 (type: int)
+                    value expressions: _col4 (type: int), _col5 (type: int)
         Reducer 7 
             Reduce Operator Tree:
               Select Operator

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/spark/limit_pushdown.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/limit_pushdown.q.out b/ql/src/test/results/clientpositive/spark/limit_pushdown.q.out
index ede0096..19c1e5f 100644
--- a/ql/src/test/results/clientpositive/spark/limit_pushdown.q.out
+++ b/ql/src/test/results/clientpositive/spark/limit_pushdown.q.out
@@ -1315,7 +1315,7 @@ STAGE PLANS:
 
   Stage: Stage-0
     Fetch Operator
-      limit: 100
+      limit: -1
       Processor Tree:
         ListSink
 

http://git-wip-us.apache.org/repos/asf/hive/blob/a74c1e7c/ql/src/test/results/clientpositive/spark/pcr.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/spark/pcr.q.out b/ql/src/test/results/clientpositive/spark/pcr.q.out
index 77ac020..dc8c1ab 100644
--- a/ql/src/test/results/clientpositive/spark/pcr.q.out
+++ b/ql/src/test/results/clientpositive/spark/pcr.q.out
@@ -1468,10 +1468,10 @@ STAGE PLANS:
                     Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: value (type: string)
-                      outputColumnNames: _col1
+                      outputColumnNames: _col0
                       Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col1 (type: string)
+                        key expressions: _col0 (type: string)
                         null sort order: a
                         sort order: +
                         Statistics: Num rows: 20 Data size: 160 Basic stats: COMPLETE Column stats: NONE
@@ -2497,14 +2497,18 @@ STAGE PLANS:
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col3, _col4
                 Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: int)
-                  null sort order: a
-                  sort order: +
+                Select Operator
+                  expressions: _col0 (type: int), _col1 (type: string), _col3 (type: int), _col4 (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-                  tag: -1
-                  value expressions: _col1 (type: string), _col3 (type: int), _col4 (type: string)
-                  auto parallelism: false
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    null sort order: a
+                    sort order: +
+                    Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+                    tag: -1
+                    value expressions: _col1 (type: string), _col2 (type: int), _col3 (type: string)
+                    auto parallelism: false
         Reducer 3 
             Needs Tagging: false
             Reduce Operator Tree:
@@ -2766,14 +2770,18 @@ STAGE PLANS:
                   1 _col0 (type: int)
                 outputColumnNames: _col0, _col1, _col3, _col4
                 Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-                Reduce Output Operator
-                  key expressions: _col0 (type: int)
-                  null sort order: a
-                  sort order: +
+                Select Operator
+                  expressions: _col0 (type: int), _col1 (type: string), _col3 (type: int), _col4 (type: string)
+                  outputColumnNames: _col0, _col1, _col2, _col3
                   Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
-                  tag: -1
-                  value expressions: _col1 (type: string), _col3 (type: int), _col4 (type: string)
-                  auto parallelism: false
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    null sort order: a
+                    sort order: +
+                    Statistics: Num rows: 22 Data size: 176 Basic stats: COMPLETE Column stats: NONE
+                    tag: -1
+                    value expressions: _col1 (type: string), _col2 (type: int), _col3 (type: string)
+                    auto parallelism: false
         Reducer 3 
             Needs Tagging: false
             Reduce Operator Tree:
@@ -4131,10 +4139,10 @@ STAGE PLANS:
                     Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                     Select Operator
                       expressions: key (type: string), value (type: string), hr (type: string)
-                      outputColumnNames: _col0, _col1, _col3
+                      outputColumnNames: _col0, _col1, _col2
                       Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE
                       Reduce Output Operator
-                        key expressions: _col0 (type: string), _col3 (type: string)
+                        key expressions: _col0 (type: string), _col2 (type: string)
                         null sort order: aa
                         sort order: ++
                         Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE