== Physical Plan ==
TakeOrderedAndProject (71)
+- * Project (70)
   +- * BroadcastHashJoin Inner BuildRight (69)
      :- * Project (53)
      :  +- * BroadcastHashJoin Inner BuildRight (52)
      :     :- * BroadcastHashJoin Inner BuildRight (35)
      :     :  :- * Filter (17)
      :     :  :  +- * HashAggregate (16)
      :     :  :     +- Exchange (15)
      :     :  :        +- * HashAggregate (14)
      :     :  :           +- * ColumnarToRow (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 (34)
      :     :     +- * HashAggregate (33)
      :     :        +- Exchange (32)
      :     :           +- * HashAggregate (31)
      :     :              +- * ColumnarToRow (30)
      :     :                 +- CometProject (29)
      :     :                    +- CometBroadcastHashJoin (28)
      :     :                       :- CometProject (24)
      :     :                       :  +- CometBroadcastHashJoin (23)
      :     :                       :     :- CometFilter (19)
      :     :                       :     :  +- CometScan parquet spark_catalog.default.customer (18)
      :     :                       :     +- CometBroadcastExchange (22)
      :     :                       :        +- CometFilter (21)
      :     :                       :           +- CometScan parquet spark_catalog.default.store_sales (20)
      :     :                       +- CometBroadcastExchange (27)
      :     :                          +- CometFilter (26)
      :     :                             +- CometScan parquet spark_catalog.default.date_dim (25)
      :     +- BroadcastExchange (51)
      :        +- * Filter (50)
      :           +- * HashAggregate (49)
      :              +- Exchange (48)
      :                 +- * HashAggregate (47)
      :                    +- * ColumnarToRow (46)
      :                       +- CometProject (45)
      :                          +- CometBroadcastHashJoin (44)
      :                             :- CometProject (42)
      :                             :  +- CometBroadcastHashJoin (41)
      :                             :     :- CometFilter (37)
      :                             :     :  +- CometScan parquet spark_catalog.default.customer (36)
      :                             :     +- CometBroadcastExchange (40)
      :                             :        +- CometFilter (39)
      :                             :           +- CometScan parquet spark_catalog.default.web_sales (38)
      :                             +- ReusedExchange (43)
      +- BroadcastExchange (68)
         +- * HashAggregate (67)
            +- Exchange (66)
               +- * HashAggregate (65)
                  +- * ColumnarToRow (64)
                     +- CometProject (63)
                        +- CometBroadcastHashJoin (62)
                           :- CometProject (60)
                           :  +- CometBroadcastHashJoin (59)
                           :     :- CometFilter (55)
                           :     :  +- CometScan parquet spark_catalog.default.customer (54)
                           :     +- CometBroadcastExchange (58)
                           :        +- CometFilter (57)
                           :           +- CometScan parquet spark_catalog.default.web_sales (56)
                           +- ReusedExchange (61)


(1) Scan 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) Scan 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) Scan 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) ColumnarToRow [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) Exchange
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, [plan_id=1]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(32) Exchange
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, [plan_id=2]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(48) Exchange
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, [plan_id=4]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(66) Exchange
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, [plan_id=6]

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

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

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

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

(71) 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 (75)
+- * ColumnarToRow (74)
   +- CometFilter (73)
      +- CometScan parquet spark_catalog.default.date_dim (72)


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

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

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

(75) 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 = 20 Hosting Expression = ss_sold_date_sk#22 IN dynamicpruning#23
BroadcastExchange (79)
+- * ColumnarToRow (78)
   +- CometFilter (77)
      +- CometScan parquet spark_catalog.default.date_dim (76)


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

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

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

(79) 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 = 38 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#8

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


