== 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(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#2, 16, true, false, true)))

(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, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#2, 16, true, false, true) AS c_customer_id#5, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#3, 20, true, false, true) AS c_first_name#6, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#4, 30, true, false, true) 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(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#20, 16, true, false, true)))

(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#5, c_first_name#6, c_last_name#7], [c_customer_sk#19, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#20, 16, true, false, true) AS c_customer_id#5, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#21, 20, true, false, true) AS c_first_name#6, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#22, 30, true, false, true) AS c_last_name#7]

(22) CometColumnarToRow [codegen id : 6]
Input [4]: [c_customer_sk#19, c_customer_id#5, c_first_name#6, c_last_name#7]

(23) Scan parquet spark_catalog.default.store_sales
Output [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#25), dynamicpruningexpression(ss_sold_date_sk#25 IN dynamicpruning#26)]
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#23, ss_net_paid#24, ss_sold_date_sk#25]

(25) Filter [codegen id : 4]
Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25]
Condition : isnotnull(ss_customer_sk#23)

(26) BroadcastExchange
Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25]
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#23]
Join type: Inner
Join condition: None

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

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

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

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

(32) HashAggregate [codegen id : 6]
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, ss_net_paid#24, d_year#28]
Keys [4]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#28]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#24))]
Aggregate Attributes [1]: [sum#29]
Results [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#28, sum#30]

(33) CometColumnarExchange
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#28, sum#30]
Arguments: hashpartitioning(c_customer_id#5, c_first_name#6, c_last_name#7, d_year#28, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(34) CometColumnarToRow [codegen id : 7]
Input [5]: [c_customer_id#5, c_first_name#6, c_last_name#7, d_year#28, sum#30]

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

(36) BroadcastExchange
Input [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, year_total#34]
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#31]
Join type: Inner
Join condition: None

(38) CometNativeScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38]
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#35, c_customer_id#36, c_first_name#37, c_last_name#38]
Condition : (isnotnull(c_customer_sk#35) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#36, 16, true, false, true)))

(40) CometProject
Input [4]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38]
Arguments: [c_customer_sk#35, c_customer_id#39, c_first_name#40, c_last_name#41], [c_customer_sk#35, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#36, 16, true, false, true) AS c_customer_id#39, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#37, 20, true, false, true) AS c_first_name#40, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#38, 30, true, false, true) AS c_last_name#41]

(41) CometColumnarToRow [codegen id : 10]
Input [4]: [c_customer_sk#35, c_customer_id#39, c_first_name#40, c_last_name#41]

(42) Scan parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#44), dynamicpruningexpression(ws_sold_date_sk#44 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#42, ws_net_paid#43, ws_sold_date_sk#44]

(44) Filter [codegen id : 8]
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]
Condition : isnotnull(ws_bill_customer_sk#42)

(45) BroadcastExchange
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]
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#35]
Right keys [1]: [ws_bill_customer_sk#42]
Join type: Inner
Join condition: None

(47) Project [codegen id : 10]
Output [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#43, ws_sold_date_sk#44]
Input [7]: [c_customer_sk#35, c_customer_id#39, c_first_name#40, c_last_name#41, ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]

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

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

(50) Project [codegen id : 10]
Output [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#43, d_year#46]
Input [7]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#43, ws_sold_date_sk#44, d_date_sk#45, d_year#46]

(51) HashAggregate [codegen id : 10]
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#43, d_year#46]
Keys [4]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#46]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#43))]
Aggregate Attributes [1]: [sum#47]
Results [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#46, sum#48]

(52) CometColumnarExchange
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#46, sum#48]
Arguments: hashpartitioning(c_customer_id#39, c_first_name#40, c_last_name#41, d_year#46, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(53) CometColumnarToRow [codegen id : 11]
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#46, sum#48]

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

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

(56) BroadcastExchange
Input [2]: [customer_id#50, year_total#51]
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#50]
Join type: Inner
Join condition: None

(58) Project [codegen id : 16]
Output [7]: [customer_id#17, year_total#18, customer_id#31, customer_first_name#32, customer_last_name#33, year_total#34, year_total#51]
Input [8]: [customer_id#17, year_total#18, customer_id#31, customer_first_name#32, customer_last_name#33, year_total#34, customer_id#50, year_total#51]

(59) CometNativeScan parquet spark_catalog.default.customer
Output [4]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55]
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#52, c_customer_id#53, c_first_name#54, c_last_name#55]
Condition : (isnotnull(c_customer_sk#52) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#53, 16, true, false, true)))

(61) CometProject
Input [4]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55]
Arguments: [c_customer_sk#52, c_customer_id#39, c_first_name#40, c_last_name#41], [c_customer_sk#52, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#53, 16, true, false, true) AS c_customer_id#39, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#54, 20, true, false, true) AS c_first_name#40, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#55, 30, true, false, true) AS c_last_name#41]

(62) CometColumnarToRow [codegen id : 14]
Input [4]: [c_customer_sk#52, c_customer_id#39, c_first_name#40, c_last_name#41]

(63) Scan parquet spark_catalog.default.web_sales
Output [3]: [ws_bill_customer_sk#56, ws_net_paid#57, ws_sold_date_sk#58]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#58), dynamicpruningexpression(ws_sold_date_sk#58 IN dynamicpruning#26)]
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#56, ws_net_paid#57, ws_sold_date_sk#58]

(65) Filter [codegen id : 12]
Input [3]: [ws_bill_customer_sk#56, ws_net_paid#57, ws_sold_date_sk#58]
Condition : isnotnull(ws_bill_customer_sk#56)

(66) BroadcastExchange
Input [3]: [ws_bill_customer_sk#56, ws_net_paid#57, ws_sold_date_sk#58]
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#52]
Right keys [1]: [ws_bill_customer_sk#56]
Join type: Inner
Join condition: None

(68) Project [codegen id : 14]
Output [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#57, ws_sold_date_sk#58]
Input [7]: [c_customer_sk#52, c_customer_id#39, c_first_name#40, c_last_name#41, ws_bill_customer_sk#56, ws_net_paid#57, ws_sold_date_sk#58]

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

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

(71) Project [codegen id : 14]
Output [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#57, d_year#60]
Input [7]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#57, ws_sold_date_sk#58, d_date_sk#59, d_year#60]

(72) HashAggregate [codegen id : 14]
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, ws_net_paid#57, d_year#60]
Keys [4]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#57))]
Aggregate Attributes [1]: [sum#61]
Results [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60, sum#62]

(73) CometColumnarExchange
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60, sum#62]
Arguments: hashpartitioning(c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(74) CometColumnarToRow [codegen id : 15]
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60, sum#62]

(75) HashAggregate [codegen id : 15]
Input [5]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60, sum#62]
Keys [4]: [c_customer_id#39, c_first_name#40, c_last_name#41, d_year#60]
Functions [1]: [sum(UnscaledValue(ws_net_paid#57))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#57))#49]
Results [2]: [c_customer_id#39 AS customer_id#63, MakeDecimal(sum(UnscaledValue(ws_net_paid#57))#49,17,2) AS year_total#64]

(76) BroadcastExchange
Input [2]: [customer_id#63, year_total#64]
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#63]
Join type: Inner
Join condition: (CASE WHEN (year_total#51 > 0.00) THEN (year_total#64 / year_total#51) END > CASE WHEN (year_total#18 > 0.00) THEN (year_total#34 / year_total#18) END)

(78) Project [codegen id : 16]
Output [3]: [customer_id#31, customer_first_name#32, customer_last_name#33]
Input [9]: [customer_id#17, year_total#18, customer_id#31, customer_first_name#32, customer_last_name#33, year_total#34, year_total#51, customer_id#63, year_total#64]

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

===== 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#25 IN dynamicpruning#26
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#27, d_year#28]
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#27, d_year#28]
Condition : (((isnotnull(d_year#28) AND (d_year#28 = 2002)) AND d_year#28 IN (2001,2002)) AND isnotnull(d_date_sk#27))

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

(87) BroadcastExchange
Input [2]: [d_date_sk#27, d_year#28]
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#44 IN dynamicpruning#11

Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#58 IN dynamicpruning#26


