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


(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) 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) 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]

(5) 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]

(6) CometNativeScan 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>

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

(8) 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]

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

(10) 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]

(11) 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

(12) 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)

(13) 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]

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

(15) 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))

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

(17) 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

(18) 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]

(19) CometHashAggregate
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))]

(20) CometExchange
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#14, sum#15, sum#16]
Arguments: hashpartitioning(d_year#13, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=3]

(21) CometHashAggregate
Input [6]: [d_year#13, ss_item_sk#1, ss_customer_sk#2, sum#14, sum#15, sum#16]
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))]

(22) CometSort
Input [6]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20]
Arguments: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20], [ss_sold_year#17 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST]

(23) Scan parquet spark_catalog.default.web_sales
Output [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#27), dynamicpruningexpression(ws_sold_date_sk#27 IN dynamicpruning#8)]
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)>

(24) ColumnarToRow [codegen id : 2]
Input [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]

(25) Filter [codegen id : 2]
Input [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Condition : (isnotnull(ws_item_sk#21) AND isnotnull(ws_bill_customer_sk#22))

(26) CometColumnarExchange
Input [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Arguments: hashpartitioning(ws_order_number#23, ws_item_sk#21, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(27) CometSort
Input [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Arguments: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27], [ws_order_number#23 ASC NULLS FIRST, ws_item_sk#21 ASC NULLS FIRST]

(28) CometNativeScan parquet spark_catalog.default.web_returns
Output [3]: [wr_item_sk#28, wr_order_number#29, wr_returned_date_sk#30]
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>

(29) CometFilter
Input [3]: [wr_item_sk#28, wr_order_number#29, wr_returned_date_sk#30]
Condition : (isnotnull(wr_order_number#29) AND isnotnull(wr_item_sk#28))

(30) CometProject
Input [3]: [wr_item_sk#28, wr_order_number#29, wr_returned_date_sk#30]
Arguments: [wr_item_sk#28, wr_order_number#29], [wr_item_sk#28, wr_order_number#29]

(31) CometExchange
Input [2]: [wr_item_sk#28, wr_order_number#29]
Arguments: hashpartitioning(wr_order_number#29, wr_item_sk#28, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=5]

(32) CometSort
Input [2]: [wr_item_sk#28, wr_order_number#29]
Arguments: [wr_item_sk#28, wr_order_number#29], [wr_order_number#29 ASC NULLS FIRST, wr_item_sk#28 ASC NULLS FIRST]

(33) CometSortMergeJoin
Left output [7]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Right output [2]: [wr_item_sk#28, wr_order_number#29]
Arguments: [ws_order_number#23, ws_item_sk#21], [wr_order_number#29, wr_item_sk#28], LeftOuter

(34) CometFilter
Input [9]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27, wr_item_sk#28, wr_order_number#29]
Condition : isnull(wr_order_number#29)

(35) CometProject
Input [9]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_order_number#23, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27, wr_item_sk#28, wr_order_number#29]
Arguments: [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27], [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]

(36) ReusedExchange [Reuses operator id: 16]
Output [2]: [d_date_sk#31, d_year#32]

(37) CometBroadcastHashJoin
Left output [6]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27]
Right output [2]: [d_date_sk#31, d_year#32]
Arguments: [ws_sold_date_sk#27], [d_date_sk#31], Inner, BuildRight

(38) CometProject
Input [8]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, ws_sold_date_sk#27, d_date_sk#31, d_year#32]
Arguments: [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, d_year#32], [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, d_year#32]

(39) CometHashAggregate
Input [6]: [ws_item_sk#21, ws_bill_customer_sk#22, ws_quantity#24, ws_wholesale_cost#25, ws_sales_price#26, d_year#32]
Keys [3]: [d_year#32, ws_item_sk#21, ws_bill_customer_sk#22]
Functions [3]: [partial_sum(ws_quantity#24), partial_sum(UnscaledValue(ws_wholesale_cost#25)), partial_sum(UnscaledValue(ws_sales_price#26))]

(40) CometExchange
Input [6]: [d_year#32, ws_item_sk#21, ws_bill_customer_sk#22, sum#33, sum#34, sum#35]
Arguments: hashpartitioning(d_year#32, ws_item_sk#21, ws_bill_customer_sk#22, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=6]

(41) CometHashAggregate
Input [6]: [d_year#32, ws_item_sk#21, ws_bill_customer_sk#22, sum#33, sum#34, sum#35]
Keys [3]: [d_year#32, ws_item_sk#21, ws_bill_customer_sk#22]
Functions [3]: [sum(ws_quantity#24), sum(UnscaledValue(ws_wholesale_cost#25)), sum(UnscaledValue(ws_sales_price#26))]

(42) CometFilter
Input [6]: [ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37, ws_qty#38, ws_wc#39, ws_sp#40]
Condition : (coalesce(ws_qty#38, 0) > 0)

(43) CometSort
Input [6]: [ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37, ws_qty#38, ws_wc#39, ws_sp#40]
Arguments: [ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37, ws_qty#38, ws_wc#39, ws_sp#40], [ws_sold_year#36 ASC NULLS FIRST, ws_item_sk#21 ASC NULLS FIRST, ws_customer_sk#37 ASC NULLS FIRST]

(44) CometSortMergeJoin
Left output [6]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20]
Right output [6]: [ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37, ws_qty#38, ws_wc#39, ws_sp#40]
Arguments: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2], [ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37], Inner

(45) CometProject
Input [12]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_sold_year#36, ws_item_sk#21, ws_customer_sk#37, ws_qty#38, ws_wc#39, ws_sp#40]
Arguments: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_qty#38, ws_wc#39, ws_sp#40], [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_qty#38, ws_wc#39, ws_sp#40]

(46) Scan parquet spark_catalog.default.catalog_sales
Output [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#47), dynamicpruningexpression(cs_sold_date_sk#47 IN dynamicpruning#8)]
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)>

(47) ColumnarToRow [codegen id : 3]
Input [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]

(48) Filter [codegen id : 3]
Input [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Condition : (isnotnull(cs_item_sk#42) AND isnotnull(cs_bill_customer_sk#41))

(49) CometColumnarExchange
Input [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Arguments: hashpartitioning(cs_order_number#43, cs_item_sk#42, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(50) CometSort
Input [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Arguments: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47], [cs_order_number#43 ASC NULLS FIRST, cs_item_sk#42 ASC NULLS FIRST]

(51) CometNativeScan parquet spark_catalog.default.catalog_returns
Output [3]: [cr_item_sk#48, cr_order_number#49, cr_returned_date_sk#50]
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>

(52) CometFilter
Input [3]: [cr_item_sk#48, cr_order_number#49, cr_returned_date_sk#50]
Condition : (isnotnull(cr_order_number#49) AND isnotnull(cr_item_sk#48))

(53) CometProject
Input [3]: [cr_item_sk#48, cr_order_number#49, cr_returned_date_sk#50]
Arguments: [cr_item_sk#48, cr_order_number#49], [cr_item_sk#48, cr_order_number#49]

(54) CometExchange
Input [2]: [cr_item_sk#48, cr_order_number#49]
Arguments: hashpartitioning(cr_order_number#49, cr_item_sk#48, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=8]

(55) CometSort
Input [2]: [cr_item_sk#48, cr_order_number#49]
Arguments: [cr_item_sk#48, cr_order_number#49], [cr_order_number#49 ASC NULLS FIRST, cr_item_sk#48 ASC NULLS FIRST]

(56) CometSortMergeJoin
Left output [7]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Right output [2]: [cr_item_sk#48, cr_order_number#49]
Arguments: [cs_order_number#43, cs_item_sk#42], [cr_order_number#49, cr_item_sk#48], LeftOuter

(57) CometFilter
Input [9]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47, cr_item_sk#48, cr_order_number#49]
Condition : isnull(cr_order_number#49)

(58) CometProject
Input [9]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47, cr_item_sk#48, cr_order_number#49]
Arguments: [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47], [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]

(59) ReusedExchange [Reuses operator id: 16]
Output [2]: [d_date_sk#51, d_year#52]

(60) CometBroadcastHashJoin
Left output [6]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47]
Right output [2]: [d_date_sk#51, d_year#52]
Arguments: [cs_sold_date_sk#47], [d_date_sk#51], Inner, BuildRight

(61) CometProject
Input [8]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, cs_sold_date_sk#47, d_date_sk#51, d_year#52]
Arguments: [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, d_year#52], [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, d_year#52]

(62) CometHashAggregate
Input [6]: [cs_bill_customer_sk#41, cs_item_sk#42, cs_quantity#44, cs_wholesale_cost#45, cs_sales_price#46, d_year#52]
Keys [3]: [d_year#52, cs_item_sk#42, cs_bill_customer_sk#41]
Functions [3]: [partial_sum(cs_quantity#44), partial_sum(UnscaledValue(cs_wholesale_cost#45)), partial_sum(UnscaledValue(cs_sales_price#46))]

(63) CometExchange
Input [6]: [d_year#52, cs_item_sk#42, cs_bill_customer_sk#41, sum#53, sum#54, sum#55]
Arguments: hashpartitioning(d_year#52, cs_item_sk#42, cs_bill_customer_sk#41, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=9]

(64) CometHashAggregate
Input [6]: [d_year#52, cs_item_sk#42, cs_bill_customer_sk#41, sum#53, sum#54, sum#55]
Keys [3]: [d_year#52, cs_item_sk#42, cs_bill_customer_sk#41]
Functions [3]: [sum(cs_quantity#44), sum(UnscaledValue(cs_wholesale_cost#45)), sum(UnscaledValue(cs_sales_price#46))]

(65) CometFilter
Input [6]: [cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60]
Condition : (coalesce(cs_qty#58, 0) > 0)

(66) CometSort
Input [6]: [cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60]
Arguments: [cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60], [cs_sold_year#56 ASC NULLS FIRST, cs_item_sk#42 ASC NULLS FIRST, cs_customer_sk#57 ASC NULLS FIRST]

(67) CometSortMergeJoin
Left output [9]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_qty#38, ws_wc#39, ws_sp#40]
Right output [6]: [cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60]
Arguments: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2], [cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57], Inner

(68) CometColumnarToRow [codegen id : 4]
Input [15]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_qty#38, ws_wc#39, ws_sp#40, cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60]

(69) Project [codegen id : 4]
Output [13]: [round((cast(ss_qty#18 as double) / knownfloatingpointnormalized(normalizenanandzero(cast(coalesce((ws_qty#38 + cs_qty#58), 1) as double)))), 2) AS ratio#61, ss_qty#18 AS store_qty#62, ss_wc#19 AS store_wholesale_cost#63, ss_sp#20 AS store_sales_price#64, (coalesce(ws_qty#38, 0) + coalesce(cs_qty#58, 0)) AS other_chan_qty#65, (coalesce(ws_wc#39, 0.00) + coalesce(cs_wc#59, 0.00)) AS other_chan_wholesale_cost#66, (coalesce(ws_sp#40, 0.00) + coalesce(cs_sp#60, 0.00)) AS other_chan_sales_price#67, ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20]
Input [15]: [ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20, ws_qty#38, ws_wc#39, ws_sp#40, cs_sold_year#56, cs_item_sk#42, cs_customer_sk#57, cs_qty#58, cs_wc#59, cs_sp#60]

(70) TakeOrderedAndProject
Input [13]: [ratio#61, store_qty#62, store_wholesale_cost#63, store_sales_price#64, other_chan_qty#65, other_chan_wholesale_cost#66, other_chan_sales_price#67, ss_sold_year#17, ss_item_sk#1, ss_customer_sk#2, ss_qty#18, ss_wc#19, ss_sp#20]
Arguments: 100, [ss_sold_year#17 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST, ss_qty#18 DESC NULLS LAST, ss_wc#19 DESC NULLS LAST, ss_sp#20 DESC NULLS LAST, other_chan_qty#65 ASC NULLS FIRST, other_chan_wholesale_cost#66 ASC NULLS FIRST, other_chan_sales_price#67 ASC NULLS FIRST, ratio#61 ASC NULLS FIRST], [ratio#61, store_qty#62, store_wholesale_cost#63, store_sales_price#64, other_chan_qty#65, other_chan_wholesale_cost#66, other_chan_sales_price#67]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
BroadcastExchange (74)
+- * CometColumnarToRow (73)
   +- CometFilter (72)
      +- CometNativeScan parquet spark_catalog.default.date_dim (71)


(71) CometNativeScan 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>

(72) 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))

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

(74) 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 = 23 Hosting Expression = ws_sold_date_sk#27 IN dynamicpruning#8

Subquery:3 Hosting operator id = 46 Hosting Expression = cs_sold_date_sk#47 IN dynamicpruning#8


