== 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 [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

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

(3) Filter [codegen id : 2]
Input [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3]
Condition : isnotnull(ss_customer_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), In(d_year, [2001,2002]), 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 d_year#6 IN (2001,2002)) 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#3]
Right keys [1]: [d_date_sk#5]
Join condition: None

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

(10) Exchange
Input [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6]
Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8]

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

(12) Scan parquet default.customer
Output [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]
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>

(13) ColumnarToRow [codegen id : 4]
Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]

(14) Filter [codegen id : 4]
Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]
Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_customer_id#10))

(15) Exchange
Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]
Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#13]

(16) Sort [codegen id : 5]
Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]
Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0

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

(18) Project [codegen id : 6]
Output [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6]
Input [7]: [ss_customer_sk#1, ss_net_paid#2, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12]

(19) HashAggregate [codegen id : 6]
Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6]
Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#2))]
Aggregate Attributes [1]: [sum#14]
Results [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15]

(20) Exchange
Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15]
Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, 5), ENSURE_REQUIREMENTS, [id=#16]

(21) HashAggregate [codegen id : 7]
Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15]
Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6]
Functions [1]: [sum(UnscaledValue(ss_net_paid#2))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#2))#17]
Results [2]: [c_customer_id#10 AS customer_id#18, MakeDecimal(sum(UnscaledValue(ss_net_paid#2))#17,17,2) AS year_total#19]

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

(23) Exchange
Input [2]: [customer_id#18, year_total#19]
Arguments: hashpartitioning(customer_id#18, 5), ENSURE_REQUIREMENTS, [id=#20]

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

(25) Scan parquet default.store_sales
Output [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#23), dynamicpruningexpression(ss_sold_date_sk#23 IN dynamicpruning#24)]
PushedFilters: [IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_customer_sk:int,ss_net_paid:decimal(7,2)>

(26) ColumnarToRow [codegen id : 10]
Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23]

(27) Filter [codegen id : 10]
Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23]
Condition : isnotnull(ss_customer_sk#21)

(28) Scan parquet default.date_dim
Output [2]: [d_date_sk#25, d_year#26]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(29) ColumnarToRow [codegen id : 9]
Input [2]: [d_date_sk#25, d_year#26]

(30) Filter [codegen id : 9]
Input [2]: [d_date_sk#25, d_year#26]
Condition : (((isnotnull(d_year#26) AND (d_year#26 = 2002)) AND d_year#26 IN (2001,2002)) AND isnotnull(d_date_sk#25))

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

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

(33) Project [codegen id : 10]
Output [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26]
Input [5]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23, d_date_sk#25, d_year#26]

(34) Exchange
Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26]
Arguments: hashpartitioning(ss_customer_sk#21, 5), ENSURE_REQUIREMENTS, [id=#28]

(35) Sort [codegen id : 11]
Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26]
Arguments: [ss_customer_sk#21 ASC NULLS FIRST], false, 0

(36) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32]

(37) Sort [codegen id : 13]
Input [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32]
Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0

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

(39) Project [codegen id : 14]
Output [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26]
Input [7]: [ss_customer_sk#21, ss_net_paid#22, d_year#26, c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32]

(40) HashAggregate [codegen id : 14]
Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26]
Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26]
Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))]
Aggregate Attributes [1]: [sum#33]
Results [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34]

(41) Exchange
Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34]
Arguments: hashpartitioning(c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, 5), ENSURE_REQUIREMENTS, [id=#35]

(42) HashAggregate [codegen id : 15]
Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34]
Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26]
Functions [1]: [sum(UnscaledValue(ss_net_paid#22))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#36]
Results [4]: [c_customer_id#30 AS customer_id#37, c_first_name#31 AS customer_first_name#38, c_last_name#32 AS customer_last_name#39, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#36,17,2) AS year_total#40]

(43) Exchange
Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40]
Arguments: hashpartitioning(customer_id#37, 5), ENSURE_REQUIREMENTS, [id=#41]

(44) Sort [codegen id : 16]
Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40]
Arguments: [customer_id#37 ASC NULLS FIRST], false, 0

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

(46) Scan parquet default.web_sales
Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#44), dynamicpruningexpression(ws_sold_date_sk#44 IN dynamicpruning#4)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(47) ColumnarToRow [codegen id : 19]
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]

(48) Filter [codegen id : 19]
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44]
Condition : isnotnull(ws_bill_customer_sk#42)

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

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

(51) Project [codegen id : 19]
Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46]
Input [5]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44, d_date_sk#45, d_year#46]

(52) Exchange
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46]
Arguments: hashpartitioning(ws_bill_customer_sk#42, 5), ENSURE_REQUIREMENTS, [id=#47]

(53) Sort [codegen id : 20]
Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46]
Arguments: [ws_bill_customer_sk#42 ASC NULLS FIRST], false, 0

(54) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51]

(55) Sort [codegen id : 22]
Input [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51]
Arguments: [c_customer_sk#48 ASC NULLS FIRST], false, 0

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

(57) Project [codegen id : 23]
Output [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46]
Input [7]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46, c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51]

(58) HashAggregate [codegen id : 23]
Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46]
Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#43))]
Aggregate Attributes [1]: [sum#52]
Results [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53]

(59) Exchange
Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53]
Arguments: hashpartitioning(c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, 5), ENSURE_REQUIREMENTS, [id=#54]

(60) HashAggregate [codegen id : 24]
Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53]
Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46]
Functions [1]: [sum(UnscaledValue(ws_net_paid#43))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#43))#55]
Results [2]: [c_customer_id#49 AS customer_id#56, MakeDecimal(sum(UnscaledValue(ws_net_paid#43))#55,17,2) AS year_total#57]

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

(62) Project [codegen id : 24]
Output [2]: [customer_id#56 AS customer_id#58, year_total#57 AS year_total#59]
Input [2]: [customer_id#56, year_total#57]

(63) Exchange
Input [2]: [customer_id#58, year_total#59]
Arguments: hashpartitioning(customer_id#58, 5), ENSURE_REQUIREMENTS, [id=#60]

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

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

(66) Project [codegen id : 26]
Output [7]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59]
Input [8]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, customer_id#58, year_total#59]

(67) Scan parquet default.web_sales
Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#63), dynamicpruningexpression(ws_sold_date_sk#63 IN dynamicpruning#24)]
PushedFilters: [IsNotNull(ws_bill_customer_sk)]
ReadSchema: struct<ws_bill_customer_sk:int,ws_net_paid:decimal(7,2)>

(68) ColumnarToRow [codegen id : 28]
Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63]

(69) Filter [codegen id : 28]
Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63]
Condition : isnotnull(ws_bill_customer_sk#61)

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

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

(72) Project [codegen id : 28]
Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65]
Input [5]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63, d_date_sk#64, d_year#65]

(73) Exchange
Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65]
Arguments: hashpartitioning(ws_bill_customer_sk#61, 5), ENSURE_REQUIREMENTS, [id=#66]

(74) Sort [codegen id : 29]
Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65]
Arguments: [ws_bill_customer_sk#61 ASC NULLS FIRST], false, 0

(75) ReusedExchange [Reuses operator id: 15]
Output [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70]

(76) Sort [codegen id : 31]
Input [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70]
Arguments: [c_customer_sk#67 ASC NULLS FIRST], false, 0

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

(78) Project [codegen id : 32]
Output [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65]
Input [7]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65, c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70]

(79) HashAggregate [codegen id : 32]
Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65]
Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65]
Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#62))]
Aggregate Attributes [1]: [sum#71]
Results [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72]

(80) Exchange
Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72]
Arguments: hashpartitioning(c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, 5), ENSURE_REQUIREMENTS, [id=#73]

(81) HashAggregate [codegen id : 33]
Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72]
Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65]
Functions [1]: [sum(UnscaledValue(ws_net_paid#62))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#62))#74]
Results [2]: [c_customer_id#68 AS customer_id#75, MakeDecimal(sum(UnscaledValue(ws_net_paid#62))#74,17,2) AS year_total#76]

(82) Exchange
Input [2]: [customer_id#75, year_total#76]
Arguments: hashpartitioning(customer_id#75, 5), ENSURE_REQUIREMENTS, [id=#77]

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

(84) SortMergeJoin [codegen id : 35]
Left keys [1]: [customer_id#18]
Right keys [1]: [customer_id#75]
Join condition: (CASE WHEN (year_total#59 > 0.00) THEN CheckOverflow((promote_precision(year_total#76) / promote_precision(year_total#59)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#40) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END)

(85) Project [codegen id : 35]
Output [3]: [customer_id#37, customer_first_name#38, customer_last_name#39]
Input [9]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59, customer_id#75, year_total#76]

(86) TakeOrderedAndProject
Input [3]: [customer_id#37, customer_first_name#38, customer_last_name#39]
Arguments: 100, [customer_id#37 ASC NULLS FIRST, customer_id#37 ASC NULLS FIRST, customer_id#37 ASC NULLS FIRST], [customer_id#37, customer_first_name#38, customer_last_name#39]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4
ReusedExchange (87)


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

Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#23 IN dynamicpruning#24
ReusedExchange (88)


(88) ReusedExchange [Reuses operator id: 31]
Output [2]: [d_date_sk#25, d_year#26]

Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#44 IN dynamicpruning#4

Subquery:4 Hosting operator id = 67 Hosting Expression = ws_sold_date_sk#63 IN dynamicpruning#24


