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


(1) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(2) CometFilter
Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Condition : (isnotnull(c_customer_sk#1) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#2, 16))))

(3) CometProject
Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4]
Arguments: [c_customer_sk#1, c_customer_id#5, c_first_name#6, c_last_name#7], [c_customer_sk#1, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#2, 16)) AS c_customer_id#5, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#3, 20)) AS c_first_name#6, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#4, 30)) AS c_last_name#7]

(4) CometScan [native_iceberg_compat] parquet spark_catalog.default.store_sales
Output [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#10), dynamicpruningexpression(ss_sold_date_sk#10 IN dynamicpruning#11)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

(5) CometFilter
Input [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Condition : isnotnull(ss_customer_sk#8)

(6) CometBroadcastExchange
Input [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Arguments: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]

(7) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#1, c_customer_id#5, c_first_name#6, c_last_name#7]
Right output [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Arguments: [c_customer_sk#1], [ss_customer_sk#8], Inner, BuildRight

(8) CometProject
Input [7]: [c_customer_sk#1, c_customer_id#5, c_first_name#6, c_last_name#7, ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Arguments: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, ss_sold_date_sk#10], [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, ss_sold_date_sk#10]

(9) CometScan [native_iceberg_compat] 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,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(10) CometFilter
Input [2]: [d_date_sk#12, d_year#13]
Condition : (((isnotnull(d_year#13) AND (d_year#13 = 2001)) AND d_year#13 IN (2001,2002)) AND isnotnull(d_date_sk#12))

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

(12) CometBroadcastHashJoin
Left output [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, ss_sold_date_sk#10]
Right output [2]: [d_date_sk#12, d_year#13]
Arguments: [ss_sold_date_sk#10], [d_date_sk#12], Inner, BuildRight

(13) CometProject
Input [7]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, ss_sold_date_sk#10, d_date_sk#12, d_year#13]
Arguments: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, d_year#13], [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, d_year#13]

(14) CometHashAggregate
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, d_year#13]
Keys [4]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#9))]

(15) CometExchange
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#14]
Arguments: hashpartitioning(c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(16) CometColumnarToRow [codegen id : 4]
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#14]

(17) HashAggregate [codegen id : 4]
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#14]
Keys [4]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13]
Functions [1]: [sum(UnscaledValue(ss_net_paid#9))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#9))#15]
Results [2]: [c_customer_id#5 AS customer_id#16, MakeDecimal(sum(UnscaledValue(ss_net_paid#9))#15,17,2) AS year_total#17]

(18) Filter [codegen id : 4]
Input [2]: [customer_id#16, year_total#17]
Condition : (isnotnull(year_total#17) AND (year_total#17 > 0.00))

(19) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#18, c_customer_id#19, c_first_name#20, c_last_name#21]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(20) CometFilter
Input [4]: [c_customer_sk#18, c_customer_id#19, c_first_name#20, c_last_name#21]
Condition : (isnotnull(c_customer_sk#18) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#19, 16))))

(21) CometProject
Input [4]: [c_customer_sk#18, c_customer_id#19, c_first_name#20, c_last_name#21]
Arguments: [c_customer_sk#18, c_customer_id#22, c_first_name#23, c_last_name#24], [c_customer_sk#18, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#19, 16)) AS c_customer_id#22, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#20, 20)) AS c_first_name#23, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#21, 30)) AS c_last_name#24]

(22) CometScan [native_iceberg_compat] parquet spark_catalog.default.store_sales
Output [3]: [ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#27), dynamicpruningexpression(ss_sold_date_sk#27 IN dynamicpruning#28)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

(23) CometFilter
Input [3]: [ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]
Condition : isnotnull(ss_customer_sk#25)

(24) CometBroadcastExchange
Input [3]: [ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]
Arguments: [ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]

(25) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#18, c_customer_id#22, c_first_name#23, c_last_name#24]
Right output [3]: [ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]
Arguments: [c_customer_sk#18], [ss_customer_sk#25], Inner, BuildRight

(26) CometProject
Input [7]: [c_customer_sk#18, c_customer_id#22, c_first_name#23, c_last_name#24, ss_customer_sk#25, ss_net_paid#26, ss_sold_date_sk#27]
Arguments: [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, ss_sold_date_sk#27], [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, ss_sold_date_sk#27]

(27) CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#29, d_year#30]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(28) CometFilter
Input [2]: [d_date_sk#29, d_year#30]
Condition : (((isnotnull(d_year#30) AND (d_year#30 = 2002)) AND d_year#30 IN (2001,2002)) AND isnotnull(d_date_sk#29))

(29) CometBroadcastExchange
Input [2]: [d_date_sk#29, d_year#30]
Arguments: [d_date_sk#29, d_year#30]

(30) CometBroadcastHashJoin
Left output [5]: [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, ss_sold_date_sk#27]
Right output [2]: [d_date_sk#29, d_year#30]
Arguments: [ss_sold_date_sk#27], [d_date_sk#29], Inner, BuildRight

(31) CometProject
Input [7]: [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, ss_sold_date_sk#27, d_date_sk#29, d_year#30]
Arguments: [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, d_year#30], [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, d_year#30]

(32) CometHashAggregate
Input [5]: [c_customer_id#22, c_first_name#23, c_last_name#24, ss_net_paid#26, d_year#30]
Keys [4]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#26))]

(33) CometExchange
Input [5]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30, sum#31]
Arguments: hashpartitioning(c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]

(34) CometColumnarToRow [codegen id : 1]
Input [5]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30, sum#31]

(35) HashAggregate [codegen id : 1]
Input [5]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30, sum#31]
Keys [4]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#30]
Functions [1]: [sum(UnscaledValue(ss_net_paid#26))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#26))#15]
Results [4]: [c_customer_id#22 AS customer_id#32, c_first_name#23 AS customer_first_name#33, c_last_name#24 AS customer_last_name#34, MakeDecimal(sum(UnscaledValue(ss_net_paid#26))#15,17,2) AS year_total#35]

(36) BroadcastExchange
Input [4]: [customer_id#32, customer_first_name#33, customer_last_name#34, year_total#35]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=3]

(37) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [customer_id#16]
Right keys [1]: [customer_id#32]
Join type: Inner
Join condition: None

(38) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#36, c_customer_id#37, c_first_name#38, c_last_name#39]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(39) CometFilter
Input [4]: [c_customer_sk#36, c_customer_id#37, c_first_name#38, c_last_name#39]
Condition : (isnotnull(c_customer_sk#36) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#37, 16))))

(40) CometProject
Input [4]: [c_customer_sk#36, c_customer_id#37, c_first_name#38, c_last_name#39]
Arguments: [c_customer_sk#36, c_customer_id#40, c_first_name#41, c_last_name#42], [c_customer_sk#36, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#37, 16)) AS c_customer_id#40, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#38, 20)) AS c_first_name#41, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#39, 30)) AS c_last_name#42]

(41) CometScan [native_iceberg_compat] parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#45), dynamicpruningexpression(ws_sold_date_sk#45 IN dynamicpruning#46)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(42) CometFilter
Input [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Condition : isnotnull(ws_bill_customer_sk#43)

(43) CometBroadcastExchange
Input [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Arguments: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]

(44) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#36, c_customer_id#40, c_first_name#41, c_last_name#42]
Right output [3]: [ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Arguments: [c_customer_sk#36], [ws_bill_customer_sk#43], Inner, BuildRight

(45) CometProject
Input [7]: [c_customer_sk#36, c_customer_id#40, c_first_name#41, c_last_name#42, ws_bill_customer_sk#43, ws_net_paid#44, ws_sold_date_sk#45]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45], [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45]

(46) ReusedExchange [Reuses operator id: 11]
Output [2]: [d_date_sk#47, d_year#48]

(47) CometBroadcastHashJoin
Left output [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45]
Right output [2]: [d_date_sk#47, d_year#48]
Arguments: [ws_sold_date_sk#45], [d_date_sk#47], Inner, BuildRight

(48) CometProject
Input [7]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, ws_sold_date_sk#45, d_date_sk#47, d_year#48]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#48], [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#48]

(49) CometHashAggregate
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, ws_net_paid#44, d_year#48]
Keys [4]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#44))]

(50) CometExchange
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48, sum#49]
Arguments: hashpartitioning(c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=4]

(51) CometColumnarToRow [codegen id : 2]
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48, sum#49]

(52) HashAggregate [codegen id : 2]
Input [5]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48, sum#49]
Keys [4]: [c_customer_id#40, c_first_name#41, c_last_name#42, d_year#48]
Functions [1]: [sum(UnscaledValue(ws_net_paid#44))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#44))#50]
Results [2]: [c_customer_id#40 AS customer_id#51, MakeDecimal(sum(UnscaledValue(ws_net_paid#44))#50,17,2) AS year_total#52]

(53) Filter [codegen id : 2]
Input [2]: [customer_id#51, year_total#52]
Condition : (isnotnull(year_total#52) AND (year_total#52 > 0.00))

(54) BroadcastExchange
Input [2]: [customer_id#51, year_total#52]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]

(55) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [customer_id#16]
Right keys [1]: [customer_id#51]
Join type: Inner
Join condition: None

(56) Project [codegen id : 4]
Output [7]: [customer_id#16, year_total#17, customer_id#32, customer_first_name#33, customer_last_name#34, year_total#35, year_total#52]
Input [8]: [customer_id#16, year_total#17, customer_id#32, customer_first_name#33, customer_last_name#34, year_total#35, customer_id#51, year_total#52]

(57) CometScan [native_iceberg_compat] parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#53, c_customer_id#54, c_first_name#55, c_last_name#56]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string>

(58) CometFilter
Input [4]: [c_customer_sk#53, c_customer_id#54, c_first_name#55, c_last_name#56]
Condition : (isnotnull(c_customer_sk#53) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#54, 16))))

(59) CometProject
Input [4]: [c_customer_sk#53, c_customer_id#54, c_first_name#55, c_last_name#56]
Arguments: [c_customer_sk#53, c_customer_id#57, c_first_name#58, c_last_name#59], [c_customer_sk#53, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#54, 16)) AS c_customer_id#57, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#55, 20)) AS c_first_name#58, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#56, 30)) AS c_last_name#59]

(60) CometScan [native_iceberg_compat] parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#62), dynamicpruningexpression(ws_sold_date_sk#62 IN dynamicpruning#63)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(61) CometFilter
Input [3]: [ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]
Condition : isnotnull(ws_bill_customer_sk#60)

(62) CometBroadcastExchange
Input [3]: [ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]
Arguments: [ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]

(63) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#53, c_customer_id#57, c_first_name#58, c_last_name#59]
Right output [3]: [ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]
Arguments: [c_customer_sk#53], [ws_bill_customer_sk#60], Inner, BuildRight

(64) CometProject
Input [7]: [c_customer_sk#53, c_customer_id#57, c_first_name#58, c_last_name#59, ws_bill_customer_sk#60, ws_net_paid#61, ws_sold_date_sk#62]
Arguments: [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, ws_sold_date_sk#62], [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, ws_sold_date_sk#62]

(65) ReusedExchange [Reuses operator id: 29]
Output [2]: [d_date_sk#64, d_year#65]

(66) CometBroadcastHashJoin
Left output [5]: [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, ws_sold_date_sk#62]
Right output [2]: [d_date_sk#64, d_year#65]
Arguments: [ws_sold_date_sk#62], [d_date_sk#64], Inner, BuildRight

(67) CometProject
Input [7]: [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, ws_sold_date_sk#62, d_date_sk#64, d_year#65]
Arguments: [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, d_year#65], [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, d_year#65]

(68) CometHashAggregate
Input [5]: [c_customer_id#57, c_first_name#58, c_last_name#59, ws_net_paid#61, d_year#65]
Keys [4]: [c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#61))]

(69) CometExchange
Input [5]: [c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65, sum#66]
Arguments: hashpartitioning(c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=6]

(70) CometColumnarToRow [codegen id : 3]
Input [5]: [c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65, sum#66]

(71) HashAggregate [codegen id : 3]
Input [5]: [c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65, sum#66]
Keys [4]: [c_customer_id#57, c_first_name#58, c_last_name#59, d_year#65]
Functions [1]: [sum(UnscaledValue(ws_net_paid#61))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#61))#50]
Results [2]: [c_customer_id#57 AS customer_id#67, MakeDecimal(sum(UnscaledValue(ws_net_paid#61))#50,17,2) AS year_total#68]

(72) BroadcastExchange
Input [2]: [customer_id#67, year_total#68]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=7]

(73) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [customer_id#16]
Right keys [1]: [customer_id#67]
Join type: Inner
Join condition: (CASE WHEN (year_total#52 > 0.00) THEN (year_total#68 / year_total#52) END > CASE WHEN (year_total#17 > 0.00) THEN (year_total#35 / year_total#17) END)

(74) Project [codegen id : 4]
Output [3]: [customer_id#32, customer_first_name#33, customer_last_name#34]
Input [9]: [customer_id#16, year_total#17, customer_id#32, customer_first_name#33, customer_last_name#34, year_total#35, year_total#52, customer_id#67, year_total#68]

(75) TakeOrderedAndProject
Input [3]: [customer_id#32, customer_first_name#33, customer_last_name#34]
Arguments: 100, [customer_first_name#33 ASC NULLS FIRST, customer_id#32 ASC NULLS FIRST, customer_last_name#34 ASC NULLS FIRST], [customer_id#32, customer_first_name#33, customer_last_name#34]

===== Subqueries =====

Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#10 IN dynamicpruning#11
BroadcastExchange (79)
+- * CometColumnarToRow (78)
   +- CometFilter (77)
      +- CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim (76)


(76) CometScan [native_iceberg_compat] 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,2001), In(d_year, [2001,2002]), 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 = 2001)) AND d_year#13 IN (2001,2002)) AND isnotnull(d_date_sk#12))

(78) CometColumnarToRow [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=8]

Subquery:2 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#27 IN dynamicpruning#28
BroadcastExchange (83)
+- * CometColumnarToRow (82)
   +- CometFilter (81)
      +- CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim (80)


(80) CometScan [native_iceberg_compat] parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#29, d_year#30]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(81) CometFilter
Input [2]: [d_date_sk#29, d_year#30]
Condition : (((isnotnull(d_year#30) AND (d_year#30 = 2002)) AND d_year#30 IN (2001,2002)) AND isnotnull(d_date_sk#29))

(82) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#29, d_year#30]

(83) BroadcastExchange
Input [2]: [d_date_sk#29, d_year#30]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]

Subquery:3 Hosting operator id = 41 Hosting Expression = ws_sold_date_sk#45 IN dynamicpruning#11

Subquery:4 Hosting operator id = 60 Hosting Expression = ws_sold_date_sk#62 IN dynamicpruning#28


