== Physical Plan ==
TakeOrderedAndProject (105)
+- * Project (104)
   +- * BroadcastHashJoin Inner BuildRight (103)
      :- * Project (89)
      :  +- * BroadcastHashJoin Inner BuildRight (88)
      :     :- * Project (70)
      :     :  +- * BroadcastHashJoin Inner BuildRight (69)
      :     :     :- * Project (55)
      :     :     :  +- * BroadcastHashJoin Inner BuildRight (54)
      :     :     :     :- * BroadcastHashJoin Inner BuildRight (36)
      :     :     :     :  :- * Filter (19)
      :     :     :     :  :  +- * HashAggregate (18)
      :     :     :     :  :     +- Exchange (17)
      :     :     :     :  :        +- * HashAggregate (16)
      :     :     :     :  :           +- * Project (15)
      :     :     :     :  :              +- * BroadcastHashJoin Inner BuildRight (14)
      :     :     :     :  :                 :- * Project (9)
      :     :     :     :  :                 :  +- * BroadcastHashJoin Inner BuildRight (8)
      :     :     :     :  :                 :     :- * Filter (3)
      :     :     :     :  :                 :     :  +- * ColumnarToRow (2)
      :     :     :     :  :                 :     :     +- Scan parquet spark_catalog.default.customer (1)
      :     :     :     :  :                 :     +- BroadcastExchange (7)
      :     :     :     :  :                 :        +- * Filter (6)
      :     :     :     :  :                 :           +- * ColumnarToRow (5)
      :     :     :     :  :                 :              +- Scan parquet spark_catalog.default.store_sales (4)
      :     :     :     :  :                 +- BroadcastExchange (13)
      :     :     :     :  :                    +- * Filter (12)
      :     :     :     :  :                       +- * ColumnarToRow (11)
      :     :     :     :  :                          +- Scan parquet spark_catalog.default.date_dim (10)
      :     :     :     :  +- BroadcastExchange (35)
      :     :     :     :     +- * HashAggregate (34)
      :     :     :     :        +- Exchange (33)
      :     :     :     :           +- * HashAggregate (32)
      :     :     :     :              +- * Project (31)
      :     :     :     :                 +- * BroadcastHashJoin Inner BuildRight (30)
      :     :     :     :                    :- * Project (25)
      :     :     :     :                    :  +- * BroadcastHashJoin Inner BuildRight (24)
      :     :     :     :                    :     :- * Filter (22)
      :     :     :     :                    :     :  +- * ColumnarToRow (21)
      :     :     :     :                    :     :     +- Scan parquet spark_catalog.default.customer (20)
      :     :     :     :                    :     +- ReusedExchange (23)
      :     :     :     :                    +- BroadcastExchange (29)
      :     :     :     :                       +- * Filter (28)
      :     :     :     :                          +- * ColumnarToRow (27)
      :     :     :     :                             +- Scan parquet spark_catalog.default.date_dim (26)
      :     :     :     +- BroadcastExchange (53)
      :     :     :        +- * Filter (52)
      :     :     :           +- * HashAggregate (51)
      :     :     :              +- Exchange (50)
      :     :     :                 +- * HashAggregate (49)
      :     :     :                    +- * Project (48)
      :     :     :                       +- * BroadcastHashJoin Inner BuildRight (47)
      :     :     :                          :- * Project (45)
      :     :     :                          :  +- * BroadcastHashJoin Inner BuildRight (44)
      :     :     :                          :     :- * Filter (39)
      :     :     :                          :     :  +- * ColumnarToRow (38)
      :     :     :                          :     :     +- Scan parquet spark_catalog.default.customer (37)
      :     :     :                          :     +- BroadcastExchange (43)
      :     :     :                          :        +- * Filter (42)
      :     :     :                          :           +- * ColumnarToRow (41)
      :     :     :                          :              +- Scan parquet spark_catalog.default.catalog_sales (40)
      :     :     :                          +- ReusedExchange (46)
      :     :     +- BroadcastExchange (68)
      :     :        +- * HashAggregate (67)
      :     :           +- Exchange (66)
      :     :              +- * HashAggregate (65)
      :     :                 +- * Project (64)
      :     :                    +- * BroadcastHashJoin Inner BuildRight (63)
      :     :                       :- * Project (61)
      :     :                       :  +- * BroadcastHashJoin Inner BuildRight (60)
      :     :                       :     :- * Filter (58)
      :     :                       :     :  +- * ColumnarToRow (57)
      :     :                       :     :     +- Scan parquet spark_catalog.default.customer (56)
      :     :                       :     +- ReusedExchange (59)
      :     :                       +- ReusedExchange (62)
      :     +- BroadcastExchange (87)
      :        +- * Filter (86)
      :           +- * HashAggregate (85)
      :              +- Exchange (84)
      :                 +- * HashAggregate (83)
      :                    +- * Project (82)
      :                       +- * BroadcastHashJoin Inner BuildRight (81)
      :                          :- * Project (79)
      :                          :  +- * BroadcastHashJoin Inner BuildRight (78)
      :                          :     :- * Filter (73)
      :                          :     :  +- * ColumnarToRow (72)
      :                          :     :     +- Scan parquet spark_catalog.default.customer (71)
      :                          :     +- BroadcastExchange (77)
      :                          :        +- * Filter (76)
      :                          :           +- * ColumnarToRow (75)
      :                          :              +- Scan parquet spark_catalog.default.web_sales (74)
      :                          +- ReusedExchange (80)
      +- BroadcastExchange (102)
         +- * HashAggregate (101)
            +- Exchange (100)
               +- * HashAggregate (99)
                  +- * Project (98)
                     +- * BroadcastHashJoin Inner BuildRight (97)
                        :- * Project (95)
                        :  +- * BroadcastHashJoin Inner BuildRight (94)
                        :     :- * Filter (92)
                        :     :  +- * ColumnarToRow (91)
                        :     :     +- Scan parquet spark_catalog.default.customer (90)
                        :     +- ReusedExchange (93)
                        +- ReusedExchange (96)


(1) Scan 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), IsNotNull(c_customer_id)]
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) ColumnarToRow [codegen id : 3]
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]

(3) Filter [codegen id : 3]
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(c_customer_id#2))

(4) Scan parquet spark_catalog.default.store_sales
Output [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#14)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_sales_price:decimal(7,2),ss_ext_wholesale_cost:decimal(7,2),ss_ext_list_price:decimal(7,2)>

(5) ColumnarToRow [codegen id : 1]
Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]

(6) Filter [codegen id : 1]
Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]
Condition : isnotnull(ss_customer_sk#9)

(7) BroadcastExchange
Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]

(8) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#9]
Join type: Inner
Join condition: None

(9) Project [codegen id : 3]
Output [12]: [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, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]
Input [14]: [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, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14]

(10) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#15, d_year#16]
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>

(11) ColumnarToRow [codegen id : 2]
Input [2]: [d_date_sk#15, d_year#16]

(12) Filter [codegen id : 2]
Input [2]: [d_date_sk#15, d_year#16]
Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2001)) AND isnotnull(d_date_sk#15))

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

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

(15) Project [codegen id : 3]
Output [12]: [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, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, d_year#16]
Input [14]: [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, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14, d_date_sk#15, d_year#16]

(16) HashAggregate [codegen id : 3]
Input [12]: [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, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, d_year#16]
Keys [8]: [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, d_year#16]
Functions [1]: [partial_sum(((((ss_ext_list_price#13 - ss_ext_wholesale_cost#12) - ss_ext_discount_amt#10) + ss_ext_sales_price#11) / 2))]
Aggregate Attributes [2]: [sum#17, isEmpty#18]
Results [10]: [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, d_year#16, sum#19, isEmpty#20]

(17) Exchange
Input [10]: [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, d_year#16, sum#19, isEmpty#20]
Arguments: hashpartitioning(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, d_year#16, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(18) HashAggregate [codegen id : 24]
Input [10]: [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, d_year#16, sum#19, isEmpty#20]
Keys [8]: [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, d_year#16]
Functions [1]: [sum(((((ss_ext_list_price#13 - ss_ext_wholesale_cost#12) - ss_ext_discount_amt#10) + ss_ext_sales_price#11) / 2))]
Aggregate Attributes [1]: [sum(((((ss_ext_list_price#13 - ss_ext_wholesale_cost#12) - ss_ext_discount_amt#10) + ss_ext_sales_price#11) / 2))#21]
Results [2]: [c_customer_id#2 AS customer_id#22, sum(((((ss_ext_list_price#13 - ss_ext_wholesale_cost#12) - ss_ext_discount_amt#10) + ss_ext_sales_price#11) / 2))#21 AS year_total#23]

(19) Filter [codegen id : 24]
Input [2]: [customer_id#22, year_total#23]
Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.000000))

(20) Scan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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) ColumnarToRow [codegen id : 6]
Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31]

(22) Filter [codegen id : 6]
Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31]
Condition : (isnotnull(c_customer_sk#24) AND isnotnull(c_customer_id#25))

(23) ReusedExchange [Reuses operator id: 7]
Output [6]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, ss_sold_date_sk#37]

(24) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [c_customer_sk#24]
Right keys [1]: [ss_customer_sk#32]
Join type: Inner
Join condition: None

(25) Project [codegen id : 6]
Output [12]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, ss_sold_date_sk#37]
Input [14]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, ss_sold_date_sk#37]

(26) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#38, d_year#39]
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>

(27) ColumnarToRow [codegen id : 5]
Input [2]: [d_date_sk#38, d_year#39]

(28) Filter [codegen id : 5]
Input [2]: [d_date_sk#38, d_year#39]
Condition : ((isnotnull(d_year#39) AND (d_year#39 = 2002)) AND isnotnull(d_date_sk#38))

(29) BroadcastExchange
Input [2]: [d_date_sk#38, d_year#39]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

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

(31) Project [codegen id : 6]
Output [12]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, d_year#39]
Input [14]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, ss_sold_date_sk#37, d_date_sk#38, d_year#39]

(32) HashAggregate [codegen id : 6]
Input [12]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_sales_price#34, ss_ext_wholesale_cost#35, ss_ext_list_price#36, d_year#39]
Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39]
Functions [1]: [partial_sum(((((ss_ext_list_price#36 - ss_ext_wholesale_cost#35) - ss_ext_discount_amt#33) + ss_ext_sales_price#34) / 2))]
Aggregate Attributes [2]: [sum#40, isEmpty#41]
Results [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39, sum#42, isEmpty#43]

(33) Exchange
Input [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39, sum#42, isEmpty#43]
Arguments: hashpartitioning(c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(34) HashAggregate [codegen id : 7]
Input [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39, sum#42, isEmpty#43]
Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, d_year#39]
Functions [1]: [sum(((((ss_ext_list_price#36 - ss_ext_wholesale_cost#35) - ss_ext_discount_amt#33) + ss_ext_sales_price#34) / 2))]
Aggregate Attributes [1]: [sum(((((ss_ext_list_price#36 - ss_ext_wholesale_cost#35) - ss_ext_discount_amt#33) + ss_ext_sales_price#34) / 2))#21]
Results [8]: [c_customer_id#25 AS customer_id#44, c_first_name#26 AS customer_first_name#45, c_last_name#27 AS customer_last_name#46, c_preferred_cust_flag#28 AS customer_preferred_cust_flag#47, c_birth_country#29 AS customer_birth_country#48, c_login#30 AS customer_login#49, c_email_address#31 AS customer_email_address#50, sum(((((ss_ext_list_price#36 - ss_ext_wholesale_cost#35) - ss_ext_discount_amt#33) + ss_ext_sales_price#34) / 2))#21 AS year_total#51]

(35) BroadcastExchange
Input [8]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#51]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=6]

(36) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#44]
Join type: Inner
Join condition: None

(37) Scan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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>

(38) ColumnarToRow [codegen id : 10]
Input [8]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59]

(39) Filter [codegen id : 10]
Input [8]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59]
Condition : (isnotnull(c_customer_sk#52) AND isnotnull(c_customer_id#53))

(40) Scan parquet spark_catalog.default.catalog_sales
Output [6]: [cs_bill_customer_sk#60, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#65)]
PushedFilters: [IsNotNull(cs_bill_customer_sk)]
ReadSchema: struct<cs_bill_customer_sk:int,cs_ext_discount_amt:decimal(7,2),cs_ext_sales_price:decimal(7,2),cs_ext_wholesale_cost:decimal(7,2),cs_ext_list_price:decimal(7,2)>

(41) ColumnarToRow [codegen id : 8]
Input [6]: [cs_bill_customer_sk#60, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]

(42) Filter [codegen id : 8]
Input [6]: [cs_bill_customer_sk#60, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]
Condition : isnotnull(cs_bill_customer_sk#60)

(43) BroadcastExchange
Input [6]: [cs_bill_customer_sk#60, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=7]

(44) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [c_customer_sk#52]
Right keys [1]: [cs_bill_customer_sk#60]
Join type: Inner
Join condition: None

(45) Project [codegen id : 10]
Output [12]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]
Input [14]: [c_customer_sk#52, c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, cs_bill_customer_sk#60, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65]

(46) ReusedExchange [Reuses operator id: 13]
Output [2]: [d_date_sk#66, d_year#67]

(47) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [cs_sold_date_sk#65]
Right keys [1]: [d_date_sk#66]
Join type: Inner
Join condition: None

(48) Project [codegen id : 10]
Output [12]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, d_year#67]
Input [14]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, cs_sold_date_sk#65, d_date_sk#66, d_year#67]

(49) HashAggregate [codegen id : 10]
Input [12]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, cs_ext_discount_amt#61, cs_ext_sales_price#62, cs_ext_wholesale_cost#63, cs_ext_list_price#64, d_year#67]
Keys [8]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67]
Functions [1]: [partial_sum(((((cs_ext_list_price#64 - cs_ext_wholesale_cost#63) - cs_ext_discount_amt#61) + cs_ext_sales_price#62) / 2))]
Aggregate Attributes [2]: [sum#68, isEmpty#69]
Results [10]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67, sum#70, isEmpty#71]

(50) Exchange
Input [10]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67, sum#70, isEmpty#71]
Arguments: hashpartitioning(c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(51) HashAggregate [codegen id : 11]
Input [10]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67, sum#70, isEmpty#71]
Keys [8]: [c_customer_id#53, c_first_name#54, c_last_name#55, c_preferred_cust_flag#56, c_birth_country#57, c_login#58, c_email_address#59, d_year#67]
Functions [1]: [sum(((((cs_ext_list_price#64 - cs_ext_wholesale_cost#63) - cs_ext_discount_amt#61) + cs_ext_sales_price#62) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#64 - cs_ext_wholesale_cost#63) - cs_ext_discount_amt#61) + cs_ext_sales_price#62) / 2))#72]
Results [2]: [c_customer_id#53 AS customer_id#73, sum(((((cs_ext_list_price#64 - cs_ext_wholesale_cost#63) - cs_ext_discount_amt#61) + cs_ext_sales_price#62) / 2))#72 AS year_total#74]

(52) Filter [codegen id : 11]
Input [2]: [customer_id#73, year_total#74]
Condition : (isnotnull(year_total#74) AND (year_total#74 > 0.000000))

(53) BroadcastExchange
Input [2]: [customer_id#73, year_total#74]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=9]

(54) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#73]
Join type: Inner
Join condition: None

(55) Project [codegen id : 24]
Output [11]: [customer_id#22, year_total#23, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#51, year_total#74]
Input [12]: [customer_id#22, year_total#23, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#51, customer_id#73, year_total#74]

(56) Scan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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>

(57) ColumnarToRow [codegen id : 14]
Input [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82]

(58) Filter [codegen id : 14]
Input [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82]
Condition : (isnotnull(c_customer_sk#75) AND isnotnull(c_customer_id#76))

(59) ReusedExchange [Reuses operator id: 43]
Output [6]: [cs_bill_customer_sk#83, cs_ext_discount_amt#84, cs_ext_sales_price#85, cs_ext_wholesale_cost#86, cs_ext_list_price#87, cs_sold_date_sk#88]

(60) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [c_customer_sk#75]
Right keys [1]: [cs_bill_customer_sk#83]
Join type: Inner
Join condition: None

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

(62) ReusedExchange [Reuses operator id: 29]
Output [2]: [d_date_sk#89, d_year#90]

(63) BroadcastHashJoin [codegen id : 14]
Left keys [1]: [cs_sold_date_sk#88]
Right keys [1]: [d_date_sk#89]
Join type: Inner
Join condition: None

(64) Project [codegen id : 14]
Output [12]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, cs_ext_discount_amt#84, cs_ext_sales_price#85, cs_ext_wholesale_cost#86, cs_ext_list_price#87, d_year#90]
Input [14]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, cs_ext_discount_amt#84, cs_ext_sales_price#85, cs_ext_wholesale_cost#86, cs_ext_list_price#87, cs_sold_date_sk#88, d_date_sk#89, d_year#90]

(65) HashAggregate [codegen id : 14]
Input [12]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, cs_ext_discount_amt#84, cs_ext_sales_price#85, cs_ext_wholesale_cost#86, cs_ext_list_price#87, d_year#90]
Keys [8]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90]
Functions [1]: [partial_sum(((((cs_ext_list_price#87 - cs_ext_wholesale_cost#86) - cs_ext_discount_amt#84) + cs_ext_sales_price#85) / 2))]
Aggregate Attributes [2]: [sum#91, isEmpty#92]
Results [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90, sum#93, isEmpty#94]

(66) Exchange
Input [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90, sum#93, isEmpty#94]
Arguments: hashpartitioning(c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90, 5), ENSURE_REQUIREMENTS, [plan_id=10]

(67) HashAggregate [codegen id : 15]
Input [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90, sum#93, isEmpty#94]
Keys [8]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#90]
Functions [1]: [sum(((((cs_ext_list_price#87 - cs_ext_wholesale_cost#86) - cs_ext_discount_amt#84) + cs_ext_sales_price#85) / 2))]
Aggregate Attributes [1]: [sum(((((cs_ext_list_price#87 - cs_ext_wholesale_cost#86) - cs_ext_discount_amt#84) + cs_ext_sales_price#85) / 2))#72]
Results [2]: [c_customer_id#76 AS customer_id#95, sum(((((cs_ext_list_price#87 - cs_ext_wholesale_cost#86) - cs_ext_discount_amt#84) + cs_ext_sales_price#85) / 2))#72 AS year_total#96]

(68) BroadcastExchange
Input [2]: [customer_id#95, year_total#96]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=11]

(69) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#95]
Join type: Inner
Join condition: (CASE WHEN (year_total#74 > 0.000000) THEN (year_total#96 / year_total#74) END > CASE WHEN (year_total#23 > 0.000000) THEN (year_total#51 / year_total#23) END)

(70) Project [codegen id : 24]
Output [10]: [customer_id#22, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#74, year_total#96]
Input [13]: [customer_id#22, year_total#23, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#51, year_total#74, customer_id#95, year_total#96]

(71) Scan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#97, c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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>

(72) ColumnarToRow [codegen id : 18]
Input [8]: [c_customer_sk#97, c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104]

(73) Filter [codegen id : 18]
Input [8]: [c_customer_sk#97, c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104]
Condition : (isnotnull(c_customer_sk#97) AND isnotnull(c_customer_id#98))

(74) Scan parquet spark_catalog.default.web_sales
Output [6]: [ws_bill_customer_sk#105, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#110)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_sales_price:decimal(7,2),ws_ext_wholesale_cost:decimal(7,2),ws_ext_list_price:decimal(7,2)>

(75) ColumnarToRow [codegen id : 16]
Input [6]: [ws_bill_customer_sk#105, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]

(76) Filter [codegen id : 16]
Input [6]: [ws_bill_customer_sk#105, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]
Condition : isnotnull(ws_bill_customer_sk#105)

(77) BroadcastExchange
Input [6]: [ws_bill_customer_sk#105, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=12]

(78) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [c_customer_sk#97]
Right keys [1]: [ws_bill_customer_sk#105]
Join type: Inner
Join condition: None

(79) Project [codegen id : 18]
Output [12]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]
Input [14]: [c_customer_sk#97, c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, ws_bill_customer_sk#105, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110]

(80) ReusedExchange [Reuses operator id: 13]
Output [2]: [d_date_sk#111, d_year#112]

(81) BroadcastHashJoin [codegen id : 18]
Left keys [1]: [ws_sold_date_sk#110]
Right keys [1]: [d_date_sk#111]
Join type: Inner
Join condition: None

(82) Project [codegen id : 18]
Output [12]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, d_year#112]
Input [14]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, ws_sold_date_sk#110, d_date_sk#111, d_year#112]

(83) HashAggregate [codegen id : 18]
Input [12]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, ws_ext_discount_amt#106, ws_ext_sales_price#107, ws_ext_wholesale_cost#108, ws_ext_list_price#109, d_year#112]
Keys [8]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112]
Functions [1]: [partial_sum(((((ws_ext_list_price#109 - ws_ext_wholesale_cost#108) - ws_ext_discount_amt#106) + ws_ext_sales_price#107) / 2))]
Aggregate Attributes [2]: [sum#113, isEmpty#114]
Results [10]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112, sum#115, isEmpty#116]

(84) Exchange
Input [10]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112, sum#115, isEmpty#116]
Arguments: hashpartitioning(c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(85) HashAggregate [codegen id : 19]
Input [10]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112, sum#115, isEmpty#116]
Keys [8]: [c_customer_id#98, c_first_name#99, c_last_name#100, c_preferred_cust_flag#101, c_birth_country#102, c_login#103, c_email_address#104, d_year#112]
Functions [1]: [sum(((((ws_ext_list_price#109 - ws_ext_wholesale_cost#108) - ws_ext_discount_amt#106) + ws_ext_sales_price#107) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#109 - ws_ext_wholesale_cost#108) - ws_ext_discount_amt#106) + ws_ext_sales_price#107) / 2))#117]
Results [2]: [c_customer_id#98 AS customer_id#118, sum(((((ws_ext_list_price#109 - ws_ext_wholesale_cost#108) - ws_ext_discount_amt#106) + ws_ext_sales_price#107) / 2))#117 AS year_total#119]

(86) Filter [codegen id : 19]
Input [2]: [customer_id#118, year_total#119]
Condition : (isnotnull(year_total#119) AND (year_total#119 > 0.000000))

(87) BroadcastExchange
Input [2]: [customer_id#118, year_total#119]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=14]

(88) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#118]
Join type: Inner
Join condition: None

(89) Project [codegen id : 24]
Output [11]: [customer_id#22, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#74, year_total#96, year_total#119]
Input [12]: [customer_id#22, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#74, year_total#96, customer_id#118, year_total#119]

(90) Scan parquet spark_catalog.default.customer
Output [8]: [c_customer_sk#120, c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
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>

(91) ColumnarToRow [codegen id : 22]
Input [8]: [c_customer_sk#120, c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127]

(92) Filter [codegen id : 22]
Input [8]: [c_customer_sk#120, c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127]
Condition : (isnotnull(c_customer_sk#120) AND isnotnull(c_customer_id#121))

(93) ReusedExchange [Reuses operator id: 77]
Output [6]: [ws_bill_customer_sk#128, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, ws_sold_date_sk#133]

(94) BroadcastHashJoin [codegen id : 22]
Left keys [1]: [c_customer_sk#120]
Right keys [1]: [ws_bill_customer_sk#128]
Join type: Inner
Join condition: None

(95) Project [codegen id : 22]
Output [12]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, ws_sold_date_sk#133]
Input [14]: [c_customer_sk#120, c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, ws_bill_customer_sk#128, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, ws_sold_date_sk#133]

(96) ReusedExchange [Reuses operator id: 29]
Output [2]: [d_date_sk#134, d_year#135]

(97) BroadcastHashJoin [codegen id : 22]
Left keys [1]: [ws_sold_date_sk#133]
Right keys [1]: [d_date_sk#134]
Join type: Inner
Join condition: None

(98) Project [codegen id : 22]
Output [12]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, d_year#135]
Input [14]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, ws_sold_date_sk#133, d_date_sk#134, d_year#135]

(99) HashAggregate [codegen id : 22]
Input [12]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, ws_ext_discount_amt#129, ws_ext_sales_price#130, ws_ext_wholesale_cost#131, ws_ext_list_price#132, d_year#135]
Keys [8]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135]
Functions [1]: [partial_sum(((((ws_ext_list_price#132 - ws_ext_wholesale_cost#131) - ws_ext_discount_amt#129) + ws_ext_sales_price#130) / 2))]
Aggregate Attributes [2]: [sum#136, isEmpty#137]
Results [10]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135, sum#138, isEmpty#139]

(100) Exchange
Input [10]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135, sum#138, isEmpty#139]
Arguments: hashpartitioning(c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135, 5), ENSURE_REQUIREMENTS, [plan_id=15]

(101) HashAggregate [codegen id : 23]
Input [10]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135, sum#138, isEmpty#139]
Keys [8]: [c_customer_id#121, c_first_name#122, c_last_name#123, c_preferred_cust_flag#124, c_birth_country#125, c_login#126, c_email_address#127, d_year#135]
Functions [1]: [sum(((((ws_ext_list_price#132 - ws_ext_wholesale_cost#131) - ws_ext_discount_amt#129) + ws_ext_sales_price#130) / 2))]
Aggregate Attributes [1]: [sum(((((ws_ext_list_price#132 - ws_ext_wholesale_cost#131) - ws_ext_discount_amt#129) + ws_ext_sales_price#130) / 2))#117]
Results [2]: [c_customer_id#121 AS customer_id#140, sum(((((ws_ext_list_price#132 - ws_ext_wholesale_cost#131) - ws_ext_discount_amt#129) + ws_ext_sales_price#130) / 2))#117 AS year_total#141]

(102) BroadcastExchange
Input [2]: [customer_id#140, year_total#141]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=16]

(103) BroadcastHashJoin [codegen id : 24]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#140]
Join type: Inner
Join condition: (CASE WHEN (year_total#74 > 0.000000) THEN (year_total#96 / year_total#74) END > CASE WHEN (year_total#119 > 0.000000) THEN (year_total#141 / year_total#119) END)

(104) Project [codegen id : 24]
Output [7]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50]
Input [13]: [customer_id#22, customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50, year_total#74, year_total#96, year_total#119, customer_id#140, year_total#141]

(105) TakeOrderedAndProject
Input [7]: [customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50]
Arguments: 100, [customer_id#44 ASC NULLS FIRST, customer_first_name#45 ASC NULLS FIRST, customer_last_name#46 ASC NULLS FIRST, customer_preferred_cust_flag#47 ASC NULLS FIRST, customer_birth_country#48 ASC NULLS FIRST, customer_login#49 ASC NULLS FIRST, customer_email_address#50 ASC NULLS FIRST], [customer_id#44, customer_first_name#45, customer_last_name#46, customer_preferred_cust_flag#47, customer_birth_country#48, customer_login#49, customer_email_address#50]

