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


(1) CometScan 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) CometScan 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)>

(5) CometFilter
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)

(6) CometBroadcastExchange
Input [4]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
Arguments: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]

(7) CometBroadcastHashJoin
Left output [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]
Right output [4]: [ss_customer_sk#15, ss_ext_discount_amt#16, ss_ext_list_price#17, ss_sold_date_sk#18]
Arguments: [c_customer_sk#1], [ss_customer_sk#15], Inner, BuildRight

(8) CometProject
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]
Arguments: [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], [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]

(9) CometScan 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>

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

(11) CometBroadcastExchange
Input [2]: [d_date_sk#20, d_year#21]
Arguments: [d_date_sk#20, d_year#21]

(12) CometBroadcastHashJoin
Left 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]
Right output [2]: [d_date_sk#20, d_year#21]
Arguments: [ss_sold_date_sk#18], [d_date_sk#20], Inner, BuildRight

(13) CometProject
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]
Arguments: [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], [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]

(14) CometColumnarToRow [codegen id : 1]
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]

(15) HashAggregate [codegen id : 1]
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]

(16) 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=1]

(17) CometColumnarToRow [codegen id : 8]
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]

(18) HashAggregate [codegen id : 8]
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]

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

(20) CometScan 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>

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

(22) 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#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40], [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#35, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#29, 20, true, false, true) AS c_first_name#36, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#30, 30, true, false, true) AS c_last_name#37, 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#38, 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#39, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#34, 50, true, false, true) AS c_email_address#40]

(23) CometScan parquet spark_catalog.default.store_sales
Output [4]: [ss_customer_sk#41, ss_ext_discount_amt#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_list_price:decimal(7,2)>

(24) CometFilter
Input [4]: [ss_customer_sk#41, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Condition : isnotnull(ss_customer_sk#41)

(25) CometBroadcastExchange
Input [4]: [ss_customer_sk#41, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Arguments: [ss_customer_sk#41, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]

(26) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#27, c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40]
Right output [4]: [ss_customer_sk#41, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Arguments: [c_customer_sk#27], [ss_customer_sk#41], Inner, BuildRight

(27) CometProject
Input [12]: [c_customer_sk#27, c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_customer_sk#41, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Arguments: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44], [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]

(28) CometScan 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>

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

(30) CometBroadcastExchange
Input [2]: [d_date_sk#46, d_year#47]
Arguments: [d_date_sk#46, d_year#47]

(31) CometBroadcastHashJoin
Left output [10]: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44]
Right output [2]: [d_date_sk#46, d_year#47]
Arguments: [ss_sold_date_sk#44], [d_date_sk#46], Inner, BuildRight

(32) CometProject
Input [12]: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, ss_sold_date_sk#44, d_date_sk#46, d_year#47]
Arguments: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, d_year#47], [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, d_year#47]

(33) CometColumnarToRow [codegen id : 2]
Input [10]: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, d_year#47]

(34) HashAggregate [codegen id : 2]
Input [10]: [c_customer_id#35, c_first_name#36, c_last_name#37, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, ss_ext_discount_amt#42, ss_ext_list_price#43, d_year#47]
Keys [8]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#43 - ss_ext_discount_amt#42)))]
Aggregate Attributes [1]: [sum#48]
Results [9]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, sum#49]

(35) CometColumnarExchange
Input [9]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, sum#49]
Arguments: hashpartitioning(c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=2]

(36) CometColumnarToRow [codegen id : 3]
Input [9]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, sum#49]

(37) HashAggregate [codegen id : 3]
Input [9]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40, sum#49]
Keys [8]: [c_customer_id#35, c_first_name#36, c_last_name#37, d_year#47, c_preferred_cust_flag#38, c_birth_country#32, c_login#39, c_email_address#40]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#43 - ss_ext_discount_amt#42)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#43 - ss_ext_discount_amt#42)))#24]
Results [3]: [c_customer_id#35 AS customer_id#50, c_preferred_cust_flag#38 AS customer_preferred_cust_flag#51, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#43 - ss_ext_discount_amt#42)))#24,18,2) AS year_total#52]

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

(39) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#50]
Join type: Inner
Join condition: None

(40) Project [codegen id : 8]
Output [4]: [customer_id#25, year_total#26, customer_preferred_cust_flag#51, year_total#52]
Input [5]: [customer_id#25, year_total#26, customer_id#50, customer_preferred_cust_flag#51, year_total#52]

(41) CometScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#53, c_customer_id#54, c_first_name#55, c_last_name#56, c_preferred_cust_flag#57, c_birth_country#58, c_login#59, c_email_address#60]
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>

(42) CometFilter
Input [8]: [c_customer_sk#53, c_customer_id#54, c_first_name#55, c_last_name#56, c_preferred_cust_flag#57, c_birth_country#58, c_login#59, c_email_address#60]
Condition : (isnotnull(c_customer_sk#53) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#54, 16, true, false, true)))

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

(44) CometScan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#67, ws_ext_discount_amt#68, ws_ext_list_price#69, ws_sold_date_sk#70]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#70), dynamicpruningexpression(ws_sold_date_sk#70 IN dynamicpruning#71)]
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)>

(45) CometFilter
Input [4]: [ws_bill_customer_sk#67, ws_ext_discount_amt#68, ws_ext_list_price#69, ws_sold_date_sk#70]
Condition : isnotnull(ws_bill_customer_sk#67)

(46) CometBroadcastExchange
Input [4]: [ws_bill_customer_sk#67, ws_ext_discount_amt#68, ws_ext_list_price#69, ws_sold_date_sk#70]
Arguments: [ws_bill_customer_sk#67, ws_ext_discount_amt#68, ws_ext_list_price#69, ws_sold_date_sk#70]

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

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

(49) ReusedExchange [Reuses operator id: 11]
Output [2]: [d_date_sk#72, d_year#73]

(50) CometBroadcastHashJoin
Left output [10]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, ws_ext_discount_amt#68, ws_ext_list_price#69, ws_sold_date_sk#70]
Right output [2]: [d_date_sk#72, d_year#73]
Arguments: [ws_sold_date_sk#70], [d_date_sk#72], Inner, BuildRight

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

(52) CometColumnarToRow [codegen id : 4]
Input [10]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, ws_ext_discount_amt#68, ws_ext_list_price#69, d_year#73]

(53) HashAggregate [codegen id : 4]
Input [10]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, ws_ext_discount_amt#68, ws_ext_list_price#69, d_year#73]
Keys [8]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#69 - ws_ext_discount_amt#68)))]
Aggregate Attributes [1]: [sum#74]
Results [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73, sum#75]

(54) CometColumnarExchange
Input [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73, sum#75]
Arguments: hashpartitioning(c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=4]

(55) CometColumnarToRow [codegen id : 5]
Input [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73, sum#75]

(56) HashAggregate [codegen id : 5]
Input [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73, sum#75]
Keys [8]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#58, c_login#65, c_email_address#66, d_year#73]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#69 - ws_ext_discount_amt#68)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#69 - ws_ext_discount_amt#68)))#76]
Results [2]: [c_customer_id#61 AS customer_id#77, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#69 - ws_ext_discount_amt#68)))#76,18,2) AS year_total#78]

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

(58) BroadcastExchange
Input [2]: [customer_id#77, year_total#78]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]

(59) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#77]
Join type: Inner
Join condition: None

(60) Project [codegen id : 8]
Output [5]: [customer_id#25, year_total#26, customer_preferred_cust_flag#51, year_total#52, year_total#78]
Input [6]: [customer_id#25, year_total#26, customer_preferred_cust_flag#51, year_total#52, customer_id#77, year_total#78]

(61) CometScan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
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>

(62) CometFilter
Input [8]: [c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
Condition : (isnotnull(c_customer_sk#79) AND isnotnull(staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#80, 16, true, false, true)))

(63) CometProject
Input [8]: [c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
Arguments: [c_customer_sk#79, c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92], [c_customer_sk#79, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_customer_id#80, 16, true, false, true) AS c_customer_id#87, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_first_name#81, 20, true, false, true) AS c_first_name#88, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_last_name#82, 30, true, false, true) AS c_last_name#89, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_preferred_cust_flag#83, 1, true, false, true) AS c_preferred_cust_flag#90, c_birth_country#84, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_login#85, 13, true, false, true) AS c_login#91, staticinvoke(class org.apache.spark.sql.catalyst.util.CharVarcharCodegenUtils, StringType, readSidePadding, c_email_address#86, 50, true, false, true) AS c_email_address#92]

(64) CometScan parquet spark_catalog.default.web_sales
Output [4]: [ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#96), dynamicpruningexpression(ws_sold_date_sk#96 IN dynamicpruning#97)]
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) CometFilter
Input [4]: [ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Condition : isnotnull(ws_bill_customer_sk#93)

(66) CometBroadcastExchange
Input [4]: [ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Arguments: [ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]

(67) CometBroadcastHashJoin
Left output [8]: [c_customer_sk#79, c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92]
Right output [4]: [ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Arguments: [c_customer_sk#79], [ws_bill_customer_sk#93], Inner, BuildRight

(68) CometProject
Input [12]: [c_customer_sk#79, c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_bill_customer_sk#93, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Arguments: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96], [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]

(69) ReusedExchange [Reuses operator id: 30]
Output [2]: [d_date_sk#98, d_year#99]

(70) CometBroadcastHashJoin
Left output [10]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96]
Right output [2]: [d_date_sk#98, d_year#99]
Arguments: [ws_sold_date_sk#96], [d_date_sk#98], Inner, BuildRight

(71) CometProject
Input [12]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, ws_sold_date_sk#96, d_date_sk#98, d_year#99]
Arguments: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, d_year#99], [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, d_year#99]

(72) CometColumnarToRow [codegen id : 6]
Input [10]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, d_year#99]

(73) HashAggregate [codegen id : 6]
Input [10]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, ws_ext_discount_amt#94, ws_ext_list_price#95, d_year#99]
Keys [8]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#95 - ws_ext_discount_amt#94)))]
Aggregate Attributes [1]: [sum#100]
Results [9]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99, sum#101]

(74) CometColumnarExchange
Input [9]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99, sum#101]
Arguments: hashpartitioning(c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99, 5), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=6]

(75) CometColumnarToRow [codegen id : 7]
Input [9]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99, sum#101]

(76) HashAggregate [codegen id : 7]
Input [9]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99, sum#101]
Keys [8]: [c_customer_id#87, c_first_name#88, c_last_name#89, c_preferred_cust_flag#90, c_birth_country#84, c_login#91, c_email_address#92, d_year#99]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#95 - ws_ext_discount_amt#94)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#95 - ws_ext_discount_amt#94)))#76]
Results [2]: [c_customer_id#87 AS customer_id#102, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#95 - ws_ext_discount_amt#94)))#76,18,2) AS year_total#103]

(77) BroadcastExchange
Input [2]: [customer_id#102, year_total#103]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=7]

(78) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [customer_id#25]
Right keys [1]: [customer_id#102]
Join type: Inner
Join condition: (CASE WHEN (year_total#78 > 0.00) THEN (year_total#103 / year_total#78) END > CASE WHEN (year_total#26 > 0.00) THEN (year_total#52 / year_total#26) END)

(79) Project [codegen id : 8]
Output [1]: [customer_preferred_cust_flag#51]
Input [7]: [customer_id#25, year_total#26, customer_preferred_cust_flag#51, year_total#52, year_total#78, customer_id#102, year_total#103]

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

===== Subqueries =====

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


(81) CometScan 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=8]

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


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

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

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

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

Subquery:3 Hosting operator id = 44 Hosting Expression = ws_sold_date_sk#70 IN dynamicpruning#19

Subquery:4 Hosting operator id = 64 Hosting Expression = ws_sold_date_sk#96 IN dynamicpruning#45


