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


(1) CometNativeScan 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) CometColumnarToRow [codegen id : 3]
Input [4]: [c_customer_sk#1, c_customer_id#5, c_first_name#6, c_last_name#7]

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

(6) ColumnarToRow [codegen id : 1]
Input [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]

(7) Filter [codegen id : 1]
Input [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Condition : isnotnull(ss_customer_sk#8)

(8) BroadcastExchange
Input [3]: [ss_customer_sk#8, ss_net_paid#9, ss_sold_date_sk#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]

(9) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#8]
Join type: Inner
Join condition: None

(10) Project [codegen id : 3]
Output [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, ss_sold_date_sk#10]
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]

(11) ReusedExchange [Reuses operator id: 83]
Output [2]: [d_date_sk#12, d_year#13]

(12) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_sold_date_sk#10]
Right keys [1]: [d_date_sk#12]
Join type: Inner
Join condition: None

(13) Project [codegen id : 3]
Output [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#9, d_year#13]
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]

(14) HashAggregate [codegen id : 3]
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))]
Aggregate Attributes [1]: [sum#14]
Results [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#15]

(15) CometColumnarExchange
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#15]
Arguments: hashpartitioning(c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=2]

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

(17) HashAggregate [codegen id : 16]
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#13, sum#15]
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))#16]
Results [2]: [c_customer_id#5 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#9))#16,17,2) AS year_total#18]

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

(19) CometNativeScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22]
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#19, c_customer_id#20, c_first_name#21, c_last_name#22]
Condition : (isnotnull(c_customer_sk#19) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#20, 16))))

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

(22) CometColumnarToRow [codegen id : 6]
Input [4]: [c_customer_sk#19, c_customer_id#23, c_first_name#24, c_last_name#25]

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

(24) ColumnarToRow [codegen id : 4]
Input [3]: [ss_customer_sk#26, ss_net_paid#27, ss_sold_date_sk#28]

(25) Filter [codegen id : 4]
Input [3]: [ss_customer_sk#26, ss_net_paid#27, ss_sold_date_sk#28]
Condition : isnotnull(ss_customer_sk#26)

(26) BroadcastExchange
Input [3]: [ss_customer_sk#26, ss_net_paid#27, ss_sold_date_sk#28]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

(27) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [c_customer_sk#19]
Right keys [1]: [ss_customer_sk#26]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, ss_net_paid#27, ss_sold_date_sk#28]
Input [7]: [c_customer_sk#19, c_customer_id#23, c_first_name#24, c_last_name#25, ss_customer_sk#26, ss_net_paid#27, ss_sold_date_sk#28]

(29) ReusedExchange [Reuses operator id: 87]
Output [2]: [d_date_sk#30, d_year#31]

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

(31) Project [codegen id : 6]
Output [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, ss_net_paid#27, d_year#31]
Input [7]: [c_customer_id#23, c_first_name#24, c_last_name#25, ss_net_paid#27, ss_sold_date_sk#28, d_date_sk#30, d_year#31]

(32) HashAggregate [codegen id : 6]
Input [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, ss_net_paid#27, d_year#31]
Keys [4]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#27))]
Aggregate Attributes [1]: [sum#32]
Results [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31, sum#33]

(33) CometColumnarExchange
Input [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31, sum#33]
Arguments: hashpartitioning(c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(34) CometColumnarToRow [codegen id : 7]
Input [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31, sum#33]

(35) HashAggregate [codegen id : 7]
Input [5]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31, sum#33]
Keys [4]: [c_customer_id#23, c_first_name#24, c_last_name#25, d_year#31]
Functions [1]: [sum(UnscaledValue(ss_net_paid#27))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#27))#16]
Results [4]: [c_customer_id#23 AS customer_id#34, c_first_name#24 AS customer_first_name#35, c_last_name#25 AS customer_last_name#36, MakeDecimal(sum(UnscaledValue(ss_net_paid#27))#16,17,2) AS year_total#37]

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

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

(38) CometNativeScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41]
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#38, c_customer_id#39, c_first_name#40, c_last_name#41]
Condition : (isnotnull(c_customer_sk#38) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#39, 16))))

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

(41) CometColumnarToRow [codegen id : 10]
Input [4]: [c_customer_sk#38, c_customer_id#42, c_first_name#43, c_last_name#44]

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

(43) ColumnarToRow [codegen id : 8]
Input [3]: [ws_bill_customer_sk#45, ws_net_paid#46, ws_sold_date_sk#47]

(44) Filter [codegen id : 8]
Input [3]: [ws_bill_customer_sk#45, ws_net_paid#46, ws_sold_date_sk#47]
Condition : isnotnull(ws_bill_customer_sk#45)

(45) BroadcastExchange
Input [3]: [ws_bill_customer_sk#45, ws_net_paid#46, ws_sold_date_sk#47]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]

(46) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [c_customer_sk#38]
Right keys [1]: [ws_bill_customer_sk#45]
Join type: Inner
Join condition: None

(47) Project [codegen id : 10]
Output [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, ws_net_paid#46, ws_sold_date_sk#47]
Input [7]: [c_customer_sk#38, c_customer_id#42, c_first_name#43, c_last_name#44, ws_bill_customer_sk#45, ws_net_paid#46, ws_sold_date_sk#47]

(48) ReusedExchange [Reuses operator id: 83]
Output [2]: [d_date_sk#48, d_year#49]

(49) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [ws_sold_date_sk#47]
Right keys [1]: [d_date_sk#48]
Join type: Inner
Join condition: None

(50) Project [codegen id : 10]
Output [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, ws_net_paid#46, d_year#49]
Input [7]: [c_customer_id#42, c_first_name#43, c_last_name#44, ws_net_paid#46, ws_sold_date_sk#47, d_date_sk#48, d_year#49]

(51) HashAggregate [codegen id : 10]
Input [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, ws_net_paid#46, d_year#49]
Keys [4]: [c_customer_id#42, c_first_name#43, c_last_name#44, d_year#49]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#46))]
Aggregate Attributes [1]: [sum#50]
Results [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, d_year#49, sum#51]

(52) CometColumnarExchange
Input [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, d_year#49, sum#51]
Arguments: hashpartitioning(c_customer_id#42, c_first_name#43, c_last_name#44, d_year#49, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(53) CometColumnarToRow [codegen id : 11]
Input [5]: [c_customer_id#42, c_first_name#43, c_last_name#44, d_year#49, sum#51]

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

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

(56) BroadcastExchange
Input [2]: [customer_id#53, year_total#54]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=8]

(57) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#17]
Right keys [1]: [customer_id#53]
Join type: Inner
Join condition: None

(58) Project [codegen id : 16]
Output [7]: [customer_id#17, year_total#18, customer_id#34, customer_first_name#35, customer_last_name#36, year_total#37, year_total#54]
Input [8]: [customer_id#17, year_total#18, customer_id#34, customer_first_name#35, customer_last_name#36, year_total#37, customer_id#53, year_total#54]

(59) CometNativeScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#55, c_customer_id#56, c_first_name#57, c_last_name#58]
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>

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

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

(62) CometColumnarToRow [codegen id : 14]
Input [4]: [c_customer_sk#55, c_customer_id#59, c_first_name#60, c_last_name#61]

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

(64) ColumnarToRow [codegen id : 12]
Input [3]: [ws_bill_customer_sk#62, ws_net_paid#63, ws_sold_date_sk#64]

(65) Filter [codegen id : 12]
Input [3]: [ws_bill_customer_sk#62, ws_net_paid#63, ws_sold_date_sk#64]
Condition : isnotnull(ws_bill_customer_sk#62)

(66) BroadcastExchange
Input [3]: [ws_bill_customer_sk#62, ws_net_paid#63, ws_sold_date_sk#64]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]

(67) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_customer_sk#55]
Right keys [1]: [ws_bill_customer_sk#62]
Join type: Inner
Join condition: None

(68) Project [codegen id : 14]
Output [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, ws_net_paid#63, ws_sold_date_sk#64]
Input [7]: [c_customer_sk#55, c_customer_id#59, c_first_name#60, c_last_name#61, ws_bill_customer_sk#62, ws_net_paid#63, ws_sold_date_sk#64]

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

(70) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_sold_date_sk#64]
Right keys [1]: [d_date_sk#65]
Join type: Inner
Join condition: None

(71) Project [codegen id : 14]
Output [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, ws_net_paid#63, d_year#66]
Input [7]: [c_customer_id#59, c_first_name#60, c_last_name#61, ws_net_paid#63, ws_sold_date_sk#64, d_date_sk#65, d_year#66]

(72) HashAggregate [codegen id : 14]
Input [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, ws_net_paid#63, d_year#66]
Keys [4]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#63))]
Aggregate Attributes [1]: [sum#67]
Results [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66, sum#68]

(73) CometColumnarExchange
Input [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66, sum#68]
Arguments: hashpartitioning(c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(74) CometColumnarToRow [codegen id : 15]
Input [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66, sum#68]

(75) HashAggregate [codegen id : 15]
Input [5]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66, sum#68]
Keys [4]: [c_customer_id#59, c_first_name#60, c_last_name#61, d_year#66]
Functions [1]: [sum(UnscaledValue(ws_net_paid#63))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#63))#52]
Results [2]: [c_customer_id#59 AS customer_id#69, MakeDecimal(sum(UnscaledValue(ws_net_paid#63))#52,17,2) AS year_total#70]

(76) BroadcastExchange
Input [2]: [customer_id#69, year_total#70]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=11]

(77) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#17]
Right keys [1]: [customer_id#69]
Join type: Inner
Join condition: (CASE WHEN (year_total#54 > 0.00) THEN (year_total#70 / year_total#54) END > CASE WHEN (year_total#18 > 0.00) THEN (year_total#37 / year_total#18) END)

(78) Project [codegen id : 16]
Output [3]: [customer_id#34, customer_first_name#35, customer_last_name#36]
Input [9]: [customer_id#17, year_total#18, customer_id#34, customer_first_name#35, customer_last_name#36, year_total#37, year_total#54, customer_id#69, year_total#70]

(79) TakeOrderedAndProject
Input [3]: [customer_id#34, customer_first_name#35, customer_last_name#36]
Arguments: 100, [customer_id#34 ASC NULLS FIRST, customer_id#34 ASC NULLS FIRST, customer_id#34 ASC NULLS FIRST], [customer_id#34, customer_first_name#35, customer_last_name#36]

===== Subqueries =====

Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#10 IN dynamicpruning#11
BroadcastExchange (83)
+- * CometColumnarToRow (82)
   +- CometFilter (81)
      +- CometNativeScan parquet spark_catalog.default.date_dim (80)


(80) 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,2001), 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#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))

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

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

Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#28 IN dynamicpruning#29
BroadcastExchange (87)
+- * CometColumnarToRow (86)
   +- CometFilter (85)
      +- CometNativeScan parquet spark_catalog.default.date_dim (84)


(84) CometNativeScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#30, d_year#31]
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>

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

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

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

Subquery:3 Hosting operator id = 42 Hosting Expression = ws_sold_date_sk#47 IN dynamicpruning#11

Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#64 IN dynamicpruning#29


