== Physical Plan ==
TakeOrderedAndProject (70)
+- * Project (69)
   +- * SortMergeJoin Inner (68)
      :- * Project (46)
      :  +- * SortMergeJoin Inner (45)
      :     :- * Sort (23)
      :     :  +- * HashAggregate (22)
      :     :     +- Exchange (21)
      :     :        +- * HashAggregate (20)
      :     :           +- * Project (19)
      :     :              +- * BroadcastHashJoin Inner BuildRight (18)
      :     :                 :- * Project (13)
      :     :                 :  +- * Filter (12)
      :     :                 :     +- SortMergeJoin LeftOuter (11)
      :     :                 :        :- * Sort (5)
      :     :                 :        :  +- Exchange (4)
      :     :                 :        :     +- * Filter (3)
      :     :                 :        :        +- * ColumnarToRow (2)
      :     :                 :        :           +- Scan parquet default.store_sales (1)
      :     :                 :        +- * Sort (10)
      :     :                 :           +- Exchange (9)
      :     :                 :              +- * Filter (8)
      :     :                 :                 +- * ColumnarToRow (7)
      :     :                 :                    +- Scan parquet default.store_returns (6)
      :     :                 +- BroadcastExchange (17)
      :     :                    +- * Filter (16)
      :     :                       +- * ColumnarToRow (15)
      :     :                          +- Scan parquet default.date_dim (14)
      :     +- * Sort (44)
      :        +- * Filter (43)
      :           +- * HashAggregate (42)
      :              +- Exchange (41)
      :                 +- * HashAggregate (40)
      :                    +- * Project (39)
      :                       +- * BroadcastHashJoin Inner BuildRight (38)
      :                          :- * Project (36)
      :                          :  +- * Filter (35)
      :                          :     +- SortMergeJoin LeftOuter (34)
      :                          :        :- * Sort (28)
      :                          :        :  +- Exchange (27)
      :                          :        :     +- * Filter (26)
      :                          :        :        +- * ColumnarToRow (25)
      :                          :        :           +- Scan parquet default.catalog_sales (24)
      :                          :        +- * Sort (33)
      :                          :           +- Exchange (32)
      :                          :              +- * Filter (31)
      :                          :                 +- * ColumnarToRow (30)
      :                          :                    +- Scan parquet default.catalog_returns (29)
      :                          +- ReusedExchange (37)
      +- * Sort (67)
         +- * Filter (66)
            +- * HashAggregate (65)
               +- Exchange (64)
                  +- * HashAggregate (63)
                     +- * Project (62)
                        +- * BroadcastHashJoin Inner BuildRight (61)
                           :- * Project (59)
                           :  +- * Filter (58)
                           :     +- SortMergeJoin LeftOuter (57)
                           :        :- * Sort (51)
                           :        :  +- Exchange (50)
                           :        :     +- * Filter (49)
                           :        :        +- * ColumnarToRow (48)
                           :        :           +- Scan parquet default.web_sales (47)
                           :        +- * Sort (56)
                           :           +- Exchange (55)
                           :              +- * Filter (54)
                           :                 +- * ColumnarToRow (53)
                           :                    +- Scan parquet default.web_returns (52)
                           +- ReusedExchange (60)


(1) Scan parquet default.store_sales
Output [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int,ss_customer_sk:int,ss_ticket_number:int,ss_quantity:int,ss_wholesale_cost:decimal(7,2),ss_sales_price:decimal(7,2)>

(2) ColumnarToRow [codegen id : 1]
Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]

(3) Filter [codegen id : 1]
Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]
Condition : ((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_item_sk#2)) AND isnotnull(ss_customer_sk#3))

(4) Exchange
Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]
Arguments: hashpartitioning(cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint), 5), true, [id=#8]

(5) Sort [codegen id : 2]
Input [7]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]
Arguments: [cast(ss_ticket_number#4 as bigint) ASC NULLS FIRST, cast(ss_item_sk#2 as bigint) ASC NULLS FIRST], false, 0

(6) Scan parquet default.store_returns
Output [2]: [sr_item_sk#9, sr_ticket_number#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_returns]
PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)]
ReadSchema: struct<sr_item_sk:bigint,sr_ticket_number:bigint>

(7) ColumnarToRow [codegen id : 3]
Input [2]: [sr_item_sk#9, sr_ticket_number#10]

(8) Filter [codegen id : 3]
Input [2]: [sr_item_sk#9, sr_ticket_number#10]
Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9))

(9) Exchange
Input [2]: [sr_item_sk#9, sr_ticket_number#10]
Arguments: hashpartitioning(sr_ticket_number#10, sr_item_sk#9, 5), true, [id=#11]

(10) Sort [codegen id : 4]
Input [2]: [sr_item_sk#9, sr_ticket_number#10]
Arguments: [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST], false, 0

(11) SortMergeJoin
Left keys [2]: [cast(ss_ticket_number#4 as bigint), cast(ss_item_sk#2 as bigint)]
Right keys [2]: [sr_ticket_number#10, sr_item_sk#9]
Join condition: None

(12) Filter [codegen id : 6]
Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10]
Condition : isnull(sr_ticket_number#10)

(13) Project [codegen id : 6]
Output [6]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7]
Input [9]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_ticket_number#4, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, sr_item_sk#9, sr_ticket_number#10]

(14) Scan parquet default.date_dim
Output [2]: [d_date_sk#12, d_year#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(15) ColumnarToRow [codegen id : 5]
Input [2]: [d_date_sk#12, d_year#13]

(16) Filter [codegen id : 5]
Input [2]: [d_date_sk#12, d_year#13]
Condition : ((isnotnull(d_year#13) AND (d_year#13 = 2000)) AND isnotnull(d_date_sk#12))

(17) BroadcastExchange
Input [2]: [d_date_sk#12, d_year#13]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14]

(18) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#12]
Join condition: None

(19) Project [codegen id : 6]
Output [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13]
Input [8]: [ss_sold_date_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_date_sk#12, d_year#13]

(20) HashAggregate [codegen id : 6]
Input [6]: [ss_item_sk#2, ss_customer_sk#3, ss_quantity#5, ss_wholesale_cost#6, ss_sales_price#7, d_year#13]
Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3]
Functions [3]: [partial_sum(cast(ss_quantity#5 as bigint)), partial_sum(UnscaledValue(ss_wholesale_cost#6)), partial_sum(UnscaledValue(ss_sales_price#7))]
Aggregate Attributes [3]: [sum#15, sum#16, sum#17]
Results [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20]

(21) Exchange
Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20]
Arguments: hashpartitioning(d_year#13, ss_item_sk#2, ss_customer_sk#3, 5), true, [id=#21]

(22) HashAggregate [codegen id : 7]
Input [6]: [d_year#13, ss_item_sk#2, ss_customer_sk#3, sum#18, sum#19, sum#20]
Keys [3]: [d_year#13, ss_item_sk#2, ss_customer_sk#3]
Functions [3]: [sum(cast(ss_quantity#5 as bigint)), sum(UnscaledValue(ss_wholesale_cost#6)), sum(UnscaledValue(ss_sales_price#7))]
Aggregate Attributes [3]: [sum(cast(ss_quantity#5 as bigint))#22, sum(UnscaledValue(ss_wholesale_cost#6))#23, sum(UnscaledValue(ss_sales_price#7))#24]
Results [6]: [d_year#13 AS ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, sum(cast(ss_quantity#5 as bigint))#22 AS ss_qty#26, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#6))#23,17,2) AS ss_wc#27, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#24,17,2) AS ss_sp#28]

(23) Sort [codegen id : 7]
Input [6]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28]
Arguments: [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST], false, 0

(24) Scan parquet default.catalog_sales
Output [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_sold_date_sk), IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_bill_customer_sk:int,cs_item_sk:int,cs_order_number:int,cs_quantity:int,cs_wholesale_cost:decimal(7,2),cs_sales_price:decimal(7,2)>

(25) ColumnarToRow [codegen id : 8]
Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]

(26) Filter [codegen id : 8]
Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]
Condition : ((isnotnull(cs_sold_date_sk#29) AND isnotnull(cs_item_sk#31)) AND isnotnull(cs_bill_customer_sk#30))

(27) Exchange
Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]
Arguments: hashpartitioning(cs_order_number#32, cs_item_sk#31, 5), true, [id=#36]

(28) Sort [codegen id : 9]
Input [7]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]
Arguments: [cs_order_number#32 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST], false, 0

(29) Scan parquet default.catalog_returns
Output [2]: [cr_item_sk#37, cr_order_number#38]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_returns]
PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)]
ReadSchema: struct<cr_item_sk:int,cr_order_number:int>

(30) ColumnarToRow [codegen id : 10]
Input [2]: [cr_item_sk#37, cr_order_number#38]

(31) Filter [codegen id : 10]
Input [2]: [cr_item_sk#37, cr_order_number#38]
Condition : (isnotnull(cr_order_number#38) AND isnotnull(cr_item_sk#37))

(32) Exchange
Input [2]: [cr_item_sk#37, cr_order_number#38]
Arguments: hashpartitioning(cr_order_number#38, cr_item_sk#37, 5), true, [id=#39]

(33) Sort [codegen id : 11]
Input [2]: [cr_item_sk#37, cr_order_number#38]
Arguments: [cr_order_number#38 ASC NULLS FIRST, cr_item_sk#37 ASC NULLS FIRST], false, 0

(34) SortMergeJoin
Left keys [2]: [cs_order_number#32, cs_item_sk#31]
Right keys [2]: [cr_order_number#38, cr_item_sk#37]
Join condition: None

(35) Filter [codegen id : 13]
Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38]
Condition : isnull(cr_order_number#38)

(36) Project [codegen id : 13]
Output [6]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35]
Input [9]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_order_number#32, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, cr_item_sk#37, cr_order_number#38]

(37) ReusedExchange [Reuses operator id: 17]
Output [2]: [d_date_sk#12, d_year#13]

(38) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [cs_sold_date_sk#29]
Right keys [1]: [d_date_sk#12]
Join condition: None

(39) Project [codegen id : 13]
Output [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13]
Input [8]: [cs_sold_date_sk#29, cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_date_sk#12, d_year#13]

(40) HashAggregate [codegen id : 13]
Input [6]: [cs_bill_customer_sk#30, cs_item_sk#31, cs_quantity#33, cs_wholesale_cost#34, cs_sales_price#35, d_year#13]
Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30]
Functions [3]: [partial_sum(cast(cs_quantity#33 as bigint)), partial_sum(UnscaledValue(cs_wholesale_cost#34)), partial_sum(UnscaledValue(cs_sales_price#35))]
Aggregate Attributes [3]: [sum#40, sum#41, sum#42]
Results [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45]

(41) Exchange
Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45]
Arguments: hashpartitioning(d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, 5), true, [id=#46]

(42) HashAggregate [codegen id : 14]
Input [6]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30, sum#43, sum#44, sum#45]
Keys [3]: [d_year#13, cs_item_sk#31, cs_bill_customer_sk#30]
Functions [3]: [sum(cast(cs_quantity#33 as bigint)), sum(UnscaledValue(cs_wholesale_cost#34)), sum(UnscaledValue(cs_sales_price#35))]
Aggregate Attributes [3]: [sum(cast(cs_quantity#33 as bigint))#47, sum(UnscaledValue(cs_wholesale_cost#34))#48, sum(UnscaledValue(cs_sales_price#35))#49]
Results [6]: [d_year#13 AS cs_sold_year#50, cs_item_sk#31, cs_bill_customer_sk#30 AS cs_customer_sk#51, sum(cast(cs_quantity#33 as bigint))#47 AS cs_qty#52, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#34))#48,17,2) AS cs_wc#53, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#49,17,2) AS cs_sp#54]

(43) Filter [codegen id : 14]
Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54]
Condition : (coalesce(cs_qty#52, 0) > 0)

(44) Sort [codegen id : 14]
Input [6]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54]
Arguments: [cs_sold_year#50 ASC NULLS FIRST, cs_item_sk#31 ASC NULLS FIRST, cs_customer_sk#51 ASC NULLS FIRST], false, 0

(45) SortMergeJoin [codegen id : 15]
Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3]
Right keys [3]: [cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51]
Join condition: None

(46) Project [codegen id : 15]
Output [9]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54]
Input [12]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_sold_year#50, cs_item_sk#31, cs_customer_sk#51, cs_qty#52, cs_wc#53, cs_sp#54]

(47) Scan parquet default.web_sales
Output [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_bill_customer_sk:int,ws_order_number:int,ws_quantity:int,ws_wholesale_cost:decimal(7,2),ws_sales_price:decimal(7,2)>

(48) ColumnarToRow [codegen id : 16]
Input [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]

(49) Filter [codegen id : 16]
Input [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]
Condition : ((isnotnull(ws_sold_date_sk#55) AND isnotnull(ws_item_sk#56)) AND isnotnull(ws_bill_customer_sk#57))

(50) Exchange
Input [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]
Arguments: hashpartitioning(cast(ws_order_number#58 as bigint), cast(ws_item_sk#56 as bigint), 5), true, [id=#62]

(51) Sort [codegen id : 17]
Input [7]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]
Arguments: [cast(ws_order_number#58 as bigint) ASC NULLS FIRST, cast(ws_item_sk#56 as bigint) ASC NULLS FIRST], false, 0

(52) Scan parquet default.web_returns
Output [2]: [wr_item_sk#63, wr_order_number#64]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_returns]
PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)]
ReadSchema: struct<wr_item_sk:bigint,wr_order_number:bigint>

(53) ColumnarToRow [codegen id : 18]
Input [2]: [wr_item_sk#63, wr_order_number#64]

(54) Filter [codegen id : 18]
Input [2]: [wr_item_sk#63, wr_order_number#64]
Condition : (isnotnull(wr_order_number#64) AND isnotnull(wr_item_sk#63))

(55) Exchange
Input [2]: [wr_item_sk#63, wr_order_number#64]
Arguments: hashpartitioning(wr_order_number#64, wr_item_sk#63, 5), true, [id=#65]

(56) Sort [codegen id : 19]
Input [2]: [wr_item_sk#63, wr_order_number#64]
Arguments: [wr_order_number#64 ASC NULLS FIRST, wr_item_sk#63 ASC NULLS FIRST], false, 0

(57) SortMergeJoin
Left keys [2]: [cast(ws_order_number#58 as bigint), cast(ws_item_sk#56 as bigint)]
Right keys [2]: [wr_order_number#64, wr_item_sk#63]
Join condition: None

(58) Filter [codegen id : 21]
Input [9]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61, wr_item_sk#63, wr_order_number#64]
Condition : isnull(wr_order_number#64)

(59) Project [codegen id : 21]
Output [6]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61]
Input [9]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_order_number#58, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61, wr_item_sk#63, wr_order_number#64]

(60) ReusedExchange [Reuses operator id: 17]
Output [2]: [d_date_sk#12, d_year#13]

(61) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [ws_sold_date_sk#55]
Right keys [1]: [d_date_sk#12]
Join condition: None

(62) Project [codegen id : 21]
Output [6]: [ws_item_sk#56, ws_bill_customer_sk#57, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61, d_year#13]
Input [8]: [ws_sold_date_sk#55, ws_item_sk#56, ws_bill_customer_sk#57, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61, d_date_sk#12, d_year#13]

(63) HashAggregate [codegen id : 21]
Input [6]: [ws_item_sk#56, ws_bill_customer_sk#57, ws_quantity#59, ws_wholesale_cost#60, ws_sales_price#61, d_year#13]
Keys [3]: [d_year#13, ws_item_sk#56, ws_bill_customer_sk#57]
Functions [3]: [partial_sum(cast(ws_quantity#59 as bigint)), partial_sum(UnscaledValue(ws_wholesale_cost#60)), partial_sum(UnscaledValue(ws_sales_price#61))]
Aggregate Attributes [3]: [sum#66, sum#67, sum#68]
Results [6]: [d_year#13, ws_item_sk#56, ws_bill_customer_sk#57, sum#69, sum#70, sum#71]

(64) Exchange
Input [6]: [d_year#13, ws_item_sk#56, ws_bill_customer_sk#57, sum#69, sum#70, sum#71]
Arguments: hashpartitioning(d_year#13, ws_item_sk#56, ws_bill_customer_sk#57, 5), true, [id=#72]

(65) HashAggregate [codegen id : 22]
Input [6]: [d_year#13, ws_item_sk#56, ws_bill_customer_sk#57, sum#69, sum#70, sum#71]
Keys [3]: [d_year#13, ws_item_sk#56, ws_bill_customer_sk#57]
Functions [3]: [sum(cast(ws_quantity#59 as bigint)), sum(UnscaledValue(ws_wholesale_cost#60)), sum(UnscaledValue(ws_sales_price#61))]
Aggregate Attributes [3]: [sum(cast(ws_quantity#59 as bigint))#73, sum(UnscaledValue(ws_wholesale_cost#60))#74, sum(UnscaledValue(ws_sales_price#61))#75]
Results [6]: [d_year#13 AS ws_sold_year#76, ws_item_sk#56, ws_bill_customer_sk#57 AS ws_customer_sk#77, sum(cast(ws_quantity#59 as bigint))#73 AS ws_qty#78, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#60))#74,17,2) AS ws_wc#79, MakeDecimal(sum(UnscaledValue(ws_sales_price#61))#75,17,2) AS ws_sp#80]

(66) Filter [codegen id : 22]
Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80]
Condition : (coalesce(ws_qty#78, 0) > 0)

(67) Sort [codegen id : 22]
Input [6]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80]
Arguments: [ws_sold_year#76 ASC NULLS FIRST, ws_item_sk#56 ASC NULLS FIRST, ws_customer_sk#77 ASC NULLS FIRST], false, 0

(68) SortMergeJoin [codegen id : 23]
Left keys [3]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3]
Right keys [3]: [ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77]
Join condition: None

(69) Project [codegen id : 23]
Output [13]: [round((cast(ss_qty#26 as double) / cast(coalesce((ws_qty#78 + cs_qty#52), 1) as double)), 2) AS ratio#81, ss_qty#26 AS store_qty#82, ss_wc#27 AS store_wholesale_cost#83, ss_sp#28 AS store_sales_price#84, (coalesce(ws_qty#78, 0) + coalesce(cs_qty#52, 0)) AS other_chan_qty#85, CheckOverflow((promote_precision(cast(coalesce(ws_wc#79, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#53, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#86, CheckOverflow((promote_precision(cast(coalesce(ws_sp#80, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#54, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28]
Input [15]: [ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28, cs_qty#52, cs_wc#53, cs_sp#54, ws_sold_year#76, ws_item_sk#56, ws_customer_sk#77, ws_qty#78, ws_wc#79, ws_sp#80]

(70) TakeOrderedAndProject
Input [13]: [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87, ss_sold_year#25, ss_item_sk#2, ss_customer_sk#3, ss_qty#26, ss_wc#27, ss_sp#28]
Arguments: 100, [ss_sold_year#25 ASC NULLS FIRST, ss_item_sk#2 ASC NULLS FIRST, ss_customer_sk#3 ASC NULLS FIRST, ss_qty#26 DESC NULLS LAST, ss_wc#27 DESC NULLS LAST, ss_sp#28 DESC NULLS LAST, other_chan_qty#85 ASC NULLS FIRST, other_chan_wholesale_cost#86 ASC NULLS FIRST, other_chan_sales_price#87 ASC NULLS FIRST, ratio#81 ASC NULLS FIRST], [ratio#81, store_qty#82, store_wholesale_cost#83, store_sales_price#84, other_chan_qty#85, other_chan_wholesale_cost#86, other_chan_sales_price#87]

