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

(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, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#2, 16, true, false, true) AS c_customer_id#9, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#3, 20, true, false, true) AS c_first_name#10, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#4, 30, true, false, true) AS c_last_name#11, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#5, 1, true, false, true) AS c_preferred_cust_flag#12, c_birth_country#6, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#7, 13, true, false, true) AS c_login#13, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#8, 50, true, false, true) 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(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#32, 16, true, false, true)))

(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#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14], [c_customer_sk#31, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#32, 16, true, false, true) AS c_customer_id#9, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#33, 20, true, false, true) AS c_first_name#10, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#34, 30, true, false, true) AS c_last_name#11, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#35, 1, true, false, true) AS c_preferred_cust_flag#12, c_birth_country#36, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#37, 13, true, false, true) AS c_login#13, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#38, 50, true, false, true) AS c_email_address#14]

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

(23) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_customer_sk#39, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#44), dynamicpruningexpression(ss_sold_date_sk#44 IN dynamicpruning#45)]
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#39, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]

(25) Filter [codegen id : 4]
Input [6]: [ss_customer_sk#39, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Condition : isnotnull(ss_customer_sk#39)

(26) BroadcastExchange
Input [6]: [ss_customer_sk#39, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]
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#39]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Input [14]: [c_customer_sk#31, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, ss_customer_sk#39, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44]

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

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

(31) Project [codegen id : 6]
Output [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, d_year#47]
Input [14]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, ss_sold_date_sk#44, d_date_sk#46, d_year#47]

(32) HashAggregate [codegen id : 6]
Input [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, ss_ext_discount_amt#40, ss_ext_sales_price#41, ss_ext_wholesale_cost#42, ss_ext_list_price#43, d_year#47]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47]
Functions [1]: [partial_sum(((((ss_ext_list_price#43 - ss_ext_wholesale_cost#42) - ss_ext_discount_amt#40) + ss_ext_sales_price#41) / 2))]
Aggregate Attributes [2]: [sum#48, isEmpty#49]
Results [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47, sum#50, isEmpty#51]

(33) CometColumnarExchange
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47, sum#50, isEmpty#51]
Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(34) CometColumnarToRow [codegen id : 7]
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47, sum#50, isEmpty#51]

(35) HashAggregate [codegen id : 7]
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47, sum#50, isEmpty#51]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#36, c_login#13, c_email_address#14, d_year#47]
Functions [1]: [sum(((((ss_ext_list_price#43 - ss_ext_wholesale_cost#42) - ss_ext_discount_amt#40) + ss_ext_sales_price#41) / 2))]
Aggregate Attributes [1]: [sum(((((ss_ext_list_price#43 - ss_ext_wholesale_cost#42) - ss_ext_discount_amt#40) + ss_ext_sales_price#41) / 2))#28]
Results [8]: [c_customer_id#9 AS customer_id#52, c_first_name#10 AS customer_first_name#53, c_last_name#11 AS customer_last_name#54, c_preferred_cust_flag#12 AS customer_preferred_cust_flag#55, c_birth_country#36 AS customer_birth_country#56, c_login#13 AS customer_login#57, c_email_address#14 AS customer_email_address#58, sum(((((ss_ext_list_price#43 - ss_ext_wholesale_cost#42) - ss_ext_discount_amt#40) + ss_ext_sales_price#41) / 2))#28 AS year_total#59]

(36) BroadcastExchange
Input [8]: [customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#59]
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#52]
Join type: Inner
Join condition: None

(38) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67]
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#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67]
Condition : (isnotnull(c_customer_sk#60) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#61, 16, true, false, true)))

(40) CometProject
Input [8]: [c_customer_sk#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67]
Arguments: [c_customer_sk#60, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73], [c_customer_sk#60, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#61, 16, true, false, true) AS c_customer_id#68, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#62, 20, true, false, true) AS c_first_name#69, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#63, 30, true, false, true) AS c_last_name#70, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#64, 1, true, false, true) AS c_preferred_cust_flag#71, c_birth_country#65, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#66, 13, true, false, true) AS c_login#72, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#67, 50, true, false, true) AS c_email_address#73]

(41) CometColumnarToRow [codegen id : 10]
Input [8]: [c_customer_sk#60, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73]

(42) Scan parquet spark_catalog.default.catalog_sales
Output [6]: [cs_bill_customer_sk#74, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#79), dynamicpruningexpression(cs_sold_date_sk#79 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#74, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]

(44) Filter [codegen id : 8]
Input [6]: [cs_bill_customer_sk#74, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]
Condition : isnotnull(cs_bill_customer_sk#74)

(45) BroadcastExchange
Input [6]: [cs_bill_customer_sk#74, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]
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#60]
Right keys [1]: [cs_bill_customer_sk#74]
Join type: Inner
Join condition: None

(47) Project [codegen id : 10]
Output [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]
Input [14]: [c_customer_sk#60, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, cs_bill_customer_sk#74, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79]

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

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

(50) Project [codegen id : 10]
Output [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, d_year#81]
Input [14]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, cs_sold_date_sk#79, d_date_sk#80, d_year#81]

(51) HashAggregate [codegen id : 10]
Input [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, cs_ext_discount_amt#75, cs_ext_sales_price#76, cs_ext_wholesale_cost#77, cs_ext_list_price#78, d_year#81]
Keys [8]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81]
Functions [1]: [partial_sum(((((cs_ext_list_price#78 - cs_ext_wholesale_cost#77) - cs_ext_discount_amt#75) + cs_ext_sales_price#76) / 2))]
Aggregate Attributes [2]: [sum#82, isEmpty#83]
Results [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81, sum#84, isEmpty#85]

(52) CometColumnarExchange
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81, sum#84, isEmpty#85]
Arguments: hashpartitioning(c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(53) CometColumnarToRow [codegen id : 11]
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81, sum#84, isEmpty#85]

(54) HashAggregate [codegen id : 11]
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81, sum#84, isEmpty#85]
Keys [8]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#65, c_login#72, c_email_address#73, d_year#81]
Functions [1]: [sum(((((cs_ext_list_price#78 - cs_ext_wholesale_cost#77) - cs_ext_discount_amt#75) + cs_ext_sales_price#76) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#78 - cs_ext_wholesale_cost#77) - cs_ext_discount_amt#75) + cs_ext_sales_price#76) / 2))#86]
Results [2]: [c_customer_id#68 AS customer_id#87, sum(((((cs_ext_list_price#78 - cs_ext_wholesale_cost#77) - cs_ext_discount_amt#75) + cs_ext_sales_price#76) / 2))#86 AS year_total#88]

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

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

(58) Project [codegen id : 24]
Output [11]: [customer_id#29, year_total#30, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#59, year_total#88]
Input [12]: [customer_id#29, year_total#30, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#59, customer_id#87, year_total#88]

(59) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#89, c_customer_id#90, c_first_name#91, c_last_name#92, c_preferred_cust_flag#93, c_birth_country#94, c_login#95, c_email_address#96]
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#89, c_customer_id#90, c_first_name#91, c_last_name#92, c_preferred_cust_flag#93, c_birth_country#94, c_login#95, c_email_address#96]
Condition : (isnotnull(c_customer_sk#89) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#90, 16, true, false, true)))

(61) CometProject
Input [8]: [c_customer_sk#89, c_customer_id#90, c_first_name#91, c_last_name#92, c_preferred_cust_flag#93, c_birth_country#94, c_login#95, c_email_address#96]
Arguments: [c_customer_sk#89, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73], [c_customer_sk#89, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#90, 16, true, false, true) AS c_customer_id#68, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#91, 20, true, false, true) AS c_first_name#69, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#92, 30, true, false, true) AS c_last_name#70, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#93, 1, true, false, true) AS c_preferred_cust_flag#71, c_birth_country#94, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#95, 13, true, false, true) AS c_login#72, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#96, 50, true, false, true) AS c_email_address#73]

(62) CometColumnarToRow [codegen id : 14]
Input [8]: [c_customer_sk#89, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73]

(63) Scan parquet spark_catalog.default.catalog_sales
Output [6]: [cs_bill_customer_sk#97, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#102), dynamicpruningexpression(cs_sold_date_sk#102 IN dynamicpruning#45)]
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#97, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]

(65) Filter [codegen id : 12]
Input [6]: [cs_bill_customer_sk#97, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]
Condition : isnotnull(cs_bill_customer_sk#97)

(66) BroadcastExchange
Input [6]: [cs_bill_customer_sk#97, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]
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#89]
Right keys [1]: [cs_bill_customer_sk#97]
Join type: Inner
Join condition: None

(68) Project [codegen id : 14]
Output [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]
Input [14]: [c_customer_sk#89, c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, cs_bill_customer_sk#97, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102]

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

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

(71) Project [codegen id : 14]
Output [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, d_year#104]
Input [14]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, cs_sold_date_sk#102, d_date_sk#103, d_year#104]

(72) HashAggregate [codegen id : 14]
Input [12]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, cs_ext_discount_amt#98, cs_ext_sales_price#99, cs_ext_wholesale_cost#100, cs_ext_list_price#101, d_year#104]
Keys [8]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104]
Functions [1]: [partial_sum(((((cs_ext_list_price#101 - cs_ext_wholesale_cost#100) - cs_ext_discount_amt#98) + cs_ext_sales_price#99) / 2))]
Aggregate Attributes [2]: [sum#105, isEmpty#106]
Results [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104, sum#107, isEmpty#108]

(73) CometColumnarExchange
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104, sum#107, isEmpty#108]
Arguments: hashpartitioning(c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(74) CometColumnarToRow [codegen id : 15]
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104, sum#107, isEmpty#108]

(75) HashAggregate [codegen id : 15]
Input [10]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104, sum#107, isEmpty#108]
Keys [8]: [c_customer_id#68, c_first_name#69, c_last_name#70, c_preferred_cust_flag#71, c_birth_country#94, c_login#72, c_email_address#73, d_year#104]
Functions [1]: [sum(((((cs_ext_list_price#101 - cs_ext_wholesale_cost#100) - cs_ext_discount_amt#98) + cs_ext_sales_price#99) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#101 - cs_ext_wholesale_cost#100) - cs_ext_discount_amt#98) + cs_ext_sales_price#99) / 2))#86]
Results [2]: [c_customer_id#68 AS customer_id#109, sum(((((cs_ext_list_price#101 - cs_ext_wholesale_cost#100) - cs_ext_discount_amt#98) + cs_ext_sales_price#99) / 2))#86 AS year_total#110]

(76) BroadcastExchange
Input [2]: [customer_id#109, year_total#110]
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#109]
Join type: Inner
Join condition: (CASE WHEN (year_total#88 > 0.000000) THEN (year_total#110 / year_total#88) END > CASE WHEN (year_total#30 > 0.000000) THEN (year_total#59 / year_total#30) END)

(78) Project [codegen id : 24]
Output [10]: [customer_id#29, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#88, year_total#110]
Input [13]: [customer_id#29, year_total#30, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#59, year_total#88, customer_id#109, year_total#110]

(79) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#111, c_customer_id#112, c_first_name#113, c_last_name#114, c_preferred_cust_flag#115, c_birth_country#116, c_login#117, c_email_address#118]
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#111, c_customer_id#112, c_first_name#113, c_last_name#114, c_preferred_cust_flag#115, c_birth_country#116, c_login#117, c_email_address#118]
Condition : (isnotnull(c_customer_sk#111) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#112, 16, true, false, true)))

(81) CometProject
Input [8]: [c_customer_sk#111, c_customer_id#112, c_first_name#113, c_last_name#114, c_preferred_cust_flag#115, c_birth_country#116, c_login#117, c_email_address#118]
Arguments: [c_customer_sk#111, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124], [c_customer_sk#111, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#112, 16, true, false, true) AS c_customer_id#119, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#113, 20, true, false, true) AS c_first_name#120, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#114, 30, true, false, true) AS c_last_name#121, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#115, 1, true, false, true) AS c_preferred_cust_flag#122, c_birth_country#116, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#117, 13, true, false, true) AS c_login#123, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#118, 50, true, false, true) AS c_email_address#124]

(82) CometColumnarToRow [codegen id : 18]
Input [8]: [c_customer_sk#111, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124]

(83) Scan parquet spark_catalog.default.web_sales
Output [6]: [ws_bill_customer_sk#125, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#130), dynamicpruningexpression(ws_sold_date_sk#130 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#125, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]

(85) Filter [codegen id : 16]
Input [6]: [ws_bill_customer_sk#125, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]
Condition : isnotnull(ws_bill_customer_sk#125)

(86) BroadcastExchange
Input [6]: [ws_bill_customer_sk#125, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]
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#111]
Right keys [1]: [ws_bill_customer_sk#125]
Join type: Inner
Join condition: None

(88) Project [codegen id : 18]
Output [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]
Input [14]: [c_customer_sk#111, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, ws_bill_customer_sk#125, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130]

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

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

(91) Project [codegen id : 18]
Output [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, d_year#132]
Input [14]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, ws_sold_date_sk#130, d_date_sk#131, d_year#132]

(92) HashAggregate [codegen id : 18]
Input [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, ws_ext_discount_amt#126, ws_ext_sales_price#127, ws_ext_wholesale_cost#128, ws_ext_list_price#129, d_year#132]
Keys [8]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132]
Functions [1]: [partial_sum(((((ws_ext_list_price#129 - ws_ext_wholesale_cost#128) - ws_ext_discount_amt#126) + ws_ext_sales_price#127) / 2))]
Aggregate Attributes [2]: [sum#133, isEmpty#134]
Results [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132, sum#135, isEmpty#136]

(93) CometColumnarExchange
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132, sum#135, isEmpty#136]
Arguments: hashpartitioning(c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=13]

(94) CometColumnarToRow [codegen id : 19]
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132, sum#135, isEmpty#136]

(95) HashAggregate [codegen id : 19]
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132, sum#135, isEmpty#136]
Keys [8]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#116, c_login#123, c_email_address#124, d_year#132]
Functions [1]: [sum(((((ws_ext_list_price#129 - ws_ext_wholesale_cost#128) - ws_ext_discount_amt#126) + ws_ext_sales_price#127) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#129 - ws_ext_wholesale_cost#128) - ws_ext_discount_amt#126) + ws_ext_sales_price#127) / 2))#137]
Results [2]: [c_customer_id#119 AS customer_id#138, sum(((((ws_ext_list_price#129 - ws_ext_wholesale_cost#128) - ws_ext_discount_amt#126) + ws_ext_sales_price#127) / 2))#137 AS year_total#139]

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

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

(99) Project [codegen id : 24]
Output [11]: [customer_id#29, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#88, year_total#110, year_total#139]
Input [12]: [customer_id#29, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#88, year_total#110, customer_id#138, year_total#139]

(100) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#140, c_customer_id#141, c_first_name#142, c_last_name#143, c_preferred_cust_flag#144, c_birth_country#145, c_login#146, c_email_address#147]
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#140, c_customer_id#141, c_first_name#142, c_last_name#143, c_preferred_cust_flag#144, c_birth_country#145, c_login#146, c_email_address#147]
Condition : (isnotnull(c_customer_sk#140) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#141, 16, true, false, true)))

(102) CometProject
Input [8]: [c_customer_sk#140, c_customer_id#141, c_first_name#142, c_last_name#143, c_preferred_cust_flag#144, c_birth_country#145, c_login#146, c_email_address#147]
Arguments: [c_customer_sk#140, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124], [c_customer_sk#140, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#141, 16, true, false, true) AS c_customer_id#119, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#142, 20, true, false, true) AS c_first_name#120, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#143, 30, true, false, true) AS c_last_name#121, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#144, 1, true, false, true) AS c_preferred_cust_flag#122, c_birth_country#145, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#146, 13, true, false, true) AS c_login#123, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#147, 50, true, false, true) AS c_email_address#124]

(103) CometColumnarToRow [codegen id : 22]
Input [8]: [c_customer_sk#140, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124]

(104) Scan parquet spark_catalog.default.web_sales
Output [6]: [ws_bill_customer_sk#148, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#153), dynamicpruningexpression(ws_sold_date_sk#153 IN dynamicpruning#45)]
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#148, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]

(106) Filter [codegen id : 20]
Input [6]: [ws_bill_customer_sk#148, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]
Condition : isnotnull(ws_bill_customer_sk#148)

(107) BroadcastExchange
Input [6]: [ws_bill_customer_sk#148, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]
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#140]
Right keys [1]: [ws_bill_customer_sk#148]
Join type: Inner
Join condition: None

(109) Project [codegen id : 22]
Output [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]
Input [14]: [c_customer_sk#140, c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, ws_bill_customer_sk#148, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153]

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

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

(112) Project [codegen id : 22]
Output [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, d_year#155]
Input [14]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, ws_sold_date_sk#153, d_date_sk#154, d_year#155]

(113) HashAggregate [codegen id : 22]
Input [12]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, ws_ext_discount_amt#149, ws_ext_sales_price#150, ws_ext_wholesale_cost#151, ws_ext_list_price#152, d_year#155]
Keys [8]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155]
Functions [1]: [partial_sum(((((ws_ext_list_price#152 - ws_ext_wholesale_cost#151) - ws_ext_discount_amt#149) + ws_ext_sales_price#150) / 2))]
Aggregate Attributes [2]: [sum#156, isEmpty#157]
Results [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155, sum#158, isEmpty#159]

(114) CometColumnarExchange
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155, sum#158, isEmpty#159]
Arguments: hashpartitioning(c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=16]

(115) CometColumnarToRow [codegen id : 23]
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155, sum#158, isEmpty#159]

(116) HashAggregate [codegen id : 23]
Input [10]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155, sum#158, isEmpty#159]
Keys [8]: [c_customer_id#119, c_first_name#120, c_last_name#121, c_preferred_cust_flag#122, c_birth_country#145, c_login#123, c_email_address#124, d_year#155]
Functions [1]: [sum(((((ws_ext_list_price#152 - ws_ext_wholesale_cost#151) - ws_ext_discount_amt#149) + ws_ext_sales_price#150) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#152 - ws_ext_wholesale_cost#151) - ws_ext_discount_amt#149) + ws_ext_sales_price#150) / 2))#137]
Results [2]: [c_customer_id#119 AS customer_id#160, sum(((((ws_ext_list_price#152 - ws_ext_wholesale_cost#151) - ws_ext_discount_amt#149) + ws_ext_sales_price#150) / 2))#137 AS year_total#161]

(117) BroadcastExchange
Input [2]: [customer_id#160, year_total#161]
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#160]
Join type: Inner
Join condition: (CASE WHEN (year_total#88 > 0.000000) THEN (year_total#110 / year_total#88) END > CASE WHEN (year_total#139 > 0.000000) THEN (year_total#161 / year_total#139) END)

(119) Project [codegen id : 24]
Output [7]: [customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58]
Input [13]: [customer_id#29, customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58, year_total#88, year_total#110, year_total#139, customer_id#160, year_total#161]

(120) TakeOrderedAndProject
Input [7]: [customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58]
Arguments: 100, [customer_id#52 ASC NULLS FIRST, customer_first_name#53 ASC NULLS FIRST, customer_last_name#54 ASC NULLS FIRST, customer_preferred_cust_flag#55 ASC NULLS FIRST, customer_birth_country#56 ASC NULLS FIRST, customer_login#57 ASC NULLS FIRST, customer_email_address#58 ASC NULLS FIRST], [customer_id#52, customer_first_name#53, customer_last_name#54, customer_preferred_cust_flag#55, customer_birth_country#56, customer_login#57, customer_email_address#58]

===== 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#44 IN dynamicpruning#45
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#46, d_year#47]
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#46, d_year#47]
Condition : ((isnotnull(d_year#47) AND (d_year#47 = 2002)) AND isnotnull(d_date_sk#46))

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

(128) BroadcastExchange
Input [2]: [d_date_sk#46, d_year#47]
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#79 IN dynamicpruning#21

Subquery:4 Hosting operator id = 63 Hosting Expression = cs_sold_date_sk#102 IN dynamicpruning#45

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

Subquery:6 Hosting operator id = 104 Hosting Expression = ws_sold_date_sk#153 IN dynamicpruning#45


