== Physical Plan ==
TakeOrderedAndProject (120)
+- * Project (119)
   +- * BroadcastHashJoin Inner BuildRight (118)
      :- * Project (99)
      :  +- * BroadcastHashJoin Inner BuildRight (98)
      :     :- * 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.catalog_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.catalog_sales (63)
      :     :                          +- ReusedExchange (69)
      :     +- BroadcastExchange (97)
      :        +- * Filter (96)
      :           +- * HashAggregate (95)
      :              +- * CometColumnarToRow (94)
      :                 +- CometColumnarExchange (93)
      :                    +- * HashAggregate (92)
      :                       +- * Project (91)
      :                          +- * BroadcastHashJoin Inner BuildRight (90)
      :                             :- * Project (88)
      :                             :  +- * BroadcastHashJoin Inner BuildRight (87)
      :                             :     :- * CometColumnarToRow (82)
      :                             :     :  +- CometProject (81)
      :                             :     :     +- CometFilter (80)
      :                             :     :        +- CometNativeScan parquet spark_catalog.default.customer (79)
      :                             :     +- BroadcastExchange (86)
      :                             :        +- * Filter (85)
      :                             :           +- * ColumnarToRow (84)
      :                             :              +- Scan parquet spark_catalog.default.web_sales (83)
      :                             +- ReusedExchange (89)
      +- BroadcastExchange (117)
         +- * HashAggregate (116)
            +- * CometColumnarToRow (115)
               +- CometColumnarExchange (114)
                  +- * HashAggregate (113)
                     +- * Project (112)
                        +- * BroadcastHashJoin Inner BuildRight (111)
                           :- * Project (109)
                           :  +- * BroadcastHashJoin Inner BuildRight (108)
                           :     :- * CometColumnarToRow (103)
                           :     :  +- CometProject (102)
                           :     :     +- CometFilter (101)
                           :     :        +- CometNativeScan parquet spark_catalog.default.customer (100)
                           :     +- BroadcastExchange (107)
                           :        +- * Filter (106)
                           :           +- * ColumnarToRow (105)
                           :              +- Scan parquet spark_catalog.default.web_sales (104)
                           +- ReusedExchange (110)


(1) CometNativeScan parquet 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]
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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(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(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#2, 16))))

(3) CometProject
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]
Arguments: [c_customer_sk#1, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14], [c_customer_sk#1, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#2, 16)) AS c_customer_id#9, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#3, 20)) AS c_first_name#10, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#4, 30)) AS c_last_name#11, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#5, 1)) AS c_preferred_cust_flag#12, c_birth_country#6, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#7, 13)) AS c_login#13, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#8, 50)) AS c_email_address#14]

(4) CometColumnarToRow [codegen id : 3]
Input [8]: [c_customer_sk#1, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14]

(5) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#20), dynamicpruningexpression(ss_sold_date_sk#20 IN dynamicpruning#21)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_sales_price:decimal(7,2),ss_ext_wholesale_cost:decimal(7,2),ss_ext_list_price:decimal(7,2)>

(6) ColumnarToRow [codegen id : 1]
Input [6]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]

(7) Filter [codegen id : 1]
Input [6]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]
Condition : isnotnull(ss_customer_sk#15)

(8) BroadcastExchange
Input [6]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]
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#15]
Join type: Inner
Join condition: None

(10) Project [codegen id : 3]
Output [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]
Input [14]: [c_customer_sk#1, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20]

(11) ReusedExchange [Reuses operator id: 124]
Output [2]: [d_date_sk#22, d_year#23]

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

(13) Project [codegen id : 3]
Output [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, d_year#23]
Input [14]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, ss_sold_date_sk#20, d_date_sk#22, d_year#23]

(14) HashAggregate [codegen id : 3]
Input [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, ss_ext_discount_amt#16, ss_ext_sales_price#17, ss_ext_wholesale_cost#18, ss_ext_list_price#19, d_year#23]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23]
Functions [1]: [partial_sum(((((ss_ext_list_price#19 - ss_ext_wholesale_cost#18) - ss_ext_discount_amt#16) + ss_ext_sales_price#17) / 2))]
Aggregate Attributes [2]: [sum#24, isEmpty#25]
Results [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23, sum#26, isEmpty#27]

(15) CometColumnarExchange
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23, sum#26, isEmpty#27]
Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=2]

(16) CometColumnarToRow [codegen id : 24]
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23, sum#26, isEmpty#27]

(17) HashAggregate [codegen id : 24]
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23, sum#26, isEmpty#27]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, d_year#23]
Functions [1]: [sum(((((ss_ext_list_price#19 - ss_ext_wholesale_cost#18) - ss_ext_discount_amt#16) + ss_ext_sales_price#17) / 2))]
Aggregate Attributes [1]: [sum(((((ss_ext_list_price#19 - ss_ext_wholesale_cost#18) - ss_ext_discount_amt#16) + ss_ext_sales_price#17) / 2))#28]
Results [2]: [c_customer_id#9 AS customer_id#29, sum(((((ss_ext_list_price#19 - ss_ext_wholesale_cost#18) - ss_ext_discount_amt#16) + ss_ext_sales_price#17) / 2))#28 AS year_total#30]

(18) Filter [codegen id : 24]
Input [2]: [customer_id#29, year_total#30]
Condition : (isnotnull(year_total#30) AND (year_total#30 > 0.000000))

(19) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#31, c_customer_id#32, c_first_name#33, c_last_name#34, c_preferred_cust_flag#35, c_birth_country#36, c_login#37, c_email_address#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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(20) CometFilter
Input [8]: [c_customer_sk#31, c_customer_id#32, c_first_name#33, c_last_name#34, c_preferred_cust_flag#35, c_birth_country#36, c_login#37, c_email_address#38]
Condition : (isnotnull(c_customer_sk#31) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#32, 16))))

(21) CometProject
Input [8]: [c_customer_sk#31, c_customer_id#32, c_first_name#33, c_last_name#34, c_preferred_cust_flag#35, c_birth_country#36, c_login#37, c_email_address#38]
Arguments: [c_customer_sk#31, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44], [c_customer_sk#31, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#32, 16)) AS c_customer_id#39, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#33, 20)) AS c_first_name#40, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#34, 30)) AS c_last_name#41, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#35, 1)) AS c_preferred_cust_flag#42, c_birth_country#36, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#37, 13)) AS c_login#43, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#38, 50)) AS c_email_address#44]

(22) CometColumnarToRow [codegen id : 6]
Input [8]: [c_customer_sk#31, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44]

(23) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_customer_sk#45, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#50), dynamicpruningexpression(ss_sold_date_sk#50 IN dynamicpruning#51)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_sales_price:decimal(7,2),ss_ext_wholesale_cost:decimal(7,2),ss_ext_list_price:decimal(7,2)>

(24) ColumnarToRow [codegen id : 4]
Input [6]: [ss_customer_sk#45, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]

(25) Filter [codegen id : 4]
Input [6]: [ss_customer_sk#45, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]
Condition : isnotnull(ss_customer_sk#45)

(26) BroadcastExchange
Input [6]: [ss_customer_sk#45, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]
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#31]
Right keys [1]: [ss_customer_sk#45]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [12]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]
Input [14]: [c_customer_sk#31, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, ss_customer_sk#45, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50]

(29) ReusedExchange [Reuses operator id: 128]
Output [2]: [d_date_sk#52, d_year#53]

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

(31) Project [codegen id : 6]
Output [12]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, d_year#53]
Input [14]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, ss_sold_date_sk#50, d_date_sk#52, d_year#53]

(32) HashAggregate [codegen id : 6]
Input [12]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, ss_ext_discount_amt#46, ss_ext_sales_price#47, ss_ext_wholesale_cost#48, ss_ext_list_price#49, d_year#53]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53]
Functions [1]: [partial_sum(((((ss_ext_list_price#49 - ss_ext_wholesale_cost#48) - ss_ext_discount_amt#46) + ss_ext_sales_price#47) / 2))]
Aggregate Attributes [2]: [sum#54, isEmpty#55]
Results [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53, sum#56, isEmpty#57]

(33) CometColumnarExchange
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53, sum#56, isEmpty#57]
Arguments: hashpartitioning(c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(34) CometColumnarToRow [codegen id : 7]
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53, sum#56, isEmpty#57]

(35) HashAggregate [codegen id : 7]
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53, sum#56, isEmpty#57]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#36, c_login#43, c_email_address#44, d_year#53]
Functions [1]: [sum(((((ss_ext_list_price#49 - ss_ext_wholesale_cost#48) - ss_ext_discount_amt#46) + ss_ext_sales_price#47) / 2))]
Aggregate Attributes [1]: [sum(((((ss_ext_list_price#49 - ss_ext_wholesale_cost#48) - ss_ext_discount_amt#46) + ss_ext_sales_price#47) / 2))#28]
Results [8]: [c_customer_id#39 AS customer_id#58, c_first_name#40 AS customer_first_name#59, c_last_name#41 AS customer_last_name#60, c_preferred_cust_flag#42 AS customer_preferred_cust_flag#61, c_birth_country#36 AS customer_birth_country#62, c_login#43 AS customer_login#63, c_email_address#44 AS customer_email_address#64, sum(((((ss_ext_list_price#49 - ss_ext_wholesale_cost#48) - ss_ext_discount_amt#46) + ss_ext_sales_price#47) / 2))#28 AS year_total#65]

(36) BroadcastExchange
Input [8]: [customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#65]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]

(37) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#29]
Right keys [1]: [customer_id#58]
Join type: Inner
Join condition: None

(38) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#66, c_customer_id#67, c_first_name#68, c_last_name#69, c_preferred_cust_flag#70, c_birth_country#71, c_login#72, c_email_address#73]
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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(39) CometFilter
Input [8]: [c_customer_sk#66, c_customer_id#67, c_first_name#68, c_last_name#69, c_preferred_cust_flag#70, c_birth_country#71, c_login#72, c_email_address#73]
Condition : (isnotnull(c_customer_sk#66) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#67, 16))))

(40) CometProject
Input [8]: [c_customer_sk#66, c_customer_id#67, c_first_name#68, c_last_name#69, c_preferred_cust_flag#70, c_birth_country#71, c_login#72, c_email_address#73]
Arguments: [c_customer_sk#66, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79], [c_customer_sk#66, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#67, 16)) AS c_customer_id#74, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#68, 20)) AS c_first_name#75, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#69, 30)) AS c_last_name#76, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#70, 1)) AS c_preferred_cust_flag#77, c_birth_country#71, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#72, 13)) AS c_login#78, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#73, 50)) AS c_email_address#79]

(41) CometColumnarToRow [codegen id : 10]
Input [8]: [c_customer_sk#66, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79]

(42) Scan parquet spark_catalog.default.catalog_sales
Output [6]: [cs_bill_customer_sk#80, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#85), dynamicpruningexpression(cs_sold_date_sk#85 IN dynamicpruning#21)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_ext_discount_amt:decimal(7,2),cs_ext_sales_price:decimal(7,2),cs_ext_wholesale_cost:decimal(7,2),cs_ext_list_price:decimal(7,2)>

(43) ColumnarToRow [codegen id : 8]
Input [6]: [cs_bill_customer_sk#80, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]

(44) Filter [codegen id : 8]
Input [6]: [cs_bill_customer_sk#80, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]
Condition : isnotnull(cs_bill_customer_sk#80)

(45) BroadcastExchange
Input [6]: [cs_bill_customer_sk#80, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]
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#66]
Right keys [1]: [cs_bill_customer_sk#80]
Join type: Inner
Join condition: None

(47) Project [codegen id : 10]
Output [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]
Input [14]: [c_customer_sk#66, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, cs_bill_customer_sk#80, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85]

(48) ReusedExchange [Reuses operator id: 124]
Output [2]: [d_date_sk#86, d_year#87]

(49) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [cs_sold_date_sk#85]
Right keys [1]: [d_date_sk#86]
Join type: Inner
Join condition: None

(50) Project [codegen id : 10]
Output [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, d_year#87]
Input [14]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, cs_sold_date_sk#85, d_date_sk#86, d_year#87]

(51) HashAggregate [codegen id : 10]
Input [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, cs_ext_discount_amt#81, cs_ext_sales_price#82, cs_ext_wholesale_cost#83, cs_ext_list_price#84, d_year#87]
Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87]
Functions [1]: [partial_sum(((((cs_ext_list_price#84 - cs_ext_wholesale_cost#83) - cs_ext_discount_amt#81) + cs_ext_sales_price#82) / 2))]
Aggregate Attributes [2]: [sum#88, isEmpty#89]
Results [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87, sum#90, isEmpty#91]

(52) CometColumnarExchange
Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87, sum#90, isEmpty#91]
Arguments: hashpartitioning(c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(53) CometColumnarToRow [codegen id : 11]
Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87, sum#90, isEmpty#91]

(54) HashAggregate [codegen id : 11]
Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87, sum#90, isEmpty#91]
Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#71, c_login#78, c_email_address#79, d_year#87]
Functions [1]: [sum(((((cs_ext_list_price#84 - cs_ext_wholesale_cost#83) - cs_ext_discount_amt#81) + cs_ext_sales_price#82) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#84 - cs_ext_wholesale_cost#83) - cs_ext_discount_amt#81) + cs_ext_sales_price#82) / 2))#92]
Results [2]: [c_customer_id#74 AS customer_id#93, sum(((((cs_ext_list_price#84 - cs_ext_wholesale_cost#83) - cs_ext_discount_amt#81) + cs_ext_sales_price#82) / 2))#92 AS year_total#94]

(55) Filter [codegen id : 11]
Input [2]: [customer_id#93, year_total#94]
Condition : (isnotnull(year_total#94) AND (year_total#94 > 0.000000))

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

(57) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#29]
Right keys [1]: [customer_id#93]
Join type: Inner
Join condition: None

(58) Project [codegen id : 24]
Output [11]: [customer_id#29, year_total#30, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#65, year_total#94]
Input [12]: [customer_id#29, year_total#30, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#65, customer_id#93, year_total#94]

(59) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#95, c_customer_id#96, c_first_name#97, c_last_name#98, c_preferred_cust_flag#99, c_birth_country#100, c_login#101, c_email_address#102]
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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(60) CometFilter
Input [8]: [c_customer_sk#95, c_customer_id#96, c_first_name#97, c_last_name#98, c_preferred_cust_flag#99, c_birth_country#100, c_login#101, c_email_address#102]
Condition : (isnotnull(c_customer_sk#95) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#96, 16))))

(61) CometProject
Input [8]: [c_customer_sk#95, c_customer_id#96, c_first_name#97, c_last_name#98, c_preferred_cust_flag#99, c_birth_country#100, c_login#101, c_email_address#102]
Arguments: [c_customer_sk#95, c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108], [c_customer_sk#95, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#96, 16)) AS c_customer_id#103, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#97, 20)) AS c_first_name#104, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#98, 30)) AS c_last_name#105, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#99, 1)) AS c_preferred_cust_flag#106, c_birth_country#100, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#101, 13)) AS c_login#107, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#102, 50)) AS c_email_address#108]

(62) CometColumnarToRow [codegen id : 14]
Input [8]: [c_customer_sk#95, c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108]

(63) Scan parquet spark_catalog.default.catalog_sales
Output [6]: [cs_bill_customer_sk#109, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#114), dynamicpruningexpression(cs_sold_date_sk#114 IN dynamicpruning#51)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_ext_discount_amt:decimal(7,2),cs_ext_sales_price:decimal(7,2),cs_ext_wholesale_cost:decimal(7,2),cs_ext_list_price:decimal(7,2)>

(64) ColumnarToRow [codegen id : 12]
Input [6]: [cs_bill_customer_sk#109, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]

(65) Filter [codegen id : 12]
Input [6]: [cs_bill_customer_sk#109, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]
Condition : isnotnull(cs_bill_customer_sk#109)

(66) BroadcastExchange
Input [6]: [cs_bill_customer_sk#109, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]
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#95]
Right keys [1]: [cs_bill_customer_sk#109]
Join type: Inner
Join condition: None

(68) Project [codegen id : 14]
Output [12]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]
Input [14]: [c_customer_sk#95, c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, cs_bill_customer_sk#109, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114]

(69) ReusedExchange [Reuses operator id: 128]
Output [2]: [d_date_sk#115, d_year#116]

(70) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [cs_sold_date_sk#114]
Right keys [1]: [d_date_sk#115]
Join type: Inner
Join condition: None

(71) Project [codegen id : 14]
Output [12]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, d_year#116]
Input [14]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, cs_sold_date_sk#114, d_date_sk#115, d_year#116]

(72) HashAggregate [codegen id : 14]
Input [12]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, cs_ext_discount_amt#110, cs_ext_sales_price#111, cs_ext_wholesale_cost#112, cs_ext_list_price#113, d_year#116]
Keys [8]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116]
Functions [1]: [partial_sum(((((cs_ext_list_price#113 - cs_ext_wholesale_cost#112) - cs_ext_discount_amt#110) + cs_ext_sales_price#111) / 2))]
Aggregate Attributes [2]: [sum#117, isEmpty#118]
Results [10]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116, sum#119, isEmpty#120]

(73) CometColumnarExchange
Input [10]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116, sum#119, isEmpty#120]
Arguments: hashpartitioning(c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(74) CometColumnarToRow [codegen id : 15]
Input [10]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116, sum#119, isEmpty#120]

(75) HashAggregate [codegen id : 15]
Input [10]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116, sum#119, isEmpty#120]
Keys [8]: [c_customer_id#103, c_first_name#104, c_last_name#105, c_preferred_cust_flag#106, c_birth_country#100, c_login#107, c_email_address#108, d_year#116]
Functions [1]: [sum(((((cs_ext_list_price#113 - cs_ext_wholesale_cost#112) - cs_ext_discount_amt#110) + cs_ext_sales_price#111) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#113 - cs_ext_wholesale_cost#112) - cs_ext_discount_amt#110) + cs_ext_sales_price#111) / 2))#92]
Results [2]: [c_customer_id#103 AS customer_id#121, sum(((((cs_ext_list_price#113 - cs_ext_wholesale_cost#112) - cs_ext_discount_amt#110) + cs_ext_sales_price#111) / 2))#92 AS year_total#122]

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

(77) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#29]
Right keys [1]: [customer_id#121]
Join type: Inner
Join condition: (CASE WHEN (year_total#94 > 0.000000) THEN (year_total#122 / year_total#94) END > CASE WHEN (year_total#30 > 0.000000) THEN (year_total#65 / year_total#30) END)

(78) Project [codegen id : 24]
Output [10]: [customer_id#29, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#94, year_total#122]
Input [13]: [customer_id#29, year_total#30, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#65, year_total#94, customer_id#121, year_total#122]

(79) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#123, c_customer_id#124, c_first_name#125, c_last_name#126, c_preferred_cust_flag#127, c_birth_country#128, c_login#129, c_email_address#130]
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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(80) CometFilter
Input [8]: [c_customer_sk#123, c_customer_id#124, c_first_name#125, c_last_name#126, c_preferred_cust_flag#127, c_birth_country#128, c_login#129, c_email_address#130]
Condition : (isnotnull(c_customer_sk#123) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#124, 16))))

(81) CometProject
Input [8]: [c_customer_sk#123, c_customer_id#124, c_first_name#125, c_last_name#126, c_preferred_cust_flag#127, c_birth_country#128, c_login#129, c_email_address#130]
Arguments: [c_customer_sk#123, c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136], [c_customer_sk#123, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#124, 16)) AS c_customer_id#131, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#125, 20)) AS c_first_name#132, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#126, 30)) AS c_last_name#133, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#127, 1)) AS c_preferred_cust_flag#134, c_birth_country#128, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#129, 13)) AS c_login#135, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#130, 50)) AS c_email_address#136]

(82) CometColumnarToRow [codegen id : 18]
Input [8]: [c_customer_sk#123, c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136]

(83) Scan parquet spark_catalog.default.web_sales
Output [6]: [ws_bill_customer_sk#137, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#142), dynamicpruningexpression(ws_sold_date_sk#142 IN dynamicpruning#21)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_sales_price:decimal(7,2),ws_ext_wholesale_cost:decimal(7,2),ws_ext_list_price:decimal(7,2)>

(84) ColumnarToRow [codegen id : 16]
Input [6]: [ws_bill_customer_sk#137, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]

(85) Filter [codegen id : 16]
Input [6]: [ws_bill_customer_sk#137, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]
Condition : isnotnull(ws_bill_customer_sk#137)

(86) BroadcastExchange
Input [6]: [ws_bill_customer_sk#137, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=12]

(87) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [c_customer_sk#123]
Right keys [1]: [ws_bill_customer_sk#137]
Join type: Inner
Join condition: None

(88) Project [codegen id : 18]
Output [12]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]
Input [14]: [c_customer_sk#123, c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, ws_bill_customer_sk#137, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142]

(89) ReusedExchange [Reuses operator id: 124]
Output [2]: [d_date_sk#143, d_year#144]

(90) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [ws_sold_date_sk#142]
Right keys [1]: [d_date_sk#143]
Join type: Inner
Join condition: None

(91) Project [codegen id : 18]
Output [12]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, d_year#144]
Input [14]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, ws_sold_date_sk#142, d_date_sk#143, d_year#144]

(92) HashAggregate [codegen id : 18]
Input [12]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, ws_ext_discount_amt#138, ws_ext_sales_price#139, ws_ext_wholesale_cost#140, ws_ext_list_price#141, d_year#144]
Keys [8]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144]
Functions [1]: [partial_sum(((((ws_ext_list_price#141 - ws_ext_wholesale_cost#140) - ws_ext_discount_amt#138) + ws_ext_sales_price#139) / 2))]
Aggregate Attributes [2]: [sum#145, isEmpty#146]
Results [10]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144, sum#147, isEmpty#148]

(93) CometColumnarExchange
Input [10]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144, sum#147, isEmpty#148]
Arguments: hashpartitioning(c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=13]

(94) CometColumnarToRow [codegen id : 19]
Input [10]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144, sum#147, isEmpty#148]

(95) HashAggregate [codegen id : 19]
Input [10]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144, sum#147, isEmpty#148]
Keys [8]: [c_customer_id#131, c_first_name#132, c_last_name#133, c_preferred_cust_flag#134, c_birth_country#128, c_login#135, c_email_address#136, d_year#144]
Functions [1]: [sum(((((ws_ext_list_price#141 - ws_ext_wholesale_cost#140) - ws_ext_discount_amt#138) + ws_ext_sales_price#139) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#141 - ws_ext_wholesale_cost#140) - ws_ext_discount_amt#138) + ws_ext_sales_price#139) / 2))#149]
Results [2]: [c_customer_id#131 AS customer_id#150, sum(((((ws_ext_list_price#141 - ws_ext_wholesale_cost#140) - ws_ext_discount_amt#138) + ws_ext_sales_price#139) / 2))#149 AS year_total#151]

(96) Filter [codegen id : 19]
Input [2]: [customer_id#150, year_total#151]
Condition : (isnotnull(year_total#151) AND (year_total#151 > 0.000000))

(97) BroadcastExchange
Input [2]: [customer_id#150, year_total#151]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=14]

(98) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#29]
Right keys [1]: [customer_id#150]
Join type: Inner
Join condition: None

(99) Project [codegen id : 24]
Output [11]: [customer_id#29, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#94, year_total#122, year_total#151]
Input [12]: [customer_id#29, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#94, year_total#122, customer_id#150, year_total#151]

(100) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#152, c_customer_id#153, c_first_name#154, c_last_name#155, c_preferred_cust_flag#156, c_birth_country#157, c_login#158, c_email_address#159]
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,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(101) CometFilter
Input [8]: [c_customer_sk#152, c_customer_id#153, c_first_name#154, c_last_name#155, c_preferred_cust_flag#156, c_birth_country#157, c_login#158, c_email_address#159]
Condition : (isnotnull(c_customer_sk#152) AND isnotnull(static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#153, 16))))

(102) CometProject
Input [8]: [c_customer_sk#152, c_customer_id#153, c_first_name#154, c_last_name#155, c_preferred_cust_flag#156, c_birth_country#157, c_login#158, c_email_address#159]
Arguments: [c_customer_sk#152, c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165], [c_customer_sk#152, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_customer_id#153, 16)) AS c_customer_id#160, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_first_name#154, 20)) AS c_first_name#161, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_last_name#155, 30)) AS c_last_name#162, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_preferred_cust_flag#156, 1)) AS c_preferred_cust_flag#163, c_birth_country#157, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_login#158, 13)) AS c_login#164, static_invoke(CharVarcharCodegenUtils.readSidePadding(c_email_address#159, 50)) AS c_email_address#165]

(103) CometColumnarToRow [codegen id : 22]
Input [8]: [c_customer_sk#152, c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165]

(104) Scan parquet spark_catalog.default.web_sales
Output [6]: [ws_bill_customer_sk#166, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#171), dynamicpruningexpression(ws_sold_date_sk#171 IN dynamicpruning#51)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_sales_price:decimal(7,2),ws_ext_wholesale_cost:decimal(7,2),ws_ext_list_price:decimal(7,2)>

(105) ColumnarToRow [codegen id : 20]
Input [6]: [ws_bill_customer_sk#166, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]

(106) Filter [codegen id : 20]
Input [6]: [ws_bill_customer_sk#166, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]
Condition : isnotnull(ws_bill_customer_sk#166)

(107) BroadcastExchange
Input [6]: [ws_bill_customer_sk#166, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=15]

(108) BroadcastHashJoin [codegen id : 22]
Left keys [1]: [c_customer_sk#152]
Right keys [1]: [ws_bill_customer_sk#166]
Join type: Inner
Join condition: None

(109) Project [codegen id : 22]
Output [12]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]
Input [14]: [c_customer_sk#152, c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, ws_bill_customer_sk#166, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171]

(110) ReusedExchange [Reuses operator id: 128]
Output [2]: [d_date_sk#172, d_year#173]

(111) BroadcastHashJoin [codegen id : 22]
Left keys [1]: [ws_sold_date_sk#171]
Right keys [1]: [d_date_sk#172]
Join type: Inner
Join condition: None

(112) Project [codegen id : 22]
Output [12]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, d_year#173]
Input [14]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, ws_sold_date_sk#171, d_date_sk#172, d_year#173]

(113) HashAggregate [codegen id : 22]
Input [12]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, ws_ext_discount_amt#167, ws_ext_sales_price#168, ws_ext_wholesale_cost#169, ws_ext_list_price#170, d_year#173]
Keys [8]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173]
Functions [1]: [partial_sum(((((ws_ext_list_price#170 - ws_ext_wholesale_cost#169) - ws_ext_discount_amt#167) + ws_ext_sales_price#168) / 2))]
Aggregate Attributes [2]: [sum#174, isEmpty#175]
Results [10]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173, sum#176, isEmpty#177]

(114) CometColumnarExchange
Input [10]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173, sum#176, isEmpty#177]
Arguments: hashpartitioning(c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=16]

(115) CometColumnarToRow [codegen id : 23]
Input [10]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173, sum#176, isEmpty#177]

(116) HashAggregate [codegen id : 23]
Input [10]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173, sum#176, isEmpty#177]
Keys [8]: [c_customer_id#160, c_first_name#161, c_last_name#162, c_preferred_cust_flag#163, c_birth_country#157, c_login#164, c_email_address#165, d_year#173]
Functions [1]: [sum(((((ws_ext_list_price#170 - ws_ext_wholesale_cost#169) - ws_ext_discount_amt#167) + ws_ext_sales_price#168) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#170 - ws_ext_wholesale_cost#169) - ws_ext_discount_amt#167) + ws_ext_sales_price#168) / 2))#149]
Results [2]: [c_customer_id#160 AS customer_id#178, sum(((((ws_ext_list_price#170 - ws_ext_wholesale_cost#169) - ws_ext_discount_amt#167) + ws_ext_sales_price#168) / 2))#149 AS year_total#179]

(117) BroadcastExchange
Input [2]: [customer_id#178, year_total#179]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=17]

(118) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#29]
Right keys [1]: [customer_id#178]
Join type: Inner
Join condition: (CASE WHEN (year_total#94 > 0.000000) THEN (year_total#122 / year_total#94) END > CASE WHEN (year_total#151 > 0.000000) THEN (year_total#179 / year_total#151) END)

(119) Project [codegen id : 24]
Output [7]: [customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64]
Input [13]: [customer_id#29, customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64, year_total#94, year_total#122, year_total#151, customer_id#178, year_total#179]

(120) TakeOrderedAndProject
Input [7]: [customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64]
Arguments: 100, [customer_id#58 ASC NULLS FIRST, customer_first_name#59 ASC NULLS FIRST, customer_last_name#60 ASC NULLS FIRST, customer_preferred_cust_flag#61 ASC NULLS FIRST, customer_birth_country#62 ASC NULLS FIRST, customer_login#63 ASC NULLS FIRST, customer_email_address#64 ASC NULLS FIRST], [customer_id#58, customer_first_name#59, customer_last_name#60, customer_preferred_cust_flag#61, customer_birth_country#62, customer_login#63, customer_email_address#64]

===== Subqueries =====

Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#20 IN dynamicpruning#21
BroadcastExchange (124)
+- * CometColumnarToRow (123)
   +- CometFilter (122)
      +- CometNativeScan parquet spark_catalog.default.date_dim (121)


(121) CometNativeScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#22, d_year#23]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(122) CometFilter
Input [2]: [d_date_sk#22, d_year#23]
Condition : ((isnotnull(d_year#23) AND (d_year#23 = 2001)) AND isnotnull(d_date_sk#22))

(123) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#22, d_year#23]

(124) BroadcastExchange
Input [2]: [d_date_sk#22, d_year#23]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=18]

Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#50 IN dynamicpruning#51
BroadcastExchange (128)
+- * CometColumnarToRow (127)
   +- CometFilter (126)
      +- CometNativeScan parquet spark_catalog.default.date_dim (125)


(125) CometNativeScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#52, d_year#53]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(126) CometFilter
Input [2]: [d_date_sk#52, d_year#53]
Condition : ((isnotnull(d_year#53) AND (d_year#53 = 2002)) AND isnotnull(d_date_sk#52))

(127) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#52, d_year#53]

(128) BroadcastExchange
Input [2]: [d_date_sk#52, d_year#53]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=19]

Subquery:3 Hosting operator id = 42 Hosting Expression = cs_sold_date_sk#85 IN dynamicpruning#21

Subquery:4 Hosting operator id = 63 Hosting Expression = cs_sold_date_sk#114 IN dynamicpruning#51

Subquery:5 Hosting operator id = 83 Hosting Expression = ws_sold_date_sk#142 IN dynamicpruning#21

Subquery:6 Hosting operator id = 104 Hosting Expression = ws_sold_date_sk#171 IN dynamicpruning#51


