== Physical Plan ==
TakeOrderedAndProject (86)
+- * 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.web_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.web_sales (67)
                           :           +- ReusedExchange (70)
                           +- * Sort (76)
                              +- ReusedExchange (75)


(1) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4]
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_list_price:decimal(7,2)>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(19) HashAggregate [codegen id : 6]
Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum#18]
Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]

(20) Exchange
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]
Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#20]

(21) HashAggregate [codegen id : 7]
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21]
Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23]

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

(23) Exchange
Input [2]: [customer_id#22, year_total#23]
Arguments: hashpartitioning(customer_id#22, 5), true, [id=#24]

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

(25) Scan parquet default.store_sales
Output [4]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_ext_discount_amt#3, ss_ext_list_price#4]
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_list_price:decimal(7,2)>

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

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

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

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

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

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

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

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

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

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

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

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

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

(40) HashAggregate [codegen id : 14]
Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#3, ss_ext_list_price#4, d_year#6]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum#27]
Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28]

(41) Exchange
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28]
Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), true, [id=#29]

(42) HashAggregate [codegen id : 15]
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#28]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30]
Results [5]: [c_customer_id#10 AS customer_id#31, c_first_name#11 AS customer_first_name#32, c_last_name#12 AS customer_last_name#33, c_email_address#16 AS customer_email_address#34, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#4 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#3 as decimal(8,2)))), DecimalType(8,2), true)))#30,18,2) AS year_total#35]

(43) Exchange
Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35]
Arguments: hashpartitioning(customer_id#31, 5), true, [id=#36]

(44) Sort [codegen id : 16]
Input [5]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35]
Arguments: [customer_id#31 ASC NULLS FIRST], false, 0

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

(46) Scan parquet default.web_sales
Output [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]
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_list_price:decimal(7,2)>

(47) ColumnarToRow [codegen id : 19]
Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]

(48) Filter [codegen id : 19]
Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]
Condition : (isnotnull(ws_bill_customer_sk#38) AND isnotnull(ws_sold_date_sk#37))

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

(50) BroadcastHashJoin [codegen id : 19]
Left keys [1]: [ws_sold_date_sk#37]
Right keys [1]: [d_date_sk#5]
Join condition: None

(51) Project [codegen id : 19]
Output [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Input [6]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_date_sk#5, d_year#6]

(52) Exchange
Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Arguments: hashpartitioning(ws_bill_customer_sk#38, 5), true, [id=#41]

(53) Sort [codegen id : 20]
Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0

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

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

(56) SortMergeJoin [codegen id : 23]
Left keys [1]: [ws_bill_customer_sk#38]
Right keys [1]: [c_customer_sk#9]
Join condition: None

(57) Project [codegen id : 23]
Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Input [12]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]

(58) HashAggregate [codegen id : 23]
Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6]
Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum#42]
Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#43]

(59) Exchange
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#43]
Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#44]

(60) HashAggregate [codegen id : 24]
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#43]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6]
Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45]
Results [2]: [c_customer_id#10 AS customer_id#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#45,18,2) AS year_total#47]

(61) Filter [codegen id : 24]
Input [2]: [customer_id#46, year_total#47]
Condition : (isnotnull(year_total#47) AND (year_total#47 > 0.00))

(62) Project [codegen id : 24]
Output [2]: [customer_id#46 AS customer_id#48, year_total#47 AS year_total#49]
Input [2]: [customer_id#46, year_total#47]

(63) Exchange
Input [2]: [customer_id#48, year_total#49]
Arguments: hashpartitioning(customer_id#48, 5), true, [id=#50]

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

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

(66) Project [codegen id : 26]
Output [8]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49]
Input [9]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, customer_id#48, year_total#49]

(67) Scan parquet default.web_sales
Output [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]
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_list_price:decimal(7,2)>

(68) ColumnarToRow [codegen id : 28]
Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]

(69) Filter [codegen id : 28]
Input [4]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40]
Condition : (isnotnull(ws_bill_customer_sk#38) AND isnotnull(ws_sold_date_sk#37))

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

(71) BroadcastHashJoin [codegen id : 28]
Left keys [1]: [ws_sold_date_sk#37]
Right keys [1]: [d_date_sk#5]
Join condition: None

(72) Project [codegen id : 28]
Output [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Input [6]: [ws_sold_date_sk#37, ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_date_sk#5, d_year#6]

(73) Exchange
Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Arguments: hashpartitioning(ws_bill_customer_sk#38, 5), true, [id=#51]

(74) Sort [codegen id : 29]
Input [4]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Arguments: [ws_bill_customer_sk#38 ASC NULLS FIRST], false, 0

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

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

(77) SortMergeJoin [codegen id : 32]
Left keys [1]: [ws_bill_customer_sk#38]
Right keys [1]: [c_customer_sk#9]
Join condition: None

(78) Project [codegen id : 32]
Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Input [12]: [ws_bill_customer_sk#38, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]

(79) HashAggregate [codegen id : 32]
Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ws_ext_discount_amt#39, ws_ext_list_price#40, d_year#6]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6]
Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum#52]
Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#53]

(80) Exchange
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#53]
Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, 5), true, [id=#54]

(81) HashAggregate [codegen id : 33]
Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6, sum#53]
Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, d_year#6]
Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))]
Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55]
Results [2]: [c_customer_id#10 AS customer_id#56, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#39 as decimal(8,2)))), DecimalType(8,2), true)))#55,18,2) AS year_total#57]

(82) Exchange
Input [2]: [customer_id#56, year_total#57]
Arguments: hashpartitioning(customer_id#56, 5), true, [id=#58]

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

(84) SortMergeJoin [codegen id : 35]
Left keys [1]: [customer_id#22]
Right keys [1]: [customer_id#56]
Join condition: (CASE WHEN (year_total#49 > 0.00) THEN CheckOverflow((promote_precision(year_total#57) / promote_precision(year_total#49)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#35) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE 0E-20 END)

(85) Project [codegen id : 35]
Output [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34]
Input [10]: [customer_id#22, year_total#23, customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34, year_total#35, year_total#49, customer_id#56, year_total#57]

(86) TakeOrderedAndProject
Input [4]: [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34]
Arguments: 100, [customer_id#31 ASC NULLS FIRST, customer_first_name#32 ASC NULLS FIRST, customer_last_name#33 ASC NULLS FIRST, customer_email_address#34 ASC NULLS FIRST], [customer_id#31, customer_first_name#32, customer_last_name#33, customer_email_address#34]

