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


(1) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Arguments: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]

(2) CometFilter
Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2))

(3) CometNativeScan: `spark_catalog`.`default`.`store_sales`
Output [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Arguments: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]

(4) CometFilter
Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Condition : isnotnull(ss_customer_sk#9)

(5) CometBroadcastExchange
Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Arguments: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]

(6) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Right output [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Arguments: [c_customer_sk#1], [ss_customer_sk#9], Inner, BuildRight

(7) CometProject
Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Arguments: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12], [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]

(8) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#13, d_year#14]
Arguments: [d_date_sk#13, d_year#14]

(9) CometFilter
Input [2]: [d_date_sk#13, d_year#14]
Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13))

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

(11) CometBroadcastHashJoin
Left output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
Right output [2]: [d_date_sk#13, d_year#14]
Arguments: [ss_sold_date_sk#12], [d_date_sk#13], Inner, BuildRight

(12) CometProject
Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12, d_date_sk#13, d_year#14]
Arguments: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#14], [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#14]

(13) ColumnarToRow [codegen id : 1]
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#14]

(14) HashAggregate [codegen id : 1]
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#14]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))]
Aggregate Attributes [1]: [sum#15]
Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#16]

(15) Exchange
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#16]
Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), ENSURE_REQUIREMENTS, [plan_id=1]

(16) HashAggregate [codegen id : 8]
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#16]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))#17]
Results [2]: [c_customer_id#2 AS customer_id#18, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))#17,18,2) AS year_total#19]

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

(18) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [8]: [c_customer_sk#20, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Arguments: [c_customer_sk#20, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]

(19) CometFilter
Input [8]: [c_customer_sk#20, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Condition : (isnotnull(c_customer_sk#20) AND isnotnull(c_customer_id#21))

(20) ReusedExchange [Reuses operator id: 5]
Output [4]: [ss_customer_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31]

(21) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#20, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Right output [4]: [ss_customer_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31]
Arguments: [c_customer_sk#20], [ss_customer_sk#28], Inner, BuildRight

(22) CometProject
Input [12]: [c_customer_sk#20, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_customer_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31]
Arguments: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31], [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31]

(23) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#32, d_year#33]
Arguments: [d_date_sk#32, d_year#33]

(24) CometFilter
Input [2]: [d_date_sk#32, d_year#33]
Condition : ((isnotnull(d_year#33) AND (d_year#33 = 2002)) AND isnotnull(d_date_sk#32))

(25) CometBroadcastExchange
Input [2]: [d_date_sk#32, d_year#33]
Arguments: [d_date_sk#32, d_year#33]

(26) CometBroadcastHashJoin
Left output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31]
Right output [2]: [d_date_sk#32, d_year#33]
Arguments: [ss_sold_date_sk#31], [d_date_sk#32], Inner, BuildRight

(27) CometProject
Input [12]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, ss_sold_date_sk#31, d_date_sk#32, d_year#33]
Arguments: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#33], [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#33]

(28) ColumnarToRow [codegen id : 2]
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#33]

(29) HashAggregate [codegen id : 2]
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#33]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))]
Aggregate Attributes [1]: [sum#34]
Results [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#35]

(30) Exchange
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#35]
Arguments: hashpartitioning(c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(31) HashAggregate [codegen id : 3]
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#35]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#33, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#17]
Results [3]: [c_customer_id#21 AS customer_id#36, c_preferred_cust_flag#24 AS customer_preferred_cust_flag#37, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#17,18,2) AS year_total#38]

(32) BroadcastExchange
Input [3]: [customer_id#36, customer_preferred_cust_flag#37, year_total#38]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=3]

(33) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#18]
Right keys [1]: [customer_id#36]
Join type: Inner
Join condition: None

(34) Project [codegen id : 8]
Output [4]: [customer_id#18, year_total#19, customer_preferred_cust_flag#37, year_total#38]
Input [5]: [customer_id#18, year_total#19, customer_id#36, customer_preferred_cust_flag#37, year_total#38]

(35) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [8]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46]
Arguments: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46]

(36) CometFilter
Input [8]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46]
Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_customer_id#40))

(37) ReusedExchange [Reuses operator id: 5]
Output [4]: [ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50]

(38) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46]
Right output [4]: [ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50]
Arguments: [c_customer_sk#39], [ws_bill_customer_sk#47], Inner, BuildRight

(39) CometProject
Input [12]: [c_customer_sk#39, c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50], [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50]

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

(41) CometBroadcastHashJoin
Left output [10]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50]
Right output [2]: [d_date_sk#51, d_year#52]
Arguments: [ws_sold_date_sk#50], [d_date_sk#51], Inner, BuildRight

(42) CometProject
Input [12]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, ws_sold_date_sk#50, d_date_sk#51, d_year#52]
Arguments: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#52], [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#52]

(43) ColumnarToRow [codegen id : 4]
Input [10]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#52]

(44) HashAggregate [codegen id : 4]
Input [10]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#52]
Keys [8]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))]
Aggregate Attributes [1]: [sum#53]
Results [9]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52, sum#54]

(45) Exchange
Input [9]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52, sum#54]
Arguments: hashpartitioning(c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(46) HashAggregate [codegen id : 5]
Input [9]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52, sum#54]
Keys [8]: [c_customer_id#40, c_first_name#41, c_last_name#42, c_preferred_cust_flag#43, c_birth_country#44, c_login#45, c_email_address#46, d_year#52]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#55]
Results [2]: [c_customer_id#40 AS customer_id#56, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#55,18,2) AS year_total#57]

(47) Filter [codegen id : 5]
Input [2]: [customer_id#56, year_total#57]
Condition : (isnotnull(year_total#57) AND (year_total#57 > 0.00))

(48) BroadcastExchange
Input [2]: [customer_id#56, year_total#57]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]

(49) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#18]
Right keys [1]: [customer_id#56]
Join type: Inner
Join condition: None

(50) Project [codegen id : 8]
Output [5]: [customer_id#18, year_total#19, customer_preferred_cust_flag#37, year_total#38, year_total#57]
Input [6]: [customer_id#18, year_total#19, customer_preferred_cust_flag#37, year_total#38, customer_id#56, year_total#57]

(51) CometNativeScan: `spark_catalog`.`default`.`customer`
Output [8]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65]
Arguments: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65]

(52) CometFilter
Input [8]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65]
Condition : (isnotnull(c_customer_sk#58) AND isnotnull(c_customer_id#59))

(53) ReusedExchange [Reuses operator id: 5]
Output [4]: [ws_bill_customer_sk#66, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69]

(54) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65]
Right output [4]: [ws_bill_customer_sk#66, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69]
Arguments: [c_customer_sk#58], [ws_bill_customer_sk#66], Inner, BuildRight

(55) CometProject
Input [12]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_bill_customer_sk#66, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69]
Arguments: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69], [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69]

(56) ReusedExchange [Reuses operator id: 25]
Output [2]: [d_date_sk#70, d_year#71]

(57) CometBroadcastHashJoin
Left output [10]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69]
Right output [2]: [d_date_sk#70, d_year#71]
Arguments: [ws_sold_date_sk#69], [d_date_sk#70], Inner, BuildRight

(58) CometProject
Input [12]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, ws_sold_date_sk#69, d_date_sk#70, d_year#71]
Arguments: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, d_year#71], [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, d_year#71]

(59) ColumnarToRow [codegen id : 6]
Input [10]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, d_year#71]

(60) HashAggregate [codegen id : 6]
Input [10]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#67, ws_ext_list_price#68, d_year#71]
Keys [8]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#68 - ws_ext_discount_amt#67)))]
Aggregate Attributes [1]: [sum#72]
Results [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71, sum#73]

(61) Exchange
Input [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71, sum#73]
Arguments: hashpartitioning(c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(62) HashAggregate [codegen id : 7]
Input [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71, sum#73]
Keys [8]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#71]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#68 - ws_ext_discount_amt#67)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#68 - ws_ext_discount_amt#67)))#55]
Results [2]: [c_customer_id#59 AS customer_id#74, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#68 - ws_ext_discount_amt#67)))#55,18,2) AS year_total#75]

(63) BroadcastExchange
Input [2]: [customer_id#74, year_total#75]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=7]

(64) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#18]
Right keys [1]: [customer_id#74]
Join type: Inner
Join condition: (CASE WHEN (year_total#57 > 0.00) THEN (year_total#75 / year_total#57) END > CASE WHEN (year_total#19 > 0.00) THEN (year_total#38 / year_total#19) END)

(65) Project [codegen id : 8]
Output [1]: [customer_preferred_cust_flag#37]
Input [7]: [customer_id#18, year_total#19, customer_preferred_cust_flag#37, year_total#38, year_total#57, customer_id#74, year_total#75]

(66) TakeOrderedAndProject
Input [1]: [customer_preferred_cust_flag#37]
Arguments: 100, [customer_preferred_cust_flag#37 ASC NULLS FIRST], [customer_preferred_cust_flag#37]

