== Physical Plan ==
TakeOrderedAndProject (80)
+- * Project (79)
   +- * BroadcastHashJoin Inner BuildRight (78)
      :- * Project (59)
      :  +- * BroadcastHashJoin Inner BuildRight (58)
      :     :- * Project (38)
      :     :  +- * 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 (57)
      :        +- * Filter (56)
      :           +- * HashAggregate (55)
      :              +- * CometColumnarToRow (54)
      :                 +- CometColumnarExchange (53)
      :                    +- * HashAggregate (52)
      :                       +- * Project (51)
      :                          +- * BroadcastHashJoin Inner BuildRight (50)
      :                             :- * Project (48)
      :                             :  +- * BroadcastHashJoin Inner BuildRight (47)
      :                             :     :- * CometColumnarToRow (42)
      :                             :     :  +- CometProject (41)
      :                             :     :     +- CometFilter (40)
      :                             :     :        +- CometNativeScan parquet spark_catalog.default.customer (39)
      :                             :     +- BroadcastExchange (46)
      :                             :        +- * Filter (45)
      :                             :           +- * ColumnarToRow (44)
      :                             :              +- Scan parquet spark_catalog.default.web_sales (43)
      :                             +- ReusedExchange (49)
      +- BroadcastExchange (77)
         +- * HashAggregate (76)
            +- * CometColumnarToRow (75)
               +- CometColumnarExchange (74)
                  +- * HashAggregate (73)
                     +- * Project (72)
                        +- * BroadcastHashJoin Inner BuildRight (71)
                           :- * Project (69)
                           :  +- * BroadcastHashJoin Inner BuildRight (68)
                           :     :- * CometColumnarToRow (63)
                           :     :  +- CometProject (62)
                           :     :     +- CometFilter (61)
                           :     :        +- CometNativeScan parquet spark_catalog.default.customer (60)
                           :     +- BroadcastExchange (67)
                           :        +- * Filter (66)
                           :           +- * ColumnarToRow (65)
                           :              +- Scan parquet spark_catalog.default.web_sales (64)
                           +- ReusedExchange (70)


(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 [4]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#18), dynamicpruningexpression(ss_sold_date_sk#18 IN dynamicpruning#19)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_list_price:decimal(7,2)>

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

(7) Filter [codegen id : 1]
Input [4]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
Condition : isnotnull(ss_customer_sk#15)

(8) BroadcastExchange
Input [4]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
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 [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, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
Input [12]: [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_list_price#17, ss_sold_date_sk#18]

(11) ReusedExchange [Reuses operator id: 84]
Output [2]: [d_date_sk#20, d_year#21]

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

(13) Project [codegen id : 3]
Output [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, ss_ext_discount_amt#16, ss_ext_list_price#17, d_year#21]
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_list_price#17, ss_sold_date_sk#18, d_date_sk#20, d_year#21]

(14) HashAggregate [codegen id : 3]
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, ss_ext_discount_amt#16, ss_ext_list_price#17, d_year#21]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#21, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#17 - ss_ext_discount_amt#16)))]
Aggregate Attributes [1]: [sum#22]
Results [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#21, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, sum#23]

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

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

(17) HashAggregate [codegen id : 16]
Input [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#21, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14, sum#23]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#21, c_preferred_cust_flag#12, c_birth_country#6, c_login#13, c_email_address#14]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#17 - ss_ext_discount_amt#16)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#17 - ss_ext_discount_amt#16)))#24]
Results [2]: [c_customer_id#9 AS customer_id#25, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#17 - ss_ext_discount_amt#16)))#24,18,2) AS year_total#26]

(18) Filter [codegen id : 16]
Input [2]: [customer_id#25, year_total#26]
Condition : (isnotnull(year_total#26) AND (year_total#26 > 0.00))

(19) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30, c_preferred_cust_flag#31, c_birth_country#32, c_login#33, c_email_address#34]
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#27, c_customer_id#28, c_first_name#29, c_last_name#30, c_preferred_cust_flag#31, c_birth_country#32, c_login#33, c_email_address#34]
Condition : (isnotnull(c_customer_sk#27) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#28, 16, true, false, true)))

(21) CometProject
Input [8]: [c_customer_sk#27, c_customer_id#28, c_first_name#29, c_last_name#30, c_preferred_cust_flag#31, c_birth_country#32, c_login#33, c_email_address#34]
Arguments: [c_customer_sk#27, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14], [c_customer_sk#27, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#28, 16, true, false, true) AS c_customer_id#9, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#29, 20, true, false, true) AS c_first_name#10, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#30, 30, true, false, true) AS c_last_name#11, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#31, 1, true, false, true) AS c_preferred_cust_flag#12, c_birth_country#32, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#33, 13, true, false, true) AS c_login#13, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#34, 50, true, false, true) AS c_email_address#14]

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

(23) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#35, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#38), dynamicpruningexpression(ss_sold_date_sk#38 IN dynamicpruning#39)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_list_price:decimal(7,2)>

(24) ColumnarToRow [codegen id : 4]
Input [4]: [ss_customer_sk#35, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]

(25) Filter [codegen id : 4]
Input [4]: [ss_customer_sk#35, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]
Condition : isnotnull(ss_customer_sk#35)

(26) BroadcastExchange
Input [4]: [ss_customer_sk#35, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]
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#27]
Right keys [1]: [ss_customer_sk#35]
Join type: Inner
Join condition: None

(28) Project [codegen id : 6]
Output [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]
Input [12]: [c_customer_sk#27, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, ss_customer_sk#35, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38]

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

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

(31) Project [codegen id : 6]
Output [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, ss_ext_discount_amt#36, ss_ext_list_price#37, d_year#41]
Input [12]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, ss_ext_discount_amt#36, ss_ext_list_price#37, ss_sold_date_sk#38, d_date_sk#40, d_year#41]

(32) HashAggregate [codegen id : 6]
Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, ss_ext_discount_amt#36, ss_ext_list_price#37, d_year#41]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#41, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#37 - ss_ext_discount_amt#36)))]
Aggregate Attributes [1]: [sum#42]
Results [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#41, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, sum#43]

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

(34) CometColumnarToRow [codegen id : 7]
Input [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#41, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, sum#43]

(35) HashAggregate [codegen id : 7]
Input [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#41, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14, sum#43]
Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#41, c_preferred_cust_flag#12, c_birth_country#32, c_login#13, c_email_address#14]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#37 - ss_ext_discount_amt#36)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#37 - ss_ext_discount_amt#36)))#24]
Results [3]: [c_customer_id#9 AS customer_id#44, c_preferred_cust_flag#12 AS customer_preferred_cust_flag#45, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#37 - ss_ext_discount_amt#36)))#24,18,2) AS year_total#46]

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

(37) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#44]
Join type: Inner
Join condition: None

(38) Project [codegen id : 16]
Output [4]: [customer_id#25, year_total#26, customer_preferred_cust_flag#45, year_total#46]
Input [5]: [customer_id#25, year_total#26, customer_id#44, customer_preferred_cust_flag#45, year_total#46]

(39) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
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>

(40) CometFilter
Input [8]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
Condition : (isnotnull(c_customer_sk#47) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#48, 16, true, false, true)))

(41) CometProject
Input [8]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
Arguments: [c_customer_sk#47, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60], [c_customer_sk#47, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#48, 16, true, false, true) AS c_customer_id#55, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#49, 20, true, false, true) AS c_first_name#56, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#50, 30, true, false, true) AS c_last_name#57, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#51, 1, true, false, true) AS c_preferred_cust_flag#58, c_birth_country#52, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#53, 13, true, false, true) AS c_login#59, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#54, 50, true, false, true) AS c_email_address#60]

(42) CometColumnarToRow [codegen id : 10]
Input [8]: [c_customer_sk#47, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60]

(43) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#61, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#64), dynamicpruningexpression(ws_sold_date_sk#64 IN dynamicpruning#19)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_list_price:decimal(7,2)>

(44) ColumnarToRow [codegen id : 8]
Input [4]: [ws_bill_customer_sk#61, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]

(45) Filter [codegen id : 8]
Input [4]: [ws_bill_customer_sk#61, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]
Condition : isnotnull(ws_bill_customer_sk#61)

(46) BroadcastExchange
Input [4]: [ws_bill_customer_sk#61, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]

(47) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [c_customer_sk#47]
Right keys [1]: [ws_bill_customer_sk#61]
Join type: Inner
Join condition: None

(48) Project [codegen id : 10]
Output [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]
Input [12]: [c_customer_sk#47, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, ws_bill_customer_sk#61, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64]

(49) ReusedExchange [Reuses operator id: 84]
Output [2]: [d_date_sk#65, d_year#66]

(50) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [ws_sold_date_sk#64]
Right keys [1]: [d_date_sk#65]
Join type: Inner
Join condition: None

(51) Project [codegen id : 10]
Output [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, ws_ext_discount_amt#62, ws_ext_list_price#63, d_year#66]
Input [12]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, ws_ext_discount_amt#62, ws_ext_list_price#63, ws_sold_date_sk#64, d_date_sk#65, d_year#66]

(52) HashAggregate [codegen id : 10]
Input [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, ws_ext_discount_amt#62, ws_ext_list_price#63, d_year#66]
Keys [8]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#63 - ws_ext_discount_amt#62)))]
Aggregate Attributes [1]: [sum#67]
Results [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66, sum#68]

(53) CometColumnarExchange
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66, sum#68]
Arguments: hashpartitioning(c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=7]

(54) CometColumnarToRow [codegen id : 11]
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66, sum#68]

(55) HashAggregate [codegen id : 11]
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66, sum#68]
Keys [8]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#52, c_login#59, c_email_address#60, d_year#66]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#63 - ws_ext_discount_amt#62)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#63 - ws_ext_discount_amt#62)))#69]
Results [2]: [c_customer_id#55 AS customer_id#70, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#63 - ws_ext_discount_amt#62)))#69,18,2) AS year_total#71]

(56) Filter [codegen id : 11]
Input [2]: [customer_id#70, year_total#71]
Condition : (isnotnull(year_total#71) AND (year_total#71 > 0.00))

(57) BroadcastExchange
Input [2]: [customer_id#70, year_total#71]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=8]

(58) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#70]
Join type: Inner
Join condition: None

(59) Project [codegen id : 16]
Output [5]: [customer_id#25, year_total#26, customer_preferred_cust_flag#45, year_total#46, year_total#71]
Input [6]: [customer_id#25, year_total#26, customer_preferred_cust_flag#45, year_total#46, customer_id#70, year_total#71]

(60) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#72, c_customer_id#73, c_first_name#74, c_last_name#75, c_preferred_cust_flag#76, c_birth_country#77, c_login#78, c_email_address#79]
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>

(61) CometFilter
Input [8]: [c_customer_sk#72, c_customer_id#73, c_first_name#74, c_last_name#75, c_preferred_cust_flag#76, c_birth_country#77, c_login#78, c_email_address#79]
Condition : (isnotnull(c_customer_sk#72) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#73, 16, true, false, true)))

(62) CometProject
Input [8]: [c_customer_sk#72, c_customer_id#73, c_first_name#74, c_last_name#75, c_preferred_cust_flag#76, c_birth_country#77, c_login#78, c_email_address#79]
Arguments: [c_customer_sk#72, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60], [c_customer_sk#72, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#73, 16, true, false, true) AS c_customer_id#55, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#74, 20, true, false, true) AS c_first_name#56, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#75, 30, true, false, true) AS c_last_name#57, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#76, 1, true, false, true) AS c_preferred_cust_flag#58, c_birth_country#77, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#78, 13, true, false, true) AS c_login#59, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#79, 50, true, false, true) AS c_email_address#60]

(63) CometColumnarToRow [codegen id : 14]
Input [8]: [c_customer_sk#72, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60]

(64) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#80, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#83), dynamicpruningexpression(ws_sold_date_sk#83 IN dynamicpruning#39)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_list_price:decimal(7,2)>

(65) ColumnarToRow [codegen id : 12]
Input [4]: [ws_bill_customer_sk#80, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]

(66) Filter [codegen id : 12]
Input [4]: [ws_bill_customer_sk#80, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]
Condition : isnotnull(ws_bill_customer_sk#80)

(67) BroadcastExchange
Input [4]: [ws_bill_customer_sk#80, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]

(68) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_customer_sk#72]
Right keys [1]: [ws_bill_customer_sk#80]
Join type: Inner
Join condition: None

(69) Project [codegen id : 14]
Output [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]
Input [12]: [c_customer_sk#72, c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, ws_bill_customer_sk#80, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83]

(70) ReusedExchange [Reuses operator id: 88]
Output [2]: [d_date_sk#84, d_year#85]

(71) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_sold_date_sk#83]
Right keys [1]: [d_date_sk#84]
Join type: Inner
Join condition: None

(72) Project [codegen id : 14]
Output [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, ws_ext_discount_amt#81, ws_ext_list_price#82, d_year#85]
Input [12]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, ws_ext_discount_amt#81, ws_ext_list_price#82, ws_sold_date_sk#83, d_date_sk#84, d_year#85]

(73) HashAggregate [codegen id : 14]
Input [10]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, ws_ext_discount_amt#81, ws_ext_list_price#82, d_year#85]
Keys [8]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#82 - ws_ext_discount_amt#81)))]
Aggregate Attributes [1]: [sum#86]
Results [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85, sum#87]

(74) CometColumnarExchange
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85, sum#87]
Arguments: hashpartitioning(c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(75) CometColumnarToRow [codegen id : 15]
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85, sum#87]

(76) HashAggregate [codegen id : 15]
Input [9]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85, sum#87]
Keys [8]: [c_customer_id#55, c_first_name#56, c_last_name#57, c_preferred_cust_flag#58, c_birth_country#77, c_login#59, c_email_address#60, d_year#85]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#82 - ws_ext_discount_amt#81)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#82 - ws_ext_discount_amt#81)))#69]
Results [2]: [c_customer_id#55 AS customer_id#88, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#82 - ws_ext_discount_amt#81)))#69,18,2) AS year_total#89]

(77) BroadcastExchange
Input [2]: [customer_id#88, year_total#89]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=11]

(78) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#88]
Join type: Inner
Join condition: (CASE WHEN (year_total#71 > 0.00) THEN (year_total#89 / year_total#71) END > CASE WHEN (year_total#26 > 0.00) THEN (year_total#46 / year_total#26) END)

(79) Project [codegen id : 16]
Output [1]: [customer_preferred_cust_flag#45]
Input [7]: [customer_id#25, year_total#26, customer_preferred_cust_flag#45, year_total#46, year_total#71, customer_id#88, year_total#89]

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

===== Subqueries =====

Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#18 IN dynamicpruning#19
BroadcastExchange (84)
+- * CometColumnarToRow (83)
   +- CometFilter (82)
      +- CometNativeScan parquet spark_catalog.default.date_dim (81)


(81) CometNativeScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#20, d_year#21]
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>

(82) CometFilter
Input [2]: [d_date_sk#20, d_year#21]
Condition : ((isnotnull(d_year#21) AND (d_year#21 = 2001)) AND isnotnull(d_date_sk#20))

(83) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#20, d_year#21]

(84) BroadcastExchange
Input [2]: [d_date_sk#20, d_year#21]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=12]

Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#38 IN dynamicpruning#39
BroadcastExchange (88)
+- * CometColumnarToRow (87)
   +- CometFilter (86)
      +- CometNativeScan parquet spark_catalog.default.date_dim (85)


(85) CometNativeScan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#40, d_year#41]
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>

(86) CometFilter
Input [2]: [d_date_sk#40, d_year#41]
Condition : ((isnotnull(d_year#41) AND (d_year#41 = 2002)) AND isnotnull(d_date_sk#40))

(87) CometColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#40, d_year#41]

(88) BroadcastExchange
Input [2]: [d_date_sk#40, d_year#41]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=13]

Subquery:3 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#64 IN dynamicpruning#19

Subquery:4 Hosting operator id = 64 Hosting Expression = ws_sold_date_sk#83 IN dynamicpruning#39


