http://git-wip-us.apache.org/repos/asf/hive/blob/bd371246/ql/src/test/results/clientpositive/perf/spark/query19.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query19.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query19.q.out
new file mode 100644
index 0000000..6a70ddc
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/spark/query19.q.out
@@ -0,0 +1,306 @@
+PREHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
+       sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item,customer,customer_address,store
+ where d_date_sk = ss_sold_date_sk
+   and ss_item_sk = i_item_sk
+   and i_manager_id=7
+   and d_moy=11
+   and d_year=1999
+   and ss_customer_sk = c_customer_sk 
+   and c_current_addr_sk = ca_address_sk
+   and substr(ca_zip,1,5) <> substr(s_zip,1,5) 
+   and ss_store_sk = s_store_sk 
+ group by i_brand
+      ,i_brand_id
+      ,i_manufact_id
+      ,i_manufact
+ order by ext_price desc
+         ,i_brand
+         ,i_brand_id
+         ,i_manufact_id
+         ,i_manufact
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
+       sum(ss_ext_sales_price) ext_price
+ from date_dim, store_sales, item,customer,customer_address,store
+ where d_date_sk = ss_sold_date_sk
+   and ss_item_sk = i_item_sk
+   and i_manager_id=7
+   and d_moy=11
+   and d_year=1999
+   and ss_customer_sk = c_customer_sk 
+   and c_current_addr_sk = ca_address_sk
+   and substr(ca_zip,1,5) <> substr(s_zip,1,5) 
+   and ss_store_sk = s_store_sk 
+ group by i_brand
+      ,i_brand_id
+      ,i_manufact_id
+      ,i_manufact
+ order by ext_price desc
+         ,i_brand
+         ,i_brand_id
+         ,i_manufact_id
+         ,i_manufact
+limit 100
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-2
+    Spark
+#### A masked pattern was here ####
+      Vertices:
+        Map 12 
+            Map Operator Tree:
+                TableScan
+                  alias: store
+                  Statistics: Num rows: 1704 Data size: 3256276 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: s_store_sk is not null (type: boolean)
+                    Statistics: Num rows: 1704 Data size: 3256276 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: s_store_sk (type: int), s_zip (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 1704 Data size: 3256276 Basic 
stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col7 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 855), Map 6 (PARTITION-LEVEL 
SORT, 855)
+        Reducer 3 <- Reducer 2 (PARTITION-LEVEL SORT, 1009), Reducer 9 
(PARTITION-LEVEL SORT, 1009)
+        Reducer 4 <- Reducer 3 (GROUP, 582)
+        Reducer 5 <- Reducer 4 (SORT, 1)
+        Reducer 8 <- Map 10 (PARTITION-LEVEL SORT, 398), Map 7 
(PARTITION-LEVEL SORT, 398)
+        Reducer 9 <- Map 11 (PARTITION-LEVEL SORT, 440), Reducer 8 
(PARTITION-LEVEL SORT, 440)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: customer
+                  Statistics: Num rows: 80000000 Data size: 68801615852 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (c_current_addr_sk is not null and 
c_customer_sk is not null) (type: boolean)
+                    Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: c_customer_sk (type: int), 
c_current_addr_sk (type: int)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col1 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col1 (type: int)
+                        Statistics: Num rows: 80000000 Data size: 68801615852 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col0 (type: int)
+        Map 10 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((d_moy = 11) and (d_year = 1999) and d_date_sk 
is not null) (type: boolean)
+                    Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 18262 Data size: 20435178 Basic 
stats: COMPLETE Column stats: NONE
+        Map 11 
+            Map Operator Tree:
+                TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((i_manager_id = 7) and i_item_sk is not null) 
(type: boolean)
+                    Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_brand_id (type: 
int), i_brand (type: string), i_manufact_id (type: int), i_manufact (type: 
string)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 231000 Data size: 331780228 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
string), _col3 (type: int), _col4 (type: string)
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: customer_address
+                  Statistics: Num rows: 40000000 Data size: 40595195284 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ca_address_sk is not null (type: boolean)
+                    Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: ca_address_sk (type: int), ca_zip (type: 
string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 40000000 Data size: 40595195284 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string)
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: store_sales
+                  Statistics: Num rows: 575995635 Data size: 50814502088 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (ss_customer_sk is not null and ss_item_sk is 
not null and ss_sold_date_sk is not null and ss_store_sk is not null) (type: 
boolean)
+                    Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: ss_sold_date_sk (type: int), ss_item_sk 
(type: int), ss_customer_sk (type: int), ss_store_sk (type: int), 
ss_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 575995635 Data size: 50814502088 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
int), _col3 (type: int), _col4 (type: decimal(7,2))
+        Reducer 2 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col0, _col3
+                Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 88000001 Data size: 75681779077 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: string)
+        Reducer 3 
+            Local Work:
+              Map Reduce Local Work
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col2 (type: int)
+                outputColumnNames: _col3, _col7, _col8, _col13, _col14, 
_col15, _col16
+                Statistics: Num rows: 766650239 Data size: 67634106676 Basic 
stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col7 (type: int)
+                    1 _col0 (type: int)
+                  outputColumnNames: _col3, _col8, _col13, _col14, _col15, 
_col16, _col19
+                  input vertices:
+                    1 Map 12
+                  Statistics: Num rows: 843315281 Data size: 74397518956 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (substr(_col3, 1, 5) <> substr(_col19, 1, 5)) 
(type: boolean)
+                    Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: _col8 (type: decimal(7,2)), _col13 (type: 
int), _col14 (type: string), _col15 (type: int), _col16 (type: string)
+                      outputColumnNames: _col8, _col13, _col14, _col15, _col16
+                      Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
+                      Group By Operator
+                        aggregations: sum(_col8)
+                        keys: _col14 (type: string), _col13 (type: int), 
_col15 (type: int), _col16 (type: string)
+                        mode: hash
+                        outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                        Statistics: Num rows: 843315281 Data size: 74397518956 
Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col0 (type: string), _col1 (type: 
int), _col2 (type: int), _col3 (type: string)
+                          sort order: ++++
+                          Map-reduce partition columns: _col0 (type: string), 
_col1 (type: int), _col2 (type: int), _col3 (type: string)
+                          Statistics: Num rows: 843315281 Data size: 
74397518956 Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col4 (type: decimal(17,2))
+        Reducer 4 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: sum(VALUE._col0)
+                keys: KEY._col0 (type: string), KEY._col1 (type: int), 
KEY._col2 (type: int), KEY._col3 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col1 (type: int), _col0 (type: string), _col2 
(type: int), _col3 (type: string), _col4 (type: decimal(17,2))
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col4 (type: decimal(17,2)), _col1 (type: 
string), _col0 (type: int), _col2 (type: int), _col3 (type: string)
+                    sort order: -++++
+                    Statistics: Num rows: 421657640 Data size: 37198759433 
Basic stats: COMPLETE Column stats: NONE
+                    TopN Hash Memory Usage: 0.1
+        Reducer 5 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey2 (type: int), 
KEY.reducesinkkey1 (type: string), KEY.reducesinkkey3 (type: int), 
KEY.reducesinkkey4 (type: string), KEY.reducesinkkey0 (type: decimal(17,2))
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                Statistics: Num rows: 421657640 Data size: 37198759433 Basic 
stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 100
+                  Statistics: Num rows: 100 Data size: 8800 Basic stats: 
COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 100 Data size: 8800 Basic stats: 
COMPLETE Column stats: NONE
+                    table:
+                        input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+        Reducer 8 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1, _col2, _col3, _col4
+                Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col1 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col1 (type: int)
+                  Statistics: Num rows: 633595212 Data size: 55895953508 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col2 (type: int), _col3 (type: int), 
_col4 (type: decimal(7,2))
+        Reducer 9 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col2, _col3, _col4, _col9, _col10, _col11, 
_col12
+                Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col2 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col2 (type: int)
+                  Statistics: Num rows: 696954748 Data size: 61485550191 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col3 (type: int), _col4 (type: 
decimal(7,2)), _col9 (type: int), _col10 (type: string), _col11 (type: int), 
_col12 (type: string)
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 100
+      Processor Tree:
+        ListSink
+

http://git-wip-us.apache.org/repos/asf/hive/blob/bd371246/ql/src/test/results/clientpositive/perf/spark/query2.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query2.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
new file mode 100644
index 0000000..7337c10
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/spark/query2.q.out
@@ -0,0 +1,429 @@
+PREHOOK: query: explain
+with wscs as
+ (select sold_date_sk
+        ,sales_price
+  from (select ws_sold_date_sk sold_date_sk
+              ,ws_ext_sales_price sales_price
+        from web_sales) x
+        union all
+       (select cs_sold_date_sk sold_date_sk
+              ,cs_ext_sales_price sales_price
+        from catalog_sales)),
+ wswscs as 
+ (select d_week_seq,
+        sum(case when (d_day_name='Sunday') then sales_price else null end) 
sun_sales,
+        sum(case when (d_day_name='Monday') then sales_price else null end) 
mon_sales,
+        sum(case when (d_day_name='Tuesday') then sales_price else  null end) 
tue_sales,
+        sum(case when (d_day_name='Wednesday') then sales_price else null end) 
wed_sales,
+        sum(case when (d_day_name='Thursday') then sales_price else null end) 
thu_sales,
+        sum(case when (d_day_name='Friday') then sales_price else null end) 
fri_sales,
+        sum(case when (d_day_name='Saturday') then sales_price else null end) 
sat_sales
+ from wscs
+     ,date_dim
+ where d_date_sk = sold_date_sk
+ group by d_week_seq)
+ select d_week_seq1
+       ,round(sun_sales1/sun_sales2,2)
+       ,round(mon_sales1/mon_sales2,2)
+       ,round(tue_sales1/tue_sales2,2)
+       ,round(wed_sales1/wed_sales2,2)
+       ,round(thu_sales1/thu_sales2,2)
+       ,round(fri_sales1/fri_sales2,2)
+       ,round(sat_sales1/sat_sales2,2)
+ from
+ (select wswscs.d_week_seq d_week_seq1
+        ,sun_sales sun_sales1
+        ,mon_sales mon_sales1
+        ,tue_sales tue_sales1
+        ,wed_sales wed_sales1
+        ,thu_sales thu_sales1
+        ,fri_sales fri_sales1
+        ,sat_sales sat_sales1
+  from wswscs,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001) y,
+ (select wswscs.d_week_seq d_week_seq2
+        ,sun_sales sun_sales2
+        ,mon_sales mon_sales2
+        ,tue_sales tue_sales2
+        ,wed_sales wed_sales2
+        ,thu_sales thu_sales2
+        ,fri_sales fri_sales2
+        ,sat_sales sat_sales2
+  from wswscs
+      ,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001+1) z
+ where d_week_seq1=d_week_seq2-53
+ order by d_week_seq1
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+with wscs as
+ (select sold_date_sk
+        ,sales_price
+  from (select ws_sold_date_sk sold_date_sk
+              ,ws_ext_sales_price sales_price
+        from web_sales) x
+        union all
+       (select cs_sold_date_sk sold_date_sk
+              ,cs_ext_sales_price sales_price
+        from catalog_sales)),
+ wswscs as 
+ (select d_week_seq,
+        sum(case when (d_day_name='Sunday') then sales_price else null end) 
sun_sales,
+        sum(case when (d_day_name='Monday') then sales_price else null end) 
mon_sales,
+        sum(case when (d_day_name='Tuesday') then sales_price else  null end) 
tue_sales,
+        sum(case when (d_day_name='Wednesday') then sales_price else null end) 
wed_sales,
+        sum(case when (d_day_name='Thursday') then sales_price else null end) 
thu_sales,
+        sum(case when (d_day_name='Friday') then sales_price else null end) 
fri_sales,
+        sum(case when (d_day_name='Saturday') then sales_price else null end) 
sat_sales
+ from wscs
+     ,date_dim
+ where d_date_sk = sold_date_sk
+ group by d_week_seq)
+ select d_week_seq1
+       ,round(sun_sales1/sun_sales2,2)
+       ,round(mon_sales1/mon_sales2,2)
+       ,round(tue_sales1/tue_sales2,2)
+       ,round(wed_sales1/wed_sales2,2)
+       ,round(thu_sales1/thu_sales2,2)
+       ,round(fri_sales1/fri_sales2,2)
+       ,round(sat_sales1/sat_sales2,2)
+ from
+ (select wswscs.d_week_seq d_week_seq1
+        ,sun_sales sun_sales1
+        ,mon_sales mon_sales1
+        ,tue_sales tue_sales1
+        ,wed_sales wed_sales1
+        ,thu_sales thu_sales1
+        ,fri_sales fri_sales1
+        ,sat_sales sat_sales1
+  from wswscs,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001) y,
+ (select wswscs.d_week_seq d_week_seq2
+        ,sun_sales sun_sales2
+        ,mon_sales mon_sales2
+        ,tue_sales tue_sales2
+        ,wed_sales wed_sales2
+        ,thu_sales thu_sales2
+        ,fri_sales fri_sales2
+        ,sat_sales sat_sales2
+  from wswscs
+      ,date_dim 
+  where date_dim.d_week_seq = wswscs.d_week_seq and
+        d_year = 2001+1) z
+ where d_week_seq1=d_week_seq2-53
+ order by d_week_seq1
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 11 <- Map 10 (PARTITION-LEVEL SORT, 459), Map 14 
(PARTITION-LEVEL SORT, 459), Map 15 (PARTITION-LEVEL SORT, 459)
+        Reducer 12 <- Reducer 11 (GROUP, 504)
+        Reducer 13 <- Map 16 (PARTITION-LEVEL SORT, 253), Reducer 12 
(PARTITION-LEVEL SORT, 253)
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 459), Map 7 (PARTITION-LEVEL 
SORT, 459), Map 8 (PARTITION-LEVEL SORT, 459)
+        Reducer 3 <- Reducer 2 (GROUP, 504)
+        Reducer 4 <- Map 9 (PARTITION-LEVEL SORT, 253), Reducer 3 
(PARTITION-LEVEL SORT, 253)
+        Reducer 5 <- Reducer 13 (PARTITION-LEVEL SORT, 554), Reducer 4 
(PARTITION-LEVEL SORT, 554)
+        Reducer 6 <- Reducer 5 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: web_sales
+                  Statistics: Num rows: 144002668 Data size: 19580198212 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ws_sold_date_sk is not null (type: boolean)
+                    Statistics: Num rows: 144002668 Data size: 19580198212 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: ws_sold_date_sk (type: int), 
ws_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 144002668 Data size: 19580198212 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 431992504 Data size: 58579807164 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2))
+        Map 10 
+            Map Operator Tree:
+                TableScan
+                  alias: web_sales
+                  Statistics: Num rows: 144002668 Data size: 19580198212 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ws_sold_date_sk is not null (type: boolean)
+                    Statistics: Num rows: 144002668 Data size: 19580198212 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: ws_sold_date_sk (type: int), 
ws_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 144002668 Data size: 19580198212 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 431992504 Data size: 58579807164 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2))
+        Map 14 
+            Map Operator Tree:
+                TableScan
+                  alias: catalog_sales
+                  Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: cs_sold_date_sk is not null (type: boolean)
+                    Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: cs_sold_date_sk (type: int), 
cs_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 431992504 Data size: 58579807164 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2))
+        Map 15 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (d_date_sk is not null and d_week_seq is not 
null) (type: boolean)
+                    Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int), d_week_seq (type: 
int), d_day_name (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
string)
+        Map 16 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((d_year = 2002) and d_week_seq is not null) 
(type: boolean)
+                    Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_week_seq (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: catalog_sales
+                  Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: cs_sold_date_sk is not null (type: boolean)
+                    Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: cs_sold_date_sk (type: int), 
cs_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 431992504 Data size: 58579807164 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: decimal(7,2))
+        Map 8 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (d_date_sk is not null and d_week_seq is not 
null) (type: boolean)
+                    Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int), d_week_seq (type: 
int), d_day_name (type: string)
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 73049 Data size: 81741831 Basic 
stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: int), _col2 (type: 
string)
+        Map 9 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((d_year = 2001) and d_week_seq is not null) 
(type: boolean)
+                    Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_week_seq (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 36524 Data size: 40870356 Basic 
stats: COMPLETE Column stats: NONE
+        Reducer 11 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1, _col3, _col4
+                Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col3 (type: int), CASE WHEN ((_col4 = 
'Sunday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN ((_col4 
= 'Monday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN 
((_col4 = 'Tuesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE 
WHEN ((_col4 = 'Wednesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), 
CASE WHEN ((_col4 = 'Thursday')) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN ((_col4 = 'Friday')) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN ((_col4 = 'Saturday')) THEN (_col1) ELSE (null) 
END (type: decimal(7,2))
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                  Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
+                  Group By Operator
+                    aggregations: sum(_col1), sum(_col2), sum(_col3), 
sum(_col4), sum(_col5), sum(_col6), sum(_col7)
+                    keys: _col0 (type: int)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7
+                    Statistics: Num rows: 475191764 Data size: 64437789277 
Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: int)
+                      Statistics: Num rows: 475191764 Data size: 64437789277 
Basic stats: COMPLETE Column stats: NONE
+                      value expressions: _col1 (type: decimal(17,2)), _col2 
(type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: 
decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 
(type: decimal(17,2))
+        Reducer 12 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: sum(VALUE._col0), sum(VALUE._col1), 
sum(VALUE._col2), sum(VALUE._col3), sum(VALUE._col4), sum(VALUE._col5), 
sum(VALUE._col6)
+                keys: KEY._col0 (type: int)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                Statistics: Num rows: 237595882 Data size: 32218894638 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 237595882 Data size: 32218894638 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: decimal(17,2)), _col2 (type: 
decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 
(type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
+        Reducer 13 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                Statistics: Num rows: 261355475 Data size: 35440784869 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: (_col0 - 53) (type: int)
+                  sort order: +
+                  Map-reduce partition columns: (_col0 - 53) (type: int)
+                  Statistics: Num rows: 261355475 Data size: 35440784869 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: decimal(17,2)), _col2 (type: 
decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 
(type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
+        Reducer 2 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col1, _col3, _col4
+                Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col3 (type: int), CASE WHEN ((_col4 = 
'Sunday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN ((_col4 
= 'Monday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE WHEN 
((_col4 = 'Tuesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), CASE 
WHEN ((_col4 = 'Wednesday')) THEN (_col1) ELSE (null) END (type: decimal(7,2)), 
CASE WHEN ((_col4 = 'Thursday')) THEN (_col1) ELSE (null) END (type: 
decimal(7,2)), CASE WHEN ((_col4 = 'Friday')) THEN (_col1) ELSE (null) END 
(type: decimal(7,2)), CASE WHEN ((_col4 = 'Saturday')) THEN (_col1) ELSE (null) 
END (type: decimal(7,2))
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                  Statistics: Num rows: 475191764 Data size: 64437789277 Basic 
stats: COMPLETE Column stats: NONE
+                  Group By Operator
+                    aggregations: sum(_col1), sum(_col2), sum(_col3), 
sum(_col4), sum(_col5), sum(_col6), sum(_col7)
+                    keys: _col0 (type: int)
+                    mode: hash
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6, _col7
+                    Statistics: Num rows: 475191764 Data size: 64437789277 
Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col0 (type: int)
+                      sort order: +
+                      Map-reduce partition columns: _col0 (type: int)
+                      Statistics: Num rows: 475191764 Data size: 64437789277 
Basic stats: COMPLETE Column stats: NONE
+                      value expressions: _col1 (type: decimal(17,2)), _col2 
(type: decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: 
decimal(17,2)), _col5 (type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 
(type: decimal(17,2))
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: sum(VALUE._col0), sum(VALUE._col1), 
sum(VALUE._col2), sum(VALUE._col3), sum(VALUE._col4), sum(VALUE._col5), 
sum(VALUE._col6)
+                keys: KEY._col0 (type: int)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                Statistics: Num rows: 237595882 Data size: 32218894638 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 237595882 Data size: 32218894638 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: decimal(17,2)), _col2 (type: 
decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 
(type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
+        Reducer 4 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                Statistics: Num rows: 261355475 Data size: 35440784869 Basic 
stats: COMPLETE Column stats: NONE
+                Reduce Output Operator
+                  key expressions: _col0 (type: int)
+                  sort order: +
+                  Map-reduce partition columns: _col0 (type: int)
+                  Statistics: Num rows: 261355475 Data size: 35440784869 Basic 
stats: COMPLETE Column stats: NONE
+                  value expressions: _col1 (type: decimal(17,2)), _col2 (type: 
decimal(17,2)), _col3 (type: decimal(17,2)), _col4 (type: decimal(17,2)), _col5 
(type: decimal(17,2)), _col6 (type: decimal(17,2)), _col7 (type: decimal(17,2))
+        Reducer 5 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col0 (type: int)
+                  1 (_col0 - 53) (type: int)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7, _col9, _col10, _col11, _col12, _col13, _col14, _col15
+                Statistics: Num rows: 287491028 Data size: 38984864200 Basic 
stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col0 (type: int), round((_col1 / _col9), 2) 
(type: decimal(20,2)), round((_col2 / _col10), 2) (type: decimal(20,2)), 
round((_col3 / _col11), 2) (type: decimal(20,2)), round((_col4 / _col12), 2) 
(type: decimal(20,2)), round((_col5 / _col13), 2) (type: decimal(20,2)), 
round((_col6 / _col14), 2) (type: decimal(20,2)), round((_col7 / _col15), 2) 
(type: decimal(20,2))
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                  Statistics: Num rows: 287491028 Data size: 38984864200 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: int)
+                    sort order: +
+                    Statistics: Num rows: 287491028 Data size: 38984864200 
Basic stats: COMPLETE Column stats: NONE
+                    value expressions: _col1 (type: decimal(20,2)), _col2 
(type: decimal(20,2)), _col3 (type: decimal(20,2)), _col4 (type: 
decimal(20,2)), _col5 (type: decimal(20,2)), _col6 (type: decimal(20,2)), _col7 
(type: decimal(20,2))
+        Reducer 6 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey0 (type: int), VALUE._col0 
(type: decimal(20,2)), VALUE._col1 (type: decimal(20,2)), VALUE._col2 (type: 
decimal(20,2)), VALUE._col3 (type: decimal(20,2)), VALUE._col4 (type: 
decimal(20,2)), VALUE._col5 (type: decimal(20,2)), VALUE._col6 (type: 
decimal(20,2))
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5, 
_col6, _col7
+                Statistics: Num rows: 287491028 Data size: 38984864200 Basic 
stats: COMPLETE Column stats: NONE
+                File Output Operator
+                  compressed: false
+                  Statistics: Num rows: 287491028 Data size: 38984864200 Basic 
stats: COMPLETE Column stats: NONE
+                  table:
+                      input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                      output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                      serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+

http://git-wip-us.apache.org/repos/asf/hive/blob/bd371246/ql/src/test/results/clientpositive/perf/spark/query20.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query20.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query20.q.out
new file mode 100644
index 0000000..ab1b24d
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/spark/query20.q.out
@@ -0,0 +1,241 @@
+PREHOOK: query: explain
+select  i_item_desc 
+       ,i_category 
+       ,i_class 
+       ,i_current_price
+       ,sum(cs_ext_sales_price) as itemrevenue 
+       ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
+           (partition by i_class) as revenueratio
+ from  catalog_sales
+     ,item 
+     ,date_dim
+ where cs_item_sk = i_item_sk 
+   and i_category in ('Jewelry', 'Sports', 'Books')
+   and cs_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date) 
+                               and (cast('2001-01-12' as date) + 30 days)
+ group by i_item_id
+         ,i_item_desc 
+         ,i_category
+         ,i_class
+         ,i_current_price
+ order by i_category
+         ,i_class
+         ,i_item_id
+         ,i_item_desc
+         ,revenueratio
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_item_desc 
+       ,i_category 
+       ,i_class 
+       ,i_current_price
+       ,sum(cs_ext_sales_price) as itemrevenue 
+       ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
+           (partition by i_class) as revenueratio
+ from  catalog_sales
+     ,item 
+     ,date_dim
+ where cs_item_sk = i_item_sk 
+   and i_category in ('Jewelry', 'Sports', 'Books')
+   and cs_sold_date_sk = d_date_sk
+ and d_date between cast('2001-01-12' as date) 
+                               and (cast('2001-01-12' as date) + 30 days)
+ group by i_item_id
+         ,i_item_desc 
+         ,i_category
+         ,i_class
+         ,i_current_price
+ order by i_category
+         ,i_class
+         ,i_item_id
+         ,i_item_desc
+         ,revenueratio
+limit 100
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-2
+    Spark
+#### A masked pattern was here ####
+      Vertices:
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (CAST( d_date AS TIMESTAMP) BETWEEN 2001-01-12 
00:00:00.0 AND 2001-02-11 00:00:00.0 and d_date_sk is not null) (type: boolean)
+                    Statistics: Num rows: 8116 Data size: 9081804 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 8116 Data size: 9081804 Basic 
stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 338), Map 7 (PARTITION-LEVEL 
SORT, 338)
+        Reducer 3 <- Reducer 2 (GROUP, 369)
+        Reducer 4 <- Reducer 3 (PARTITION-LEVEL SORT, 185)
+        Reducer 5 <- Reducer 4 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: catalog_sales
+                  Statistics: Num rows: 287989836 Data size: 38999608952 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (cs_item_sk is not null and cs_sold_date_sk is 
not null) (type: boolean)
+                    Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: cs_sold_date_sk (type: int), cs_item_sk 
(type: int), cs_ext_sales_price (type: decimal(7,2))
+                      outputColumnNames: _col0, _col1, _col2
+                      Statistics: Num rows: 287989836 Data size: 38999608952 
Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col1, _col2
+                        input vertices:
+                          1 Map 6
+                        Statistics: Num rows: 316788826 Data size: 42899570777 
Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: int)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: int)
+                          Statistics: Num rows: 316788826 Data size: 
42899570777 Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col2 (type: decimal(7,2))
+            Local Work:
+              Map Reduce Local Work
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: ((i_category) IN ('Jewelry', 'Sports', 'Books') 
and i_item_sk is not null) (type: boolean)
+                    Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_item_id (type: 
string), i_item_desc (type: string), i_current_price (type: decimal(7,2)), 
i_class (type: string), i_category (type: string)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5
+                      Statistics: Num rows: 231000 Data size: 331780228 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 231000 Data size: 331780228 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: decimal(7,2)), _col4 (type: string), _col5 (type: string)
+        Reducer 2 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col2, _col6, _col7, _col8, _col9, _col10
+                Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                Group By Operator
+                  aggregations: sum(_col2)
+                  keys: _col10 (type: string), _col9 (type: string), _col6 
(type: string), _col7 (type: string), _col8 (type: decimal(7,2))
+                  mode: hash
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                  Statistics: Num rows: 348467716 Data size: 47189528877 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: decimal(7,2))
+                    sort order: +++++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string), _col4 (type: 
decimal(7,2))
+                    Statistics: Num rows: 348467716 Data size: 47189528877 
Basic stats: COMPLETE Column stats: NONE
+                    value expressions: _col5 (type: decimal(17,2))
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: sum(VALUE._col0)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: 
decimal(7,2))
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
+                Select Operator
+                  expressions: _col2 (type: string), _col3 (type: string), 
_col0 (type: string), _col1 (type: string), _col4 (type: decimal(7,2)), _col5 
(type: decimal(17,2))
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                  Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col3 (type: string)
+                    sort order: +
+                    Map-reduce partition columns: _col3 (type: string)
+                    Statistics: Num rows: 174233858 Data size: 23594764438 
Basic stats: COMPLETE Column stats: NONE
+                    value expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col4 (type: decimal(7,2)), _col5 (type: 
decimal(17,2))
+        Reducer 4 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: VALUE._col0 (type: string), VALUE._col1 (type: 
string), VALUE._col2 (type: string), KEY.reducesinkkey0 (type: string), 
VALUE._col3 (type: decimal(7,2)), VALUE._col4 (type: decimal(17,2))
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
+                PTF Operator
+                  Function definitions:
+                      Input definition
+                        input alias: ptf_0
+                        output shape: _col0: string, _col1: string, _col2: 
string, _col3: string, _col4: decimal(7,2), _col5: decimal(17,2)
+                        type: WINDOWING
+                      Windowing table definition
+                        input alias: ptf_1
+                        name: windowingtablefunction
+                        order by: _col3 ASC NULLS FIRST
+                        partition by: _col3
+                        raw input shape:
+                        window functions:
+                            window function definition
+                              alias: sum_window_0
+                              arguments: _col5
+                              name: sum
+                              window function: GenericUDAFSumHiveDecimal
+                              window frame: ROWS PRECEDING(MAX)~FOLLOWING(MAX)
+                  Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: _col1 (type: string), _col2 (type: string), 
_col3 (type: string), _col4 (type: decimal(7,2)), _col5 (type: decimal(17,2)), 
((_col5 * 100) / sum_window_0) (type: decimal(38,17)), _col0 (type: string)
+                    outputColumnNames: _col0, _col1, _col2, _col3, _col4, 
_col5, _col6
+                    Statistics: Num rows: 174233858 Data size: 23594764438 
Basic stats: COMPLETE Column stats: NONE
+                    Reduce Output Operator
+                      key expressions: _col1 (type: string), _col2 (type: 
string), _col6 (type: string), _col0 (type: string), _col5 (type: 
decimal(38,17))
+                      sort order: +++++
+                      Statistics: Num rows: 174233858 Data size: 23594764438 
Basic stats: COMPLETE Column stats: NONE
+                      TopN Hash Memory Usage: 0.1
+                      value expressions: _col3 (type: decimal(7,2)), _col4 
(type: decimal(17,2))
+        Reducer 5 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey3 (type: string), 
KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), 
VALUE._col0 (type: decimal(7,2)), VALUE._col1 (type: decimal(17,2)), 
KEY.reducesinkkey4 (type: decimal(38,17))
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                Statistics: Num rows: 174233858 Data size: 23594764438 Basic 
stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 100
+                  Statistics: Num rows: 100 Data size: 13500 Basic stats: 
COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 100 Data size: 13500 Basic stats: 
COMPLETE Column stats: NONE
+                    table:
+                        input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+      Processor Tree:
+        ListSink
+

http://git-wip-us.apache.org/repos/asf/hive/blob/bd371246/ql/src/test/results/clientpositive/perf/spark/query21.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query21.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query21.q.out
new file mode 100644
index 0000000..0e9959c
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/spark/query21.q.out
@@ -0,0 +1,245 @@
+PREHOOK: query: explain
+select  *
+ from(select w_warehouse_name
+            ,i_item_id
+            ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+                       then inv_quantity_on_hand 
+                      else 0 end) as inv_before
+            ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as 
date))
+                      then inv_quantity_on_hand 
+                      else 0 end) as inv_after
+   from inventory
+       ,warehouse
+       ,item
+       ,date_dim
+   where i_current_price between 0.99 and 1.49
+     and i_item_sk          = inv_item_sk
+     and inv_warehouse_sk   = w_warehouse_sk
+     and inv_date_sk    = d_date_sk
+     and d_date between (cast ('1998-04-08' as date) - 30 days)
+                    and (cast ('1998-04-08' as date) + 30 days)
+   group by w_warehouse_name, i_item_id) x
+ where (case when inv_before > 0 
+             then inv_after / inv_before 
+             else null
+             end) between 2.0/3.0 and 3.0/2.0
+ order by w_warehouse_name
+         ,i_item_id
+ limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  *
+ from(select w_warehouse_name
+            ,i_item_id
+            ,sum(case when (cast(d_date as date) < cast ('1998-04-08' as date))
+                       then inv_quantity_on_hand 
+                      else 0 end) as inv_before
+            ,sum(case when (cast(d_date as date) >= cast ('1998-04-08' as 
date))
+                      then inv_quantity_on_hand 
+                      else 0 end) as inv_after
+   from inventory
+       ,warehouse
+       ,item
+       ,date_dim
+   where i_current_price between 0.99 and 1.49
+     and i_item_sk          = inv_item_sk
+     and inv_warehouse_sk   = w_warehouse_sk
+     and inv_date_sk    = d_date_sk
+     and d_date between (cast ('1998-04-08' as date) - 30 days)
+                    and (cast ('1998-04-08' as date) + 30 days)
+   group by w_warehouse_name, i_item_id) x
+ where (case when inv_before > 0 
+             then inv_after / inv_before 
+             else null
+             end) between 2.0/3.0 and 3.0/2.0
+ order by w_warehouse_name
+         ,i_item_id
+ limit 100
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-3 depends on stages: Stage-2
+  Stage-1 depends on stages: Stage-3
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-2
+    Spark
+#### A masked pattern was here ####
+      Vertices:
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: warehouse
+                  Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: w_warehouse_sk is not null (type: boolean)
+                    Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: w_warehouse_sk (type: int), 
w_warehouse_name (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col2 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-3
+    Spark
+#### A masked pattern was here ####
+      Vertices:
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (CAST( d_date AS TIMESTAMP) BETWEEN 1998-03-08 
23:00:00.0 AND 1998-05-08 00:00:00.0 and d_date_sk is not null) (type: boolean)
+                    Statistics: Num rows: 8116 Data size: 9081804 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int), d_date (type: string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 8116 Data size: 9081804 Basic 
stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 6), Map 6 (PARTITION-LEVEL 
SORT, 6)
+        Reducer 3 <- Reducer 2 (GROUP, 7)
+        Reducer 4 <- Reducer 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inventory
+                  Statistics: Num rows: 37584000 Data size: 593821104 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (inv_date_sk is not null and inv_item_sk is not 
null and inv_warehouse_sk is not null) (type: boolean)
+                    Statistics: Num rows: 37584000 Data size: 593821104 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: inv_date_sk (type: int), inv_item_sk (type: 
int), inv_warehouse_sk (type: int), inv_quantity_on_hand (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 37584000 Data size: 593821104 
Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col1, _col2, _col3, _col5
+                        input vertices:
+                          1 Map 5
+                        Statistics: Num rows: 41342400 Data size: 653203228 
Basic stats: COMPLETE Column stats: NONE
+                        Reduce Output Operator
+                          key expressions: _col1 (type: int)
+                          sort order: +
+                          Map-reduce partition columns: _col1 (type: int)
+                          Statistics: Num rows: 41342400 Data size: 653203228 
Basic stats: COMPLETE Column stats: NONE
+                          value expressions: _col2 (type: int), _col3 (type: 
int), _col5 (type: string)
+            Local Work:
+              Map Reduce Local Work
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (i_current_price BETWEEN 0.99 AND 1.49 and 
i_item_sk is not null) (type: boolean)
+                    Statistics: Num rows: 51333 Data size: 73728460 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_item_id (type: 
string)
+                      outputColumnNames: _col0, _col1
+                      Statistics: Num rows: 51333 Data size: 73728460 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 51333 Data size: 73728460 Basic 
stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string)
+        Reducer 2 
+            Local Work:
+              Map Reduce Local Work
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col2, _col3, _col5, _col7
+                Statistics: Num rows: 45476640 Data size: 718523566 Basic 
stats: COMPLETE Column stats: NONE
+                Map Join Operator
+                  condition map:
+                       Inner Join 0 to 1
+                  keys:
+                    0 _col2 (type: int)
+                    1 _col0 (type: int)
+                  outputColumnNames: _col3, _col5, _col7, _col10
+                  input vertices:
+                    1 Map 7
+                  Statistics: Num rows: 50024305 Data size: 790375939 Basic 
stats: COMPLETE Column stats: NONE
+                  Select Operator
+                    expressions: _col10 (type: string), _col7 (type: string), 
CASE WHEN ((CAST( _col5 AS DATE) < 1998-04-08)) THEN (_col3) ELSE (0) END 
(type: int), CASE WHEN ((CAST( _col5 AS DATE) >= 1998-04-08)) THEN (_col3) ELSE 
(0) END (type: int)
+                    outputColumnNames: _col0, _col1, _col2, _col3
+                    Statistics: Num rows: 50024305 Data size: 790375939 Basic 
stats: COMPLETE Column stats: NONE
+                    Group By Operator
+                      aggregations: sum(_col2), sum(_col3)
+                      keys: _col0 (type: string), _col1 (type: string)
+                      mode: hash
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 50024305 Data size: 790375939 
Basic stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: string), _col1 (type: 
string)
+                        sort order: ++
+                        Map-reduce partition columns: _col0 (type: string), 
_col1 (type: string)
+                        Statistics: Num rows: 50024305 Data size: 790375939 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col2 (type: bigint), _col3 (type: 
bigint)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: sum(VALUE._col0), sum(VALUE._col1)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 25012152 Data size: 395187961 Basic 
stats: COMPLETE Column stats: NONE
+                Filter Operator
+                  predicate: CASE WHEN ((_col2 > 0)) THEN ((UDFToDouble(_col3) 
/ UDFToDouble(_col2)) BETWEEN 0.6666666666666666 AND 1.5) ELSE (null) END 
(type: boolean)
+                  Statistics: Num rows: 12506076 Data size: 197593980 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string), _col1 (type: string)
+                    sort order: ++
+                    Statistics: Num rows: 12506076 Data size: 197593980 Basic 
stats: COMPLETE Column stats: NONE
+                    TopN Hash Memory Usage: 0.1
+                    value expressions: _col2 (type: bigint), _col3 (type: 
bigint)
+        Reducer 4 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey0 (type: string), 
KEY.reducesinkkey1 (type: string), VALUE._col0 (type: bigint), VALUE._col1 
(type: bigint)
+                outputColumnNames: _col0, _col1, _col2, _col3
+                Statistics: Num rows: 12506076 Data size: 197593980 Basic 
stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 100
+                  Statistics: Num rows: 100 Data size: 1500 Basic stats: 
COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 100 Data size: 1500 Basic stats: 
COMPLETE Column stats: NONE
+                    table:
+                        input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 100
+      Processor Tree:
+        ListSink
+

http://git-wip-us.apache.org/repos/asf/hive/blob/bd371246/ql/src/test/results/clientpositive/perf/spark/query22.q.out
----------------------------------------------------------------------
diff --git a/ql/src/test/results/clientpositive/perf/spark/query22.q.out 
b/ql/src/test/results/clientpositive/perf/spark/query22.q.out
new file mode 100644
index 0000000..15fe441
--- /dev/null
+++ b/ql/src/test/results/clientpositive/perf/spark/query22.q.out
@@ -0,0 +1,218 @@
+PREHOOK: query: explain
+select  i_product_name
+             ,i_brand
+             ,i_class
+             ,i_category
+             ,avg(inv_quantity_on_hand) qoh
+       from inventory
+           ,date_dim
+           ,item
+           ,warehouse
+       where inv_date_sk=d_date_sk
+              and inv_item_sk=i_item_sk
+              and inv_warehouse_sk = w_warehouse_sk
+              and d_month_seq between 1212 and 1212 + 11
+       group by rollup(i_product_name
+                       ,i_brand
+                       ,i_class
+                       ,i_category)
+order by qoh, i_product_name, i_brand, i_class, i_category
+limit 100
+PREHOOK: type: QUERY
+POSTHOOK: query: explain
+select  i_product_name
+             ,i_brand
+             ,i_class
+             ,i_category
+             ,avg(inv_quantity_on_hand) qoh
+       from inventory
+           ,date_dim
+           ,item
+           ,warehouse
+       where inv_date_sk=d_date_sk
+              and inv_item_sk=i_item_sk
+              and inv_warehouse_sk = w_warehouse_sk
+              and d_month_seq between 1212 and 1212 + 11
+       group by rollup(i_product_name
+                       ,i_brand
+                       ,i_class
+                       ,i_category)
+order by qoh, i_product_name, i_brand, i_class, i_category
+limit 100
+POSTHOOK: type: QUERY
+STAGE DEPENDENCIES:
+  Stage-2 is a root stage
+  Stage-1 depends on stages: Stage-2
+  Stage-0 depends on stages: Stage-1
+
+STAGE PLANS:
+  Stage: Stage-2
+    Spark
+#### A masked pattern was here ####
+      Vertices:
+        Map 5 
+            Map Operator Tree:
+                TableScan
+                  alias: date_dim
+                  Statistics: Num rows: 73049 Data size: 81741831 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (d_date_sk is not null and d_month_seq BETWEEN 
1212 AND 1223) (type: boolean)
+                    Statistics: Num rows: 8116 Data size: 9081804 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: d_date_sk (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 8116 Data size: 9081804 Basic 
stats: COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 6 
+            Map Operator Tree:
+                TableScan
+                  alias: warehouse
+                  Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: w_warehouse_sk is not null (type: boolean)
+                    Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: w_warehouse_sk (type: int)
+                      outputColumnNames: _col0
+                      Statistics: Num rows: 27 Data size: 27802 Basic stats: 
COMPLETE Column stats: NONE
+                      Spark HashTable Sink Operator
+                        keys:
+                          0 _col2 (type: int)
+                          1 _col0 (type: int)
+            Local Work:
+              Map Reduce Local Work
+
+  Stage: Stage-1
+    Spark
+      Edges:
+        Reducer 2 <- Map 1 (PARTITION-LEVEL SORT, 11), Map 7 (PARTITION-LEVEL 
SORT, 11)
+        Reducer 3 <- Reducer 2 (GROUP, 31)
+        Reducer 4 <- Reducer 3 (SORT, 1)
+#### A masked pattern was here ####
+      Vertices:
+        Map 1 
+            Map Operator Tree:
+                TableScan
+                  alias: inventory
+                  Statistics: Num rows: 37584000 Data size: 593821104 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: (inv_date_sk is not null and inv_item_sk is not 
null and inv_warehouse_sk is not null) (type: boolean)
+                    Statistics: Num rows: 37584000 Data size: 593821104 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: inv_date_sk (type: int), inv_item_sk (type: 
int), inv_warehouse_sk (type: int), inv_quantity_on_hand (type: int)
+                      outputColumnNames: _col0, _col1, _col2, _col3
+                      Statistics: Num rows: 37584000 Data size: 593821104 
Basic stats: COMPLETE Column stats: NONE
+                      Map Join Operator
+                        condition map:
+                             Inner Join 0 to 1
+                        keys:
+                          0 _col0 (type: int)
+                          1 _col0 (type: int)
+                        outputColumnNames: _col1, _col2, _col3
+                        input vertices:
+                          1 Map 5
+                        Statistics: Num rows: 41342400 Data size: 653203228 
Basic stats: COMPLETE Column stats: NONE
+                        Map Join Operator
+                          condition map:
+                               Inner Join 0 to 1
+                          keys:
+                            0 _col2 (type: int)
+                            1 _col0 (type: int)
+                          outputColumnNames: _col1, _col3
+                          input vertices:
+                            1 Map 6
+                          Statistics: Num rows: 45476640 Data size: 718523566 
Basic stats: COMPLETE Column stats: NONE
+                          Reduce Output Operator
+                            key expressions: _col1 (type: int)
+                            sort order: +
+                            Map-reduce partition columns: _col1 (type: int)
+                            Statistics: Num rows: 45476640 Data size: 
718523566 Basic stats: COMPLETE Column stats: NONE
+                            value expressions: _col3 (type: int)
+            Local Work:
+              Map Reduce Local Work
+        Map 7 
+            Map Operator Tree:
+                TableScan
+                  alias: item
+                  Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                  Filter Operator
+                    predicate: i_item_sk is not null (type: boolean)
+                    Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                    Select Operator
+                      expressions: i_item_sk (type: int), i_brand (type: 
string), i_class (type: string), i_category (type: string), i_product_name 
(type: string)
+                      outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                      Statistics: Num rows: 462000 Data size: 663560457 Basic 
stats: COMPLETE Column stats: NONE
+                      Reduce Output Operator
+                        key expressions: _col0 (type: int)
+                        sort order: +
+                        Map-reduce partition columns: _col0 (type: int)
+                        Statistics: Num rows: 462000 Data size: 663560457 
Basic stats: COMPLETE Column stats: NONE
+                        value expressions: _col1 (type: string), _col2 (type: 
string), _col3 (type: string), _col4 (type: string)
+        Reducer 2 
+            Reduce Operator Tree:
+              Join Operator
+                condition map:
+                     Inner Join 0 to 1
+                keys:
+                  0 _col1 (type: int)
+                  1 _col0 (type: int)
+                outputColumnNames: _col3, _col8, _col9, _col10, _col11
+                Statistics: Num rows: 50024305 Data size: 790375939 Basic 
stats: COMPLETE Column stats: NONE
+                Group By Operator
+                  aggregations: avg(_col3)
+                  keys: _col8 (type: string), _col9 (type: string), _col10 
(type: string), _col11 (type: string), 0 (type: int)
+                  mode: hash
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
+                  Statistics: Num rows: 250121525 Data size: 3951879695 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col0 (type: string), _col1 (type: 
string), _col2 (type: string), _col3 (type: string), _col4 (type: int)
+                    sort order: +++++
+                    Map-reduce partition columns: _col0 (type: string), _col1 
(type: string), _col2 (type: string), _col3 (type: string), _col4 (type: int)
+                    Statistics: Num rows: 250121525 Data size: 3951879695 
Basic stats: COMPLETE Column stats: NONE
+                    value expressions: _col5 (type: 
struct<count:bigint,sum:double,input:int>)
+        Reducer 3 
+            Reduce Operator Tree:
+              Group By Operator
+                aggregations: avg(VALUE._col0)
+                keys: KEY._col0 (type: string), KEY._col1 (type: string), 
KEY._col2 (type: string), KEY._col3 (type: string), KEY._col4 (type: int)
+                mode: mergepartial
+                outputColumnNames: _col0, _col1, _col2, _col3, _col5
+                Statistics: Num rows: 125060762 Data size: 1975939839 Basic 
stats: COMPLETE Column stats: NONE
+                pruneGroupingSetId: true
+                Select Operator
+                  expressions: _col3 (type: string), _col0 (type: string), 
_col1 (type: string), _col2 (type: string), _col5 (type: double)
+                  outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                  Statistics: Num rows: 125060762 Data size: 1975939839 Basic 
stats: COMPLETE Column stats: NONE
+                  Reduce Output Operator
+                    key expressions: _col4 (type: double), _col0 (type: 
string), _col1 (type: string), _col2 (type: string), _col3 (type: string)
+                    sort order: +++++
+                    Statistics: Num rows: 125060762 Data size: 1975939839 
Basic stats: COMPLETE Column stats: NONE
+                    TopN Hash Memory Usage: 0.1
+        Reducer 4 
+            Reduce Operator Tree:
+              Select Operator
+                expressions: KEY.reducesinkkey1 (type: string), 
KEY.reducesinkkey2 (type: string), KEY.reducesinkkey3 (type: string), 
KEY.reducesinkkey4 (type: string), KEY.reducesinkkey0 (type: double)
+                outputColumnNames: _col0, _col1, _col2, _col3, _col4
+                Statistics: Num rows: 125060762 Data size: 1975939839 Basic 
stats: COMPLETE Column stats: NONE
+                Limit
+                  Number of rows: 100
+                  Statistics: Num rows: 100 Data size: 1500 Basic stats: 
COMPLETE Column stats: NONE
+                  File Output Operator
+                    compressed: false
+                    Statistics: Num rows: 100 Data size: 1500 Basic stats: 
COMPLETE Column stats: NONE
+                    table:
+                        input format: 
org.apache.hadoop.mapred.SequenceFileInputFormat
+                        output format: 
org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
+                        serde: 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 100
+      Processor Tree:
+        ListSink
+

Reply via email to