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


(1) Scan parquet default.store_sales
Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)]
ReadSchema: struct<ss_sold_date_sk:int,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)>

(2) ColumnarToRow [codegen id : 2]
Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]

(3) Filter [codegen id : 2]
Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]
Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1))

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

(5) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#7, d_year#8]

(6) Filter [codegen id : 1]
Input [2]: [d_date_sk#7, d_year#8]
Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7))

(7) BroadcastExchange
Input [2]: [d_date_sk#7, d_year#8]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9]

(8) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#7]
Join condition: None

(9) Project [codegen id : 2]
Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8]

(10) Exchange
Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#10]

(11) Sort [codegen id : 3]
Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(12) Scan parquet default.customer
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
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>

(13) ColumnarToRow [codegen id : 4]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(14) Filter [codegen id : 4]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Condition : (isnotnull(c_customer_sk#11) AND isnotnull(c_customer_id#12))

(15) Exchange
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: hashpartitioning(c_customer_sk#11, 5), true, [id=#19]

(16) Sort [codegen id : 5]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(17) SortMergeJoin [codegen id : 6]
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(18) Project [codegen id : 6]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(19) HashAggregate [codegen id : 6]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#20, isEmpty#21]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23]

(20) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#24]

(21) HashAggregate [codegen id : 7]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#22, isEmpty#23]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25]
Results [2]: [c_customer_id#12 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27]

(22) Filter [codegen id : 7]
Input [2]: [customer_id#26, year_total#27]
Condition : (isnotnull(year_total#27) AND (year_total#27 > 0.000000))

(23) Exchange
Input [2]: [customer_id#26, year_total#27]
Arguments: hashpartitioning(customer_id#26, 5), true, [id=#28]

(24) Sort [codegen id : 8]
Input [2]: [customer_id#26, year_total#27]
Arguments: [customer_id#26 ASC NULLS FIRST], false, 0

(25) Scan parquet default.store_sales
Output [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store_sales]
PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk)]
ReadSchema: struct<ss_sold_date_sk:int,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)>

(26) ColumnarToRow [codegen id : 10]
Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]

(27) Filter [codegen id : 10]
Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6]
Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_sold_date_sk#1))

(28) Scan parquet default.date_dim
Output [2]: [d_date_sk#7, d_year#8]
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) ColumnarToRow [codegen id : 9]
Input [2]: [d_date_sk#7, d_year#8]

(30) Filter [codegen id : 9]
Input [2]: [d_date_sk#7, d_year#8]
Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2002)) AND isnotnull(d_date_sk#7))

(31) BroadcastExchange
Input [2]: [d_date_sk#7, d_year#8]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29]

(32) BroadcastHashJoin [codegen id : 10]
Left keys [1]: [ss_sold_date_sk#1]
Right keys [1]: [d_date_sk#7]
Join condition: None

(33) Project [codegen id : 10]
Output [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_date_sk#7, d_year#8]

(34) Exchange
Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Arguments: hashpartitioning(ss_customer_sk#2, 5), true, [id=#30]

(35) Sort [codegen id : 11]
Input [6]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(36) ReusedExchange [Reuses operator id: 15]
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(37) Sort [codegen id : 13]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(38) SortMergeJoin [codegen id : 14]
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(39) Project [codegen id : 14]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Input [14]: [ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(40) HashAggregate [codegen id : 14]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ss_ext_discount_amt#3, ss_ext_sales_price#4, ss_ext_wholesale_cost#5, ss_ext_list_price#6, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#31, isEmpty#32]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34]

(41) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#35]

(42) HashAggregate [codegen id : 15]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#33, isEmpty#34]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36]
Results [8]: [c_customer_id#12 AS customer_id#37, c_first_name#13 AS customer_first_name#38, c_last_name#14 AS customer_last_name#39, c_preferred_cust_flag#15 AS customer_preferred_cust_flag#40, c_birth_country#16 AS customer_birth_country#41, c_login#17 AS customer_login#42, c_email_address#18 AS customer_email_address#43, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#6 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#5 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#4 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#36 AS year_total#44]

(43) Exchange
Input [8]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44]
Arguments: hashpartitioning(customer_id#37, 5), true, [id=#45]

(44) Sort [codegen id : 16]
Input [8]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44]
Arguments: [customer_id#37 ASC NULLS FIRST], false, 0

(45) SortMergeJoin [codegen id : 17]
Left keys [1]: [customer_id#26]
Right keys [1]: [customer_id#37]
Join condition: None

(46) Scan parquet default.catalog_sales
Output [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,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)>

(47) ColumnarToRow [codegen id : 19]
Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]

(48) Filter [codegen id : 19]
Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]
Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46))

(49) ReusedExchange [Reuses operator id: 7]
Output [2]: [d_date_sk#7, d_year#8]

(50) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [cs_sold_date_sk#46]
Right keys [1]: [d_date_sk#7]
Join condition: None

(51) Project [codegen id : 19]
Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8]

(52) Exchange
Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#52]

(53) Sort [codegen id : 20]
Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0

(54) ReusedExchange [Reuses operator id: 15]
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(55) Sort [codegen id : 22]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(56) SortMergeJoin [codegen id : 23]
Left keys [1]: [cs_bill_customer_sk#47]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(57) Project [codegen id : 23]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(58) HashAggregate [codegen id : 23]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#53, isEmpty#54]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56]

(59) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#57]

(60) HashAggregate [codegen id : 24]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#55, isEmpty#56]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58]
Results [2]: [c_customer_id#12 AS customer_id#59, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#58 AS year_total#60]

(61) Filter [codegen id : 24]
Input [2]: [customer_id#59, year_total#60]
Condition : (isnotnull(year_total#60) AND (year_total#60 > 0.000000))

(62) Project [codegen id : 24]
Output [2]: [customer_id#59 AS customer_id#61, year_total#60 AS year_total#62]
Input [2]: [customer_id#59, year_total#60]

(63) Exchange
Input [2]: [customer_id#61, year_total#62]
Arguments: hashpartitioning(customer_id#61, 5), true, [id=#63]

(64) Sort [codegen id : 25]
Input [2]: [customer_id#61, year_total#62]
Arguments: [customer_id#61 ASC NULLS FIRST], false, 0

(65) SortMergeJoin [codegen id : 26]
Left keys [1]: [customer_id#26]
Right keys [1]: [customer_id#61]
Join condition: None

(66) Project [codegen id : 26]
Output [11]: [customer_id#26, year_total#27, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44, year_total#62]
Input [12]: [customer_id#26, year_total#27, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44, customer_id#61, year_total#62]

(67) Scan parquet default.catalog_sales
Output [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,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)>

(68) ColumnarToRow [codegen id : 28]
Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]

(69) Filter [codegen id : 28]
Input [6]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51]
Condition : (isnotnull(cs_bill_customer_sk#47) AND isnotnull(cs_sold_date_sk#46))

(70) ReusedExchange [Reuses operator id: 31]
Output [2]: [d_date_sk#7, d_year#8]

(71) BroadcastHashJoin [codegen id : 28]
Left keys [1]: [cs_sold_date_sk#46]
Right keys [1]: [d_date_sk#7]
Join condition: None

(72) Project [codegen id : 28]
Output [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Input [8]: [cs_sold_date_sk#46, cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_date_sk#7, d_year#8]

(73) Exchange
Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Arguments: hashpartitioning(cs_bill_customer_sk#47, 5), true, [id=#64]

(74) Sort [codegen id : 29]
Input [6]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Arguments: [cs_bill_customer_sk#47 ASC NULLS FIRST], false, 0

(75) ReusedExchange [Reuses operator id: 15]
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(76) Sort [codegen id : 31]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(77) SortMergeJoin [codegen id : 32]
Left keys [1]: [cs_bill_customer_sk#47]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(78) Project [codegen id : 32]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Input [14]: [cs_bill_customer_sk#47, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(79) HashAggregate [codegen id : 32]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, cs_ext_discount_amt#48, cs_ext_sales_price#49, cs_ext_wholesale_cost#50, cs_ext_list_price#51, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#65, isEmpty#66]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68]

(80) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#69]

(81) HashAggregate [codegen id : 33]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#67, isEmpty#68]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70]
Results [2]: [c_customer_id#12 AS customer_id#71, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#51 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#50 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#48 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#49 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#70 AS year_total#72]

(82) Exchange
Input [2]: [customer_id#71, year_total#72]
Arguments: hashpartitioning(customer_id#71, 5), true, [id=#73]

(83) Sort [codegen id : 34]
Input [2]: [customer_id#71, year_total#72]
Arguments: [customer_id#71 ASC NULLS FIRST], false, 0

(84) SortMergeJoin [codegen id : 35]
Left keys [1]: [customer_id#26]
Right keys [1]: [customer_id#71]
Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#27 > 0.000000) THEN CheckOverflow((promote_precision(year_total#44) / promote_precision(year_total#27)), DecimalType(38,14), true) ELSE null END)

(85) Project [codegen id : 35]
Output [10]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72]
Input [13]: [customer_id#26, year_total#27, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#44, year_total#62, customer_id#71, year_total#72]

(86) Scan parquet default.web_sales
Output [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,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)>

(87) ColumnarToRow [codegen id : 37]
Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]

(88) Filter [codegen id : 37]
Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]
Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74))

(89) ReusedExchange [Reuses operator id: 7]
Output [2]: [d_date_sk#7, d_year#8]

(90) BroadcastHashJoin [codegen id : 37]
Left keys [1]: [ws_sold_date_sk#74]
Right keys [1]: [d_date_sk#7]
Join condition: None

(91) Project [codegen id : 37]
Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8]

(92) Exchange
Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#80]

(93) Sort [codegen id : 38]
Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0

(94) ReusedExchange [Reuses operator id: 15]
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(95) Sort [codegen id : 40]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(96) SortMergeJoin [codegen id : 41]
Left keys [1]: [ws_bill_customer_sk#75]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(97) Project [codegen id : 41]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(98) HashAggregate [codegen id : 41]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#81, isEmpty#82]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84]

(99) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#85]

(100) HashAggregate [codegen id : 42]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#83, isEmpty#84]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86]
Results [2]: [c_customer_id#12 AS customer_id#87, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86 AS year_total#88]

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

(102) Project [codegen id : 42]
Output [2]: [customer_id#87 AS customer_id#89, year_total#88 AS year_total#90]
Input [2]: [customer_id#87, year_total#88]

(103) Exchange
Input [2]: [customer_id#89, year_total#90]
Arguments: hashpartitioning(customer_id#89, 5), true, [id=#91]

(104) Sort [codegen id : 43]
Input [2]: [customer_id#89, year_total#90]
Arguments: [customer_id#89 ASC NULLS FIRST], false, 0

(105) SortMergeJoin [codegen id : 44]
Left keys [1]: [customer_id#26]
Right keys [1]: [customer_id#89]
Join condition: None

(106) Project [codegen id : 44]
Output [11]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72, year_total#90]
Input [12]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72, customer_id#89, year_total#90]

(107) Scan parquet default.web_sales
Output [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]
Batched: true
Location [not included in comparison]/{warehouse_dir}/web_sales]
PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,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)>

(108) ColumnarToRow [codegen id : 46]
Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]

(109) Filter [codegen id : 46]
Input [6]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79]
Condition : (isnotnull(ws_bill_customer_sk#75) AND isnotnull(ws_sold_date_sk#74))

(110) ReusedExchange [Reuses operator id: 31]
Output [2]: [d_date_sk#7, d_year#8]

(111) BroadcastHashJoin [codegen id : 46]
Left keys [1]: [ws_sold_date_sk#74]
Right keys [1]: [d_date_sk#7]
Join condition: None

(112) Project [codegen id : 46]
Output [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Input [8]: [ws_sold_date_sk#74, ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_date_sk#7, d_year#8]

(113) Exchange
Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), true, [id=#92]

(114) Sort [codegen id : 47]
Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0

(115) ReusedExchange [Reuses operator id: 15]
Output [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(116) Sort [codegen id : 49]
Input [8]: [c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]
Arguments: [c_customer_sk#11 ASC NULLS FIRST], false, 0

(117) SortMergeJoin [codegen id : 50]
Left keys [1]: [ws_bill_customer_sk#75]
Right keys [1]: [c_customer_sk#11]
Join condition: None

(118) Project [codegen id : 50]
Output [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Input [14]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8, c_customer_sk#11, c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18]

(119) HashAggregate [codegen id : 50]
Input [12]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, ws_ext_discount_amt#76, ws_ext_sales_price#77, ws_ext_wholesale_cost#78, ws_ext_list_price#79, d_year#8]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [2]: [sum#93, isEmpty#94]
Results [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96]

(120) Exchange
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96]
Arguments: hashpartitioning(c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, 5), true, [id=#97]

(121) HashAggregate [codegen id : 51]
Input [10]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8, sum#95, isEmpty#96]
Keys [8]: [c_customer_id#12, c_first_name#13, c_last_name#14, c_preferred_cust_flag#15, c_birth_country#16, c_login#17, c_email_address#18, d_year#8]
Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))]
Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98]
Results [2]: [c_customer_id#12 AS customer_id#99, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#78 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#77 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#98 AS year_total#100]

(122) Exchange
Input [2]: [customer_id#99, year_total#100]
Arguments: hashpartitioning(customer_id#99, 5), true, [id=#101]

(123) Sort [codegen id : 52]
Input [2]: [customer_id#99, year_total#100]
Arguments: [customer_id#99 ASC NULLS FIRST], false, 0

(124) SortMergeJoin [codegen id : 53]
Left keys [1]: [customer_id#26]
Right keys [1]: [customer_id#99]
Join condition: (CASE WHEN (year_total#62 > 0.000000) THEN CheckOverflow((promote_precision(year_total#72) / promote_precision(year_total#62)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#90 > 0.000000) THEN CheckOverflow((promote_precision(year_total#100) / promote_precision(year_total#90)), DecimalType(38,14), true) ELSE null END)

(125) Project [codegen id : 53]
Output [7]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43]
Input [13]: [customer_id#26, customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43, year_total#62, year_total#72, year_total#90, customer_id#99, year_total#100]

(126) TakeOrderedAndProject
Input [7]: [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43]
Arguments: 100, [customer_id#37 ASC NULLS FIRST, customer_first_name#38 ASC NULLS FIRST, customer_last_name#39 ASC NULLS FIRST, customer_preferred_cust_flag#40 ASC NULLS FIRST, customer_birth_country#41 ASC NULLS FIRST, customer_login#42 ASC NULLS FIRST, customer_email_address#43 ASC NULLS FIRST], [customer_id#37, customer_first_name#38, customer_last_name#39, customer_preferred_cust_flag#40, customer_birth_country#41, customer_login#42, customer_email_address#43]

