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


(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), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
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) CometFilter
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))

(3) CometColumnarExchange
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, CometColumnarShuffle, [plan_id=1]

(4) CometSort
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_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], [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST]

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

(6) CometFilter
Input [3]: [sr_item_sk#9, sr_ticket_number#10, sr_returned_date_sk#11]
Condition : (isnotnull(sr_ticket_number#10) AND isnotnull(sr_item_sk#9))

(7) CometProject
Input [3]: [sr_item_sk#9, sr_ticket_number#10, sr_returned_date_sk#11]
Arguments: [sr_item_sk#9, sr_ticket_number#10], [sr_item_sk#9, sr_ticket_number#10]

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

(9) CometSort
Input [2]: [sr_item_sk#9, sr_ticket_number#10]
Arguments: [sr_item_sk#9, sr_ticket_number#10], [sr_ticket_number#10 ASC NULLS FIRST, sr_item_sk#9 ASC NULLS FIRST]

(10) CometSortMergeJoin
Left 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]
Right output [2]: [sr_item_sk#9, sr_ticket_number#10]
Arguments: [ss_ticket_number#3, ss_item_sk#1], [sr_ticket_number#10, sr_item_sk#9], LeftOuter

(11) CometFilter
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#9, sr_ticket_number#10]
Condition : isnull(sr_ticket_number#10)

(12) CometProject
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#9, sr_ticket_number#10]
Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7], [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7]

(13) Scan parquet spark_catalog.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>

(14) CometFilter
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))

(15) CometBroadcastExchange
Input [2]: [d_date_sk#12, d_year#13]
Arguments: [d_date_sk#12, d_year#13]

(16) CometBroadcastHashJoin
Left 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]
Right output [2]: [d_date_sk#12, d_year#13]
Arguments: [ss_sold_date_sk#7], [d_date_sk#12], Inner, BuildRight

(17) CometProject
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#12, d_year#13]
Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#13], [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#13]

(18) ColumnarToRow [codegen id : 1]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#13]

(19) HashAggregate [codegen id : 1]
Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#13]
Keys [3]: [d_year#13, 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#14, sum#15, sum#16]
Results [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#17, sum#18, sum#19]

(20) RowToColumnar
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#17, sum#18, sum#19]

(21) CometColumnarExchange
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#17, sum#18, sum#19]
Arguments: hashpartitioning(d_year#13, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=3]

(22) ColumnarToRow [codegen id : 2]
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#17, sum#18, sum#19]

(23) HashAggregate [codegen id : 2]
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#17, sum#18, sum#19]
Keys [3]: [d_year#13, 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)#20, sum(UnscaledValue(ss_wholesale_cost#5))#21, sum(UnscaledValue(ss_sales_price#6))#22]
Results [6]: [d_year#13 AS ss_sold_year#23, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#20 AS ss_qty#24, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#21,17,2) AS ss_wc#25, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#22,17,2) AS ss_sp#26]

(24) Sort [codegen id : 2]
Input [6]: [ss_sold_year#23, ss_item_sk#1, ss_customer_sk#2, ss_qty#24, ss_wc#25, ss_sp#26]
Arguments: [ss_sold_year#23 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#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#33), dynamicpruningexpression(ws_sold_date_sk#33 IN dynamicpruning#34)]
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) CometFilter
Input [7]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]
Condition : (isnotnull(ws_item_sk#27) AND isnotnull(ws_bill_customer_sk#28))

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

(28) CometSort
Input [7]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]
Arguments: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33], [ws_order_number#29 ASC NULLS FIRST, ws_item_sk#27 ASC NULLS FIRST]

(29) Scan parquet spark_catalog.default.web_returns
Output [3]: [wr_item_sk#35, wr_order_number#36, wr_returned_date_sk#37]
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>

(30) CometFilter
Input [3]: [wr_item_sk#35, wr_order_number#36, wr_returned_date_sk#37]
Condition : (isnotnull(wr_order_number#36) AND isnotnull(wr_item_sk#35))

(31) CometProject
Input [3]: [wr_item_sk#35, wr_order_number#36, wr_returned_date_sk#37]
Arguments: [wr_item_sk#35, wr_order_number#36], [wr_item_sk#35, wr_order_number#36]

(32) CometColumnarExchange
Input [2]: [wr_item_sk#35, wr_order_number#36]
Arguments: hashpartitioning(wr_order_number#36, wr_item_sk#35, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=5]

(33) CometSort
Input [2]: [wr_item_sk#35, wr_order_number#36]
Arguments: [wr_item_sk#35, wr_order_number#36], [wr_order_number#36 ASC NULLS FIRST, wr_item_sk#35 ASC NULLS FIRST]

(34) CometSortMergeJoin
Left output [7]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]
Right output [2]: [wr_item_sk#35, wr_order_number#36]
Arguments: [ws_order_number#29, ws_item_sk#27], [wr_order_number#36, wr_item_sk#35], LeftOuter

(35) CometFilter
Input [9]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33, wr_item_sk#35, wr_order_number#36]
Condition : isnull(wr_order_number#36)

(36) CometProject
Input [9]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_order_number#29, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33, wr_item_sk#35, wr_order_number#36]
Arguments: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33], [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]

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

(38) CometBroadcastHashJoin
Left output [6]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33]
Right output [2]: [d_date_sk#38, d_year#39]
Arguments: [ws_sold_date_sk#33], [d_date_sk#38], Inner, BuildRight

(39) CometProject
Input [8]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, ws_sold_date_sk#33, d_date_sk#38, d_year#39]
Arguments: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, d_year#39], [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, d_year#39]

(40) ColumnarToRow [codegen id : 3]
Input [6]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, d_year#39]

(41) HashAggregate [codegen id : 3]
Input [6]: [ws_item_sk#27, ws_bill_customer_sk#28, ws_quantity#30, ws_wholesale_cost#31, ws_sales_price#32, d_year#39]
Keys [3]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28]
Functions [3]: [partial_sum(ws_quantity#30), partial_sum(UnscaledValue(ws_wholesale_cost#31)), partial_sum(UnscaledValue(ws_sales_price#32))]
Aggregate Attributes [3]: [sum#40, sum#41, sum#42]
Results [6]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, sum#43, sum#44, sum#45]

(42) RowToColumnar
Input [6]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, sum#43, sum#44, sum#45]

(43) CometColumnarExchange
Input [6]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, sum#43, sum#44, sum#45]
Arguments: hashpartitioning(d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(44) ColumnarToRow [codegen id : 4]
Input [6]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, sum#43, sum#44, sum#45]

(45) HashAggregate [codegen id : 4]
Input [6]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28, sum#43, sum#44, sum#45]
Keys [3]: [d_year#39, ws_item_sk#27, ws_bill_customer_sk#28]
Functions [3]: [sum(ws_quantity#30), sum(UnscaledValue(ws_wholesale_cost#31)), sum(UnscaledValue(ws_sales_price#32))]
Aggregate Attributes [3]: [sum(ws_quantity#30)#46, sum(UnscaledValue(ws_wholesale_cost#31))#47, sum(UnscaledValue(ws_sales_price#32))#48]
Results [6]: [d_year#39 AS ws_sold_year#49, ws_item_sk#27, ws_bill_customer_sk#28 AS ws_customer_sk#50, sum(ws_quantity#30)#46 AS ws_qty#51, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#31))#47,17,2) AS ws_wc#52, MakeDecimal(sum(UnscaledValue(ws_sales_price#32))#48,17,2) AS ws_sp#53]

(46) Filter [codegen id : 4]
Input [6]: [ws_sold_year#49, ws_item_sk#27, ws_customer_sk#50, ws_qty#51, ws_wc#52, ws_sp#53]
Condition : (coalesce(ws_qty#51, 0) > 0)

(47) Sort [codegen id : 4]
Input [6]: [ws_sold_year#49, ws_item_sk#27, ws_customer_sk#50, ws_qty#51, ws_wc#52, ws_sp#53]
Arguments: [ws_sold_year#49 ASC NULLS FIRST, ws_item_sk#27 ASC NULLS FIRST, ws_customer_sk#50 ASC NULLS FIRST], false, 0

(48) SortMergeJoin [codegen id : 5]
Left keys [3]: [ss_sold_year#23, ss_item_sk#1, ss_customer_sk#2]
Right keys [3]: [ws_sold_year#49, ws_item_sk#27, ws_customer_sk#50]
Join type: Inner
Join condition: None

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

(50) Scan parquet spark_catalog.default.catalog_sales
Output [7]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#60), dynamicpruningexpression(cs_sold_date_sk#60 IN dynamicpruning#61)]
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)>

(51) CometFilter
Input [7]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]
Condition : (isnotnull(cs_item_sk#55) AND isnotnull(cs_bill_customer_sk#54))

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

(53) CometSort
Input [7]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]
Arguments: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60], [cs_order_number#56 ASC NULLS FIRST, cs_item_sk#55 ASC NULLS FIRST]

(54) Scan parquet spark_catalog.default.catalog_returns
Output [3]: [cr_item_sk#62, cr_order_number#63, cr_returned_date_sk#64]
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) CometFilter
Input [3]: [cr_item_sk#62, cr_order_number#63, cr_returned_date_sk#64]
Condition : (isnotnull(cr_order_number#63) AND isnotnull(cr_item_sk#62))

(56) CometProject
Input [3]: [cr_item_sk#62, cr_order_number#63, cr_returned_date_sk#64]
Arguments: [cr_item_sk#62, cr_order_number#63], [cr_item_sk#62, cr_order_number#63]

(57) CometColumnarExchange
Input [2]: [cr_item_sk#62, cr_order_number#63]
Arguments: hashpartitioning(cr_order_number#63, cr_item_sk#62, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=8]

(58) CometSort
Input [2]: [cr_item_sk#62, cr_order_number#63]
Arguments: [cr_item_sk#62, cr_order_number#63], [cr_order_number#63 ASC NULLS FIRST, cr_item_sk#62 ASC NULLS FIRST]

(59) CometSortMergeJoin
Left output [7]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]
Right output [2]: [cr_item_sk#62, cr_order_number#63]
Arguments: [cs_order_number#56, cs_item_sk#55], [cr_order_number#63, cr_item_sk#62], LeftOuter

(60) CometFilter
Input [9]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60, cr_item_sk#62, cr_order_number#63]
Condition : isnull(cr_order_number#63)

(61) CometProject
Input [9]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_order_number#56, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60, cr_item_sk#62, cr_order_number#63]
Arguments: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60], [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]

(62) ReusedExchange [Reuses operator id: 15]
Output [2]: [d_date_sk#65, d_year#66]

(63) CometBroadcastHashJoin
Left output [6]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60]
Right output [2]: [d_date_sk#65, d_year#66]
Arguments: [cs_sold_date_sk#60], [d_date_sk#65], Inner, BuildRight

(64) CometProject
Input [8]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, cs_sold_date_sk#60, d_date_sk#65, d_year#66]
Arguments: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, d_year#66], [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, d_year#66]

(65) ColumnarToRow [codegen id : 6]
Input [6]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, d_year#66]

(66) HashAggregate [codegen id : 6]
Input [6]: [cs_bill_customer_sk#54, cs_item_sk#55, cs_quantity#57, cs_wholesale_cost#58, cs_sales_price#59, d_year#66]
Keys [3]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54]
Functions [3]: [partial_sum(cs_quantity#57), partial_sum(UnscaledValue(cs_wholesale_cost#58)), partial_sum(UnscaledValue(cs_sales_price#59))]
Aggregate Attributes [3]: [sum#67, sum#68, sum#69]
Results [6]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, sum#70, sum#71, sum#72]

(67) RowToColumnar
Input [6]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, sum#70, sum#71, sum#72]

(68) CometColumnarExchange
Input [6]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, sum#70, sum#71, sum#72]
Arguments: hashpartitioning(d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=9]

(69) ColumnarToRow [codegen id : 7]
Input [6]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, sum#70, sum#71, sum#72]

(70) HashAggregate [codegen id : 7]
Input [6]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54, sum#70, sum#71, sum#72]
Keys [3]: [d_year#66, cs_item_sk#55, cs_bill_customer_sk#54]
Functions [3]: [sum(cs_quantity#57), sum(UnscaledValue(cs_wholesale_cost#58)), sum(UnscaledValue(cs_sales_price#59))]
Aggregate Attributes [3]: [sum(cs_quantity#57)#73, sum(UnscaledValue(cs_wholesale_cost#58))#74, sum(UnscaledValue(cs_sales_price#59))#75]
Results [6]: [d_year#66 AS cs_sold_year#76, cs_item_sk#55, cs_bill_customer_sk#54 AS cs_customer_sk#77, sum(cs_quantity#57)#73 AS cs_qty#78, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#58))#74,17,2) AS cs_wc#79, MakeDecimal(sum(UnscaledValue(cs_sales_price#59))#75,17,2) AS cs_sp#80]

(71) Filter [codegen id : 7]
Input [6]: [cs_sold_year#76, cs_item_sk#55, cs_customer_sk#77, cs_qty#78, cs_wc#79, cs_sp#80]
Condition : (coalesce(cs_qty#78, 0) > 0)

(72) Sort [codegen id : 7]
Input [6]: [cs_sold_year#76, cs_item_sk#55, cs_customer_sk#77, cs_qty#78, cs_wc#79, cs_sp#80]
Arguments: [cs_sold_year#76 ASC NULLS FIRST, cs_item_sk#55 ASC NULLS FIRST, cs_customer_sk#77 ASC NULLS FIRST], false, 0

(73) SortMergeJoin [codegen id : 8]
Left keys [3]: [ss_sold_year#23, ss_item_sk#1, ss_customer_sk#2]
Right keys [3]: [cs_sold_year#76, cs_item_sk#55, cs_customer_sk#77]
Join type: Inner
Join condition: None

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

(75) 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#23, ss_item_sk#1, ss_customer_sk#2, ss_qty#24, ss_wc#25, ss_sp#26]
Arguments: 100, [ss_sold_year#23 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST, ss_qty#24 DESC NULLS LAST, ss_wc#25 DESC NULLS LAST, ss_sp#26 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]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
BroadcastExchange (79)
+- * ColumnarToRow (78)
   +- CometFilter (77)
      +- CometScan parquet spark_catalog.default.date_dim (76)


(76) Scan parquet spark_catalog.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>

(77) CometFilter
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))

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

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

Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#33 IN dynamicpruning#8

Subquery:3 Hosting operator id = 50 Hosting Expression = cs_sold_date_sk#60 IN dynamicpruning#8


