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


(1) Scan parquet spark_catalog.default.store_sales
Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#7)]
PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<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_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7]

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

(4) Exchange
Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7]
Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]

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

(6) Scan parquet spark_catalog.default.store_returns
Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#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:int,sr_ticket_number:int>

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

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

(9) Project [codegen id : 3]
Output [2]: [sr_item_sk#8, sr_ticket_number#9]
Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10]

(10) Exchange
Input [2]: [sr_item_sk#8, sr_ticket_number#9]
Arguments: hashpartitioning(sr_ticket_number#9, sr_item_sk#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]

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

(12) SortMergeJoin [codegen id : 6]
Left keys [2]: [ss_ticket_number#3, ss_item_sk#1]
Right keys [2]: [sr_ticket_number#9, sr_item_sk#8]
Join type: LeftOuter
Join condition: None

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

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

(15) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#11, d_year#12]
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>

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

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

(18) BroadcastExchange
Input [2]: [d_date_sk#11, d_year#12]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

(19) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#7]
Right keys [1]: [d_date_sk#11]
Join type: Inner
Join condition: None

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

(21) HashAggregate [codegen id : 6]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#12]
Keys [3]: [d_year#12, ss_item_sk#1, ss_customer_sk#2]
Functions [3]: [partial_sum(ss_quantity#4), partial_sum(UnscaledValue(ss_wholesale_cost#5)), partial_sum(UnscaledValue(ss_sales_price#6))]
Aggregate Attributes [3]: [sum#13, sum#14, sum#15]
Results [6]: [d_year#12, ss_item_sk#1, ss_customer_sk#2, sum#16, sum#17, sum#18]

(22) Exchange
Input [6]: [d_year#12, ss_item_sk#1, ss_customer_sk#2, sum#16, sum#17, sum#18]
Arguments: hashpartitioning(d_year#12, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(23) HashAggregate [codegen id : 7]
Input [6]: [d_year#12, ss_item_sk#1, ss_customer_sk#2, sum#16, sum#17, sum#18]
Keys [3]: [d_year#12, ss_item_sk#1, ss_customer_sk#2]
Functions [3]: [sum(ss_quantity#4), sum(UnscaledValue(ss_wholesale_cost#5)), sum(UnscaledValue(ss_sales_price#6))]
Aggregate Attributes [3]: [sum(ss_quantity#4)#19, sum(UnscaledValue(ss_wholesale_cost#5))#20, sum(UnscaledValue(ss_sales_price#6))#21]
Results [6]: [d_year#12 AS ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#19 AS ss_qty#23, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#20,17,2) AS ss_wc#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#21,17,2) AS ss_sp#25]

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

(25) Scan parquet spark_catalog.default.web_sales
Output [7]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#32)]
PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<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)>

(26) ColumnarToRow [codegen id : 8]
Input [7]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]

(27) Filter [codegen id : 8]
Input [7]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]
Condition : (isnotnull(ws_item_sk#26) AND isnotnull(ws_bill_customer_sk#27))

(28) Exchange
Input [7]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]
Arguments: hashpartitioning(ws_order_number#28, ws_item_sk#26, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(29) Sort [codegen id : 9]
Input [7]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]
Arguments: [ws_order_number#28 ASC NULLS FIRST, ws_item_sk#26 ASC NULLS FIRST], false, 0

(30) Scan parquet spark_catalog.default.web_returns
Output [3]: [wr_item_sk#33, wr_order_number#34, wr_returned_date_sk#35]
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:int,wr_order_number:int>

(31) ColumnarToRow [codegen id : 10]
Input [3]: [wr_item_sk#33, wr_order_number#34, wr_returned_date_sk#35]

(32) Filter [codegen id : 10]
Input [3]: [wr_item_sk#33, wr_order_number#34, wr_returned_date_sk#35]
Condition : (isnotnull(wr_order_number#34) AND isnotnull(wr_item_sk#33))

(33) Project [codegen id : 10]
Output [2]: [wr_item_sk#33, wr_order_number#34]
Input [3]: [wr_item_sk#33, wr_order_number#34, wr_returned_date_sk#35]

(34) Exchange
Input [2]: [wr_item_sk#33, wr_order_number#34]
Arguments: hashpartitioning(wr_order_number#34, wr_item_sk#33, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(35) Sort [codegen id : 11]
Input [2]: [wr_item_sk#33, wr_order_number#34]
Arguments: [wr_order_number#34 ASC NULLS FIRST, wr_item_sk#33 ASC NULLS FIRST], false, 0

(36) SortMergeJoin [codegen id : 13]
Left keys [2]: [ws_order_number#28, ws_item_sk#26]
Right keys [2]: [wr_order_number#34, wr_item_sk#33]
Join type: LeftOuter
Join condition: None

(37) Filter [codegen id : 13]
Input [9]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32, wr_item_sk#33, wr_order_number#34]
Condition : isnull(wr_order_number#34)

(38) Project [codegen id : 13]
Output [6]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32]
Input [9]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_order_number#28, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32, wr_item_sk#33, wr_order_number#34]

(39) ReusedExchange [Reuses operator id: 18]
Output [2]: [d_date_sk#36, d_year#37]

(40) BroadcastHashJoin [codegen id : 13]
Left keys [1]: [ws_sold_date_sk#32]
Right keys [1]: [d_date_sk#36]
Join type: Inner
Join condition: None

(41) Project [codegen id : 13]
Output [6]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, d_year#37]
Input [8]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, ws_sold_date_sk#32, d_date_sk#36, d_year#37]

(42) HashAggregate [codegen id : 13]
Input [6]: [ws_item_sk#26, ws_bill_customer_sk#27, ws_quantity#29, ws_wholesale_cost#30, ws_sales_price#31, d_year#37]
Keys [3]: [d_year#37, ws_item_sk#26, ws_bill_customer_sk#27]
Functions [3]: [partial_sum(ws_quantity#29), partial_sum(UnscaledValue(ws_wholesale_cost#30)), partial_sum(UnscaledValue(ws_sales_price#31))]
Aggregate Attributes [3]: [sum#38, sum#39, sum#40]
Results [6]: [d_year#37, ws_item_sk#26, ws_bill_customer_sk#27, sum#41, sum#42, sum#43]

(43) Exchange
Input [6]: [d_year#37, ws_item_sk#26, ws_bill_customer_sk#27, sum#41, sum#42, sum#43]
Arguments: hashpartitioning(d_year#37, ws_item_sk#26, ws_bill_customer_sk#27, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(44) HashAggregate [codegen id : 14]
Input [6]: [d_year#37, ws_item_sk#26, ws_bill_customer_sk#27, sum#41, sum#42, sum#43]
Keys [3]: [d_year#37, ws_item_sk#26, ws_bill_customer_sk#27]
Functions [3]: [sum(ws_quantity#29), sum(UnscaledValue(ws_wholesale_cost#30)), sum(UnscaledValue(ws_sales_price#31))]
Aggregate Attributes [3]: [sum(ws_quantity#29)#44, sum(UnscaledValue(ws_wholesale_cost#30))#45, sum(UnscaledValue(ws_sales_price#31))#46]
Results [6]: [d_year#37 AS ws_sold_year#47, ws_item_sk#26, ws_bill_customer_sk#27 AS ws_customer_sk#48, sum(ws_quantity#29)#44 AS ws_qty#49, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#30))#45,17,2) AS ws_wc#50, MakeDecimal(sum(UnscaledValue(ws_sales_price#31))#46,17,2) AS ws_sp#51]

(45) Filter [codegen id : 14]
Input [6]: [ws_sold_year#47, ws_item_sk#26, ws_customer_sk#48, ws_qty#49, ws_wc#50, ws_sp#51]
Condition : (coalesce(ws_qty#49, 0) > 0)

(46) Sort [codegen id : 14]
Input [6]: [ws_sold_year#47, ws_item_sk#26, ws_customer_sk#48, ws_qty#49, ws_wc#50, ws_sp#51]
Arguments: [ws_sold_year#47 ASC NULLS FIRST, ws_item_sk#26 ASC NULLS FIRST, ws_customer_sk#48 ASC NULLS FIRST], false, 0

(47) SortMergeJoin [codegen id : 15]
Left keys [3]: [ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2]
Right keys [3]: [ws_sold_year#47, ws_item_sk#26, ws_customer_sk#48]
Join type: Inner
Join condition: None

(48) Project [codegen id : 15]
Output [9]: [ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, ss_qty#23, ss_wc#24, ss_sp#25, ws_qty#49, ws_wc#50, ws_sp#51]
Input [12]: [ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, ss_qty#23, ss_wc#24, ss_sp#25, ws_sold_year#47, ws_item_sk#26, ws_customer_sk#48, ws_qty#49, ws_wc#50, ws_sp#51]

(49) Scan parquet spark_catalog.default.catalog_sales
Output [7]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#58)]
PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<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)>

(50) ColumnarToRow [codegen id : 16]
Input [7]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]

(51) Filter [codegen id : 16]
Input [7]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]
Condition : (isnotnull(cs_item_sk#53) AND isnotnull(cs_bill_customer_sk#52))

(52) Exchange
Input [7]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]
Arguments: hashpartitioning(cs_order_number#54, cs_item_sk#53, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(53) Sort [codegen id : 17]
Input [7]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]
Arguments: [cs_order_number#54 ASC NULLS FIRST, cs_item_sk#53 ASC NULLS FIRST], false, 0

(54) Scan parquet spark_catalog.default.catalog_returns
Output [3]: [cr_item_sk#59, cr_order_number#60, cr_returned_date_sk#61]
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>

(55) ColumnarToRow [codegen id : 18]
Input [3]: [cr_item_sk#59, cr_order_number#60, cr_returned_date_sk#61]

(56) Filter [codegen id : 18]
Input [3]: [cr_item_sk#59, cr_order_number#60, cr_returned_date_sk#61]
Condition : (isnotnull(cr_order_number#60) AND isnotnull(cr_item_sk#59))

(57) Project [codegen id : 18]
Output [2]: [cr_item_sk#59, cr_order_number#60]
Input [3]: [cr_item_sk#59, cr_order_number#60, cr_returned_date_sk#61]

(58) Exchange
Input [2]: [cr_item_sk#59, cr_order_number#60]
Arguments: hashpartitioning(cr_order_number#60, cr_item_sk#59, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(59) Sort [codegen id : 19]
Input [2]: [cr_item_sk#59, cr_order_number#60]
Arguments: [cr_order_number#60 ASC NULLS FIRST, cr_item_sk#59 ASC NULLS FIRST], false, 0

(60) SortMergeJoin [codegen id : 21]
Left keys [2]: [cs_order_number#54, cs_item_sk#53]
Right keys [2]: [cr_order_number#60, cr_item_sk#59]
Join type: LeftOuter
Join condition: None

(61) Filter [codegen id : 21]
Input [9]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58, cr_item_sk#59, cr_order_number#60]
Condition : isnull(cr_order_number#60)

(62) Project [codegen id : 21]
Output [6]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58]
Input [9]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_order_number#54, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58, cr_item_sk#59, cr_order_number#60]

(63) ReusedExchange [Reuses operator id: 18]
Output [2]: [d_date_sk#62, d_year#63]

(64) BroadcastHashJoin [codegen id : 21]
Left keys [1]: [cs_sold_date_sk#58]
Right keys [1]: [d_date_sk#62]
Join type: Inner
Join condition: None

(65) Project [codegen id : 21]
Output [6]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, d_year#63]
Input [8]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, cs_sold_date_sk#58, d_date_sk#62, d_year#63]

(66) HashAggregate [codegen id : 21]
Input [6]: [cs_bill_customer_sk#52, cs_item_sk#53, cs_quantity#55, cs_wholesale_cost#56, cs_sales_price#57, d_year#63]
Keys [3]: [d_year#63, cs_item_sk#53, cs_bill_customer_sk#52]
Functions [3]: [partial_sum(cs_quantity#55), partial_sum(UnscaledValue(cs_wholesale_cost#56)), partial_sum(UnscaledValue(cs_sales_price#57))]
Aggregate Attributes [3]: [sum#64, sum#65, sum#66]
Results [6]: [d_year#63, cs_item_sk#53, cs_bill_customer_sk#52, sum#67, sum#68, sum#69]

(67) Exchange
Input [6]: [d_year#63, cs_item_sk#53, cs_bill_customer_sk#52, sum#67, sum#68, sum#69]
Arguments: hashpartitioning(d_year#63, cs_item_sk#53, cs_bill_customer_sk#52, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(68) HashAggregate [codegen id : 22]
Input [6]: [d_year#63, cs_item_sk#53, cs_bill_customer_sk#52, sum#67, sum#68, sum#69]
Keys [3]: [d_year#63, cs_item_sk#53, cs_bill_customer_sk#52]
Functions [3]: [sum(cs_quantity#55), sum(UnscaledValue(cs_wholesale_cost#56)), sum(UnscaledValue(cs_sales_price#57))]
Aggregate Attributes [3]: [sum(cs_quantity#55)#70, sum(UnscaledValue(cs_wholesale_cost#56))#71, sum(UnscaledValue(cs_sales_price#57))#72]
Results [6]: [d_year#63 AS cs_sold_year#73, cs_item_sk#53, cs_bill_customer_sk#52 AS cs_customer_sk#74, sum(cs_quantity#55)#70 AS cs_qty#75, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#56))#71,17,2) AS cs_wc#76, MakeDecimal(sum(UnscaledValue(cs_sales_price#57))#72,17,2) AS cs_sp#77]

(69) Filter [codegen id : 22]
Input [6]: [cs_sold_year#73, cs_item_sk#53, cs_customer_sk#74, cs_qty#75, cs_wc#76, cs_sp#77]
Condition : (coalesce(cs_qty#75, 0) > 0)

(70) Sort [codegen id : 22]
Input [6]: [cs_sold_year#73, cs_item_sk#53, cs_customer_sk#74, cs_qty#75, cs_wc#76, cs_sp#77]
Arguments: [cs_sold_year#73 ASC NULLS FIRST, cs_item_sk#53 ASC NULLS FIRST, cs_customer_sk#74 ASC NULLS FIRST], false, 0

(71) SortMergeJoin [codegen id : 23]
Left keys [3]: [ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2]
Right keys [3]: [cs_sold_year#73, cs_item_sk#53, cs_customer_sk#74]
Join type: Inner
Join condition: None

(72) Project [codegen id : 23]
Output [13]: [round((cast(ss_qty#23 as double) / cast(coalesce((ws_qty#49 + cs_qty#75), 1) as double)), 2) AS ratio#78, ss_qty#23 AS store_qty#79, ss_wc#24 AS store_wholesale_cost#80, ss_sp#25 AS store_sales_price#81, (coalesce(ws_qty#49, 0) + coalesce(cs_qty#75, 0)) AS other_chan_qty#82, (coalesce(ws_wc#50, 0.00) + coalesce(cs_wc#76, 0.00)) AS other_chan_wholesale_cost#83, (coalesce(ws_sp#51, 0.00) + coalesce(cs_sp#77, 0.00)) AS other_chan_sales_price#84, ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, ss_qty#23, ss_wc#24, ss_sp#25]
Input [15]: [ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, ss_qty#23, ss_wc#24, ss_sp#25, ws_qty#49, ws_wc#50, ws_sp#51, cs_sold_year#73, cs_item_sk#53, cs_customer_sk#74, cs_qty#75, cs_wc#76, cs_sp#77]

(73) TakeOrderedAndProject
Input [13]: [ratio#78, store_qty#79, store_wholesale_cost#80, store_sales_price#81, other_chan_qty#82, other_chan_wholesale_cost#83, other_chan_sales_price#84, ss_sold_year#22, ss_item_sk#1, ss_customer_sk#2, ss_qty#23, ss_wc#24, ss_sp#25]
Arguments: 100, [ss_sold_year#22 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST, ss_qty#23 DESC NULLS LAST, ss_wc#24 DESC NULLS LAST, ss_sp#25 DESC NULLS LAST, other_chan_qty#82 ASC NULLS FIRST, other_chan_wholesale_cost#83 ASC NULLS FIRST, other_chan_sales_price#84 ASC NULLS FIRST, ratio#78 ASC NULLS FIRST], [ratio#78, store_qty#79, store_wholesale_cost#80, store_sales_price#81, other_chan_qty#82, other_chan_wholesale_cost#83, other_chan_sales_price#84]

