== Physical Plan ==
TakeOrderedAndProject (79)
+- * 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.web_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.web_sales (63)
                           +- ReusedExchange (69)


(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: 83]
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: 87]
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 [5]: [c_customer_id#9 AS customer_id#44, c_first_name#10 AS customer_first_name#45, c_last_name#11 AS customer_last_name#46, c_email_address#14 AS customer_email_address#47, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#37 - ss_ext_discount_amt#36)))#24,18,2) AS year_total#48]

(36) BroadcastExchange
Input [5]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47, year_total#48]
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) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56]
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#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56]
Condition : (isnotnull(c_customer_sk#49) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#50, 16, true, false, true)))

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

(41) CometColumnarToRow [codegen id : 10]
Input [8]: [c_customer_sk#49, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62]

(42) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#63, ws_ext_discount_amt#64, ws_ext_list_price#65, ws_sold_date_sk#66]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#66), dynamicpruningexpression(ws_sold_date_sk#66 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)>

(43) ColumnarToRow [codegen id : 8]
Input [4]: [ws_bill_customer_sk#63, ws_ext_discount_amt#64, ws_ext_list_price#65, ws_sold_date_sk#66]

(44) Filter [codegen id : 8]
Input [4]: [ws_bill_customer_sk#63, ws_ext_discount_amt#64, ws_ext_list_price#65, ws_sold_date_sk#66]
Condition : isnotnull(ws_bill_customer_sk#63)

(45) BroadcastExchange
Input [4]: [ws_bill_customer_sk#63, ws_ext_discount_amt#64, ws_ext_list_price#65, ws_sold_date_sk#66]
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#49]
Right keys [1]: [ws_bill_customer_sk#63]
Join type: Inner
Join condition: None

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

(48) ReusedExchange [Reuses operator id: 83]
Output [2]: [d_date_sk#67, d_year#68]

(49) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [ws_sold_date_sk#66]
Right keys [1]: [d_date_sk#67]
Join type: Inner
Join condition: None

(50) Project [codegen id : 10]
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, ws_ext_discount_amt#64, ws_ext_list_price#65, d_year#68]
Input [12]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, ws_ext_discount_amt#64, ws_ext_list_price#65, ws_sold_date_sk#66, d_date_sk#67, d_year#68]

(51) HashAggregate [codegen id : 10]
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, ws_ext_discount_amt#64, ws_ext_list_price#65, d_year#68]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, d_year#68]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#65 - ws_ext_discount_amt#64)))]
Aggregate Attributes [1]: [sum#69]
Results [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, d_year#68, sum#70]

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

(53) CometColumnarToRow [codegen id : 11]
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, d_year#68, sum#70]

(54) HashAggregate [codegen id : 11]
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, d_year#68, sum#70]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#54, c_login#61, c_email_address#62, d_year#68]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#65 - ws_ext_discount_amt#64)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#65 - ws_ext_discount_amt#64)))#71]
Results [2]: [c_customer_id#57 AS customer_id#72, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#65 - ws_ext_discount_amt#64)))#71,18,2) AS year_total#73]

(55) Filter [codegen id : 11]
Input [2]: [customer_id#72, year_total#73]
Condition : (isnotnull(year_total#73) AND (year_total#73 > 0.00))

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

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

(58) Project [codegen id : 16]
Output [8]: [customer_id#25, year_total#26, customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47, year_total#48, year_total#73]
Input [9]: [customer_id#25, year_total#26, customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47, year_total#48, customer_id#72, year_total#73]

(59) CometNativeScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#74, c_customer_id#75, c_first_name#76, c_last_name#77, c_preferred_cust_flag#78, c_birth_country#79, c_login#80, c_email_address#81]
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#74, c_customer_id#75, c_first_name#76, c_last_name#77, c_preferred_cust_flag#78, c_birth_country#79, c_login#80, c_email_address#81]
Condition : (isnotnull(c_customer_sk#74) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#75, 16, true, false, true)))

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

(62) CometColumnarToRow [codegen id : 14]
Input [8]: [c_customer_sk#74, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62]

(63) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#82, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#85), dynamicpruningexpression(ws_sold_date_sk#85 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)>

(64) ColumnarToRow [codegen id : 12]
Input [4]: [ws_bill_customer_sk#82, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]

(65) Filter [codegen id : 12]
Input [4]: [ws_bill_customer_sk#82, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]
Condition : isnotnull(ws_bill_customer_sk#82)

(66) BroadcastExchange
Input [4]: [ws_bill_customer_sk#82, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]
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#74]
Right keys [1]: [ws_bill_customer_sk#82]
Join type: Inner
Join condition: None

(68) Project [codegen id : 14]
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]
Input [12]: [c_customer_sk#74, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, ws_bill_customer_sk#82, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85]

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

(70) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [ws_sold_date_sk#85]
Right keys [1]: [d_date_sk#86]
Join type: Inner
Join condition: None

(71) Project [codegen id : 14]
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, ws_ext_discount_amt#83, ws_ext_list_price#84, d_year#87]
Input [12]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, ws_ext_discount_amt#83, ws_ext_list_price#84, ws_sold_date_sk#85, d_date_sk#86, d_year#87]

(72) HashAggregate [codegen id : 14]
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, ws_ext_discount_amt#83, ws_ext_list_price#84, d_year#87]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#84 - ws_ext_discount_amt#83)))]
Aggregate Attributes [1]: [sum#88]
Results [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87, sum#89]

(73) CometColumnarExchange
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87, sum#89]
Arguments: hashpartitioning(c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=10]

(74) CometColumnarToRow [codegen id : 15]
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87, sum#89]

(75) HashAggregate [codegen id : 15]
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87, sum#89]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#79, c_login#61, c_email_address#62, d_year#87]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#84 - ws_ext_discount_amt#83)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#84 - ws_ext_discount_amt#83)))#71]
Results [2]: [c_customer_id#57 AS customer_id#90, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#84 - ws_ext_discount_amt#83)))#71,18,2) AS year_total#91]

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

(77) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#90]
Join type: Inner
Join condition: (CASE WHEN (year_total#73 > 0.00) THEN (year_total#91 / year_total#73) ELSE 0E-20 END > CASE WHEN (year_total#26 > 0.00) THEN (year_total#48 / year_total#26) ELSE 0E-20 END)

(78) Project [codegen id : 16]
Output [4]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47]
Input [10]: [customer_id#25, year_total#26, customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47, year_total#48, year_total#73, customer_id#90, year_total#91]

(79) TakeOrderedAndProject
Input [4]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47]
Arguments: 100, [customer_id#44 ASC NULLS FIRST, customer_first_name#45 ASC NULLS FIRST, customer_last_name#46 ASC NULLS FIRST, customer_email_address#47 ASC NULLS FIRST], [customer_id#44, customer_first_name#45, customer_last_name#46, customer_email_address#47]

===== Subqueries =====

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


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

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

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

(83) 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 (87)
+- * CometColumnarToRow (86)
   +- CometFilter (85)
      +- CometNativeScan parquet spark_catalog.default.date_dim (84)


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

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

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

(87) 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 = 42 Hosting Expression = ws_sold_date_sk#66 IN dynamicpruning#19

Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#85 IN dynamicpruning#39


