== 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)
      :     :  :        +- CometColumnarExchange (15)
      :     :  :           +- * HashAggregate (14)
      :     :  :              +- * CometColumnarToRow (13)
      :     :  :                 +- CometProject (12)
      :     :  :                    +- CometBroadcastHashJoin (11)
      :     :  :                       :- CometProject (7)
      :     :  :                       :  +- CometBroadcastHashJoin (6)
      :     :  :                       :     :- CometFilter (2)
      :     :  :                       :     :  +- CometScan parquet spark_catalog.default.customer (1)
      :     :  :                       :     +- CometBroadcastExchange (5)
      :     :  :                       :        +- CometFilter (4)
      :     :  :                       :           +- CometScan parquet spark_catalog.default.store_sales (3)
      :     :  :                       +- CometBroadcastExchange (10)
      :     :  :                          +- CometFilter (9)
      :     :  :                             +- CometScan parquet spark_catalog.default.date_dim (8)
      :     :  +- BroadcastExchange (36)
      :     :     +- * HashAggregate (35)
      :     :        +- * CometColumnarToRow (34)
      :     :           +- CometColumnarExchange (33)
      :     :              +- * HashAggregate (32)
      :     :                 +- * CometColumnarToRow (31)
      :     :                    +- CometProject (30)
      :     :                       +- CometBroadcastHashJoin (29)
      :     :                          :- CometProject (25)
      :     :                          :  +- CometBroadcastHashJoin (24)
      :     :                          :     :- CometFilter (20)
      :     :                          :     :  +- CometScan parquet spark_catalog.default.customer (19)
      :     :                          :     +- CometBroadcastExchange (23)
      :     :                          :        +- CometFilter (22)
      :     :                          :           +- CometScan parquet spark_catalog.default.store_sales (21)
      :     :                          +- CometBroadcastExchange (28)
      :     :                             +- CometFilter (27)
      :     :                                +- CometScan parquet spark_catalog.default.date_dim (26)
      :     +- BroadcastExchange (54)
      :        +- * Filter (53)
      :           +- * HashAggregate (52)
      :              +- * CometColumnarToRow (51)
      :                 +- CometColumnarExchange (50)
      :                    +- * HashAggregate (49)
      :                       +- * CometColumnarToRow (48)
      :                          +- CometProject (47)
      :                             +- CometBroadcastHashJoin (46)
      :                                :- CometProject (44)
      :                                :  +- CometBroadcastHashJoin (43)
      :                                :     :- CometFilter (39)
      :                                :     :  +- CometScan parquet spark_catalog.default.customer (38)
      :                                :     +- CometBroadcastExchange (42)
      :                                :        +- CometFilter (41)
      :                                :           +- CometScan parquet spark_catalog.default.web_sales (40)
      :                                +- ReusedExchange (45)
      +- BroadcastExchange (72)
         +- * HashAggregate (71)
            +- * CometColumnarToRow (70)
               +- CometColumnarExchange (69)
                  +- * HashAggregate (68)
                     +- * CometColumnarToRow (67)
                        +- CometProject (66)
                           +- CometBroadcastHashJoin (65)
                              :- CometProject (63)
                              :  +- CometBroadcastHashJoin (62)
                              :     :- CometFilter (58)
                              :     :  +- CometScan parquet spark_catalog.default.customer (57)
                              :     +- CometBroadcastExchange (61)
                              :        +- CometFilter (60)
                              :           +- CometScan parquet spark_catalog.default.web_sales (59)
                              +- ReusedExchange (64)


(1) CometScan 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), IsNotNull(c_customer_id)]
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(c_customer_id#2))

(3) CometScan parquet spark_catalog.default.store_sales
Output [3]: [ss_customer_sk#5, ss_net_paid#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_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

(4) CometFilter
Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Condition : isnotnull(ss_customer_sk#5)

(5) CometBroadcastExchange
Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Arguments: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]

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

(7) CometProject
Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7]
Arguments: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7], [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7]

(8) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#9, d_year#10]
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>

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

(10) CometBroadcastExchange
Input [2]: [d_date_sk#9, d_year#10]
Arguments: [d_date_sk#9, d_year#10]

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

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

(13) CometColumnarToRow [codegen id : 1]
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#10]

(14) HashAggregate [codegen id : 1]
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#10]
Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))]
Aggregate Attributes [1]: [sum#11]
Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#12]

(15) CometColumnarExchange
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#12]
Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=1]

(16) CometColumnarToRow [codegen id : 8]
Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#10, sum#12]

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

(18) Filter [codegen id : 8]
Input [2]: [customer_id#14, year_total#15]
Condition : (isnotnull(year_total#15) AND (year_total#15 > 0.00))

(19) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#16, c_customer_id#17, c_first_name#18, c_last_name#19]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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#16, c_customer_id#17, c_first_name#18, c_last_name#19]
Condition : (isnotnull(c_customer_sk#16) AND isnotnull(c_customer_id#17))

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

(22) CometFilter
Input [3]: [ss_customer_sk#20, ss_net_paid#21, ss_sold_date_sk#22]
Condition : isnotnull(ss_customer_sk#20)

(23) CometBroadcastExchange
Input [3]: [ss_customer_sk#20, ss_net_paid#21, ss_sold_date_sk#22]
Arguments: [ss_customer_sk#20, ss_net_paid#21, ss_sold_date_sk#22]

(24) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#16, c_customer_id#17, c_first_name#18, c_last_name#19]
Right output [3]: [ss_customer_sk#20, ss_net_paid#21, ss_sold_date_sk#22]
Arguments: [c_customer_sk#16], [ss_customer_sk#20], Inner, BuildRight

(25) CometProject
Input [7]: [c_customer_sk#16, c_customer_id#17, c_first_name#18, c_last_name#19, ss_customer_sk#20, ss_net_paid#21, ss_sold_date_sk#22]
Arguments: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, ss_sold_date_sk#22], [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, ss_sold_date_sk#22]

(26) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#24, d_year#25]
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>

(27) CometFilter
Input [2]: [d_date_sk#24, d_year#25]
Condition : (((isnotnull(d_year#25) AND (d_year#25 = 2002)) AND d_year#25 IN (2001,2002)) AND isnotnull(d_date_sk#24))

(28) CometBroadcastExchange
Input [2]: [d_date_sk#24, d_year#25]
Arguments: [d_date_sk#24, d_year#25]

(29) CometBroadcastHashJoin
Left output [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, ss_sold_date_sk#22]
Right output [2]: [d_date_sk#24, d_year#25]
Arguments: [ss_sold_date_sk#22], [d_date_sk#24], Inner, BuildRight

(30) CometProject
Input [7]: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, ss_sold_date_sk#22, d_date_sk#24, d_year#25]
Arguments: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, d_year#25], [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, d_year#25]

(31) CometColumnarToRow [codegen id : 2]
Input [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, d_year#25]

(32) HashAggregate [codegen id : 2]
Input [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, ss_net_paid#21, d_year#25]
Keys [4]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#21))]
Aggregate Attributes [1]: [sum#26]
Results [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25, sum#27]

(33) CometColumnarExchange
Input [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25, sum#27]
Arguments: hashpartitioning(c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=2]

(34) CometColumnarToRow [codegen id : 3]
Input [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25, sum#27]

(35) HashAggregate [codegen id : 3]
Input [5]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25, sum#27]
Keys [4]: [c_customer_id#17, c_first_name#18, c_last_name#19, d_year#25]
Functions [1]: [sum(UnscaledValue(ss_net_paid#21))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#21))#13]
Results [4]: [c_customer_id#17 AS customer_id#28, c_first_name#18 AS customer_first_name#29, c_last_name#19 AS customer_last_name#30, MakeDecimal(sum(UnscaledValue(ss_net_paid#21))#13,17,2) AS year_total#31]

(36) BroadcastExchange
Input [4]: [customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=3]

(37) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#14]
Right keys [1]: [customer_id#28]
Join type: Inner
Join condition: None

(38) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#32, c_customer_id#33, c_first_name#34, c_last_name#35]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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#32, c_customer_id#33, c_first_name#34, c_last_name#35]
Condition : (isnotnull(c_customer_sk#32) AND isnotnull(c_customer_id#33))

(40) CometScan parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#39)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(41) CometFilter
Input [3]: [ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]
Condition : isnotnull(ws_bill_customer_sk#36)

(42) CometBroadcastExchange
Input [3]: [ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]
Arguments: [ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]

(43) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#32, c_customer_id#33, c_first_name#34, c_last_name#35]
Right output [3]: [ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]
Arguments: [c_customer_sk#32], [ws_bill_customer_sk#36], Inner, BuildRight

(44) CometProject
Input [7]: [c_customer_sk#32, c_customer_id#33, c_first_name#34, c_last_name#35, ws_bill_customer_sk#36, ws_net_paid#37, ws_sold_date_sk#38]
Arguments: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, ws_sold_date_sk#38], [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, ws_sold_date_sk#38]

(45) ReusedExchange [Reuses operator id: 10]
Output [2]: [d_date_sk#40, d_year#41]

(46) CometBroadcastHashJoin
Left output [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, ws_sold_date_sk#38]
Right output [2]: [d_date_sk#40, d_year#41]
Arguments: [ws_sold_date_sk#38], [d_date_sk#40], Inner, BuildRight

(47) CometProject
Input [7]: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, ws_sold_date_sk#38, d_date_sk#40, d_year#41]
Arguments: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, d_year#41], [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, d_year#41]

(48) CometColumnarToRow [codegen id : 4]
Input [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, d_year#41]

(49) HashAggregate [codegen id : 4]
Input [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, ws_net_paid#37, d_year#41]
Keys [4]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#37))]
Aggregate Attributes [1]: [sum#42]
Results [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41, sum#43]

(50) CometColumnarExchange
Input [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41, sum#43]
Arguments: hashpartitioning(c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(51) CometColumnarToRow [codegen id : 5]
Input [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41, sum#43]

(52) HashAggregate [codegen id : 5]
Input [5]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41, sum#43]
Keys [4]: [c_customer_id#33, c_first_name#34, c_last_name#35, d_year#41]
Functions [1]: [sum(UnscaledValue(ws_net_paid#37))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#37))#44]
Results [2]: [c_customer_id#33 AS customer_id#45, MakeDecimal(sum(UnscaledValue(ws_net_paid#37))#44,17,2) AS year_total#46]

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

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

(55) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#14]
Right keys [1]: [customer_id#45]
Join type: Inner
Join condition: None

(56) Project [codegen id : 8]
Output [7]: [customer_id#14, year_total#15, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#46]
Input [8]: [customer_id#14, year_total#15, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, customer_id#45, year_total#46]

(57) CometScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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#47, c_customer_id#48, c_first_name#49, c_last_name#50]
Condition : (isnotnull(c_customer_sk#47) AND isnotnull(c_customer_id#48))

(59) CometScan parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#53), dynamicpruningexpression(ws_sold_date_sk#53 IN dynamicpruning#54)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(60) CometFilter
Input [3]: [ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]
Condition : isnotnull(ws_bill_customer_sk#51)

(61) CometBroadcastExchange
Input [3]: [ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]
Arguments: [ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]

(62) CometBroadcastHashJoin
Left output [4]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50]
Right output [3]: [ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]
Arguments: [c_customer_sk#47], [ws_bill_customer_sk#51], Inner, BuildRight

(63) CometProject
Input [7]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, ws_bill_customer_sk#51, ws_net_paid#52, ws_sold_date_sk#53]
Arguments: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, ws_sold_date_sk#53], [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, ws_sold_date_sk#53]

(64) ReusedExchange [Reuses operator id: 28]
Output [2]: [d_date_sk#55, d_year#56]

(65) CometBroadcastHashJoin
Left output [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, ws_sold_date_sk#53]
Right output [2]: [d_date_sk#55, d_year#56]
Arguments: [ws_sold_date_sk#53], [d_date_sk#55], Inner, BuildRight

(66) CometProject
Input [7]: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, ws_sold_date_sk#53, d_date_sk#55, d_year#56]
Arguments: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, d_year#56], [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, d_year#56]

(67) CometColumnarToRow [codegen id : 6]
Input [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, d_year#56]

(68) HashAggregate [codegen id : 6]
Input [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, ws_net_paid#52, d_year#56]
Keys [4]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#52))]
Aggregate Attributes [1]: [sum#57]
Results [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56, sum#58]

(69) CometColumnarExchange
Input [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56, sum#58]
Arguments: hashpartitioning(c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(70) CometColumnarToRow [codegen id : 7]
Input [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56, sum#58]

(71) HashAggregate [codegen id : 7]
Input [5]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56, sum#58]
Keys [4]: [c_customer_id#48, c_first_name#49, c_last_name#50, d_year#56]
Functions [1]: [sum(UnscaledValue(ws_net_paid#52))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#52))#44]
Results [2]: [c_customer_id#48 AS customer_id#59, MakeDecimal(sum(UnscaledValue(ws_net_paid#52))#44,17,2) AS year_total#60]

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

(73) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#14]
Right keys [1]: [customer_id#59]
Join type: Inner
Join condition: (CASE WHEN (year_total#46 > 0.00) THEN (year_total#60 / year_total#46) END > CASE WHEN (year_total#15 > 0.00) THEN (year_total#31 / year_total#15) END)

(74) Project [codegen id : 8]
Output [3]: [customer_id#28, customer_first_name#29, customer_last_name#30]
Input [9]: [customer_id#14, year_total#15, customer_id#28, customer_first_name#29, customer_last_name#30, year_total#31, year_total#46, customer_id#59, year_total#60]

(75) TakeOrderedAndProject
Input [3]: [customer_id#28, customer_first_name#29, customer_last_name#30]
Arguments: 100, [customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST, customer_id#28 ASC NULLS FIRST], [customer_id#28, customer_first_name#29, customer_last_name#30]

===== Subqueries =====

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


(76) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#9, d_year#10]
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#9, d_year#10]
Condition : (((isnotnull(d_year#10) AND (d_year#10 = 2001)) AND d_year#10 IN (2001,2002)) AND isnotnull(d_date_sk#9))

(78) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#9, d_year#10]

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

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


(80) CometScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#24, d_year#25]
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#24, d_year#25]
Condition : (((isnotnull(d_year#25) AND (d_year#25 = 2002)) AND d_year#25 IN (2001,2002)) AND isnotnull(d_date_sk#24))

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

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

Subquery:3 Hosting operator id = 40 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#8

Subquery:4 Hosting operator id = 59 Hosting Expression = ws_sold_date_sk#53 IN dynamicpruning#23


