== Physical Plan ==
AdaptiveSparkPlan (255)
+- == Final Plan ==
   NativeTakeOrdered (153)
   +- NativeProject (152)
      +- NativeSortMergeJoin Inner (151)
         :- NativeProject (123)
         :  +- NativeSortMergeJoin Inner (122)
         :     :- NativeProject (78)
         :     :  +- NativeSortMergeJoin Inner (77)
         :     :     :- NativeSort (47)
         :     :     :  +- InputAdapter (46)
         :     :     :     +- AQEShuffleRead (45)
         :     :     :        +- ShuffleQueryStage (44), Statistics(X)
         :     :     :           +- NativeShuffleExchange (43)
         :     :     :              +- NativeFilter (42)
         :     :     :                 +- NativeProject (41)
         :     :     :                    +- NativeHashAggregate (40)
         :     :     :                       +- InputAdapter (39)
         :     :     :                          +- AQEShuffleRead (38)
         :     :     :                             +- ShuffleQueryStage (37), Statistics(X)
         :     :     :                                +- NativeShuffleExchange (36)
         :     :     :                                   +- NativeHashAggregate (35)
         :     :     :                                      +- NativeProject (34)
         :     :     :                                         +- NativeProject (33)
         :     :     :                                            +- NativeSortMergeJoin Inner (32)
         :     :     :                                               :- NativeSort (23)
         :     :     :                                               :  +- InputAdapter (22)
         :     :     :                                               :     +- AQEShuffleRead (21)
         :     :     :                                               :        +- ShuffleQueryStage (20), Statistics(X)
         :     :     :                                               :           +- NativeShuffleExchange (19)
         :     :     :                                               :              +- NativeProject (18)
         :     :     :                                               :                 +- NativeSortMergeJoin Inner (17)
         :     :     :                                               :                    :- NativeSort (8)
         :     :     :                                               :                    :  +- InputAdapter (7)
         :     :     :                                               :                    :     +- AQEShuffleRead (6)
         :     :     :                                               :                    :        +- ShuffleQueryStage (5), Statistics(X)
         :     :     :                                               :                    :           +- NativeShuffleExchange (4)
         :     :     :                                               :                    :              +- NativeFilter (3)
         :     :     :                                               :                    :                 +- InputAdapter (2)
         :     :     :                                               :                    :                    +- NativeParquetScan  (1)
         :     :     :                                               :                    +- NativeSort (16)
         :     :     :                                               :                       +- InputAdapter (15)
         :     :     :                                               :                          +- AQEShuffleRead (14)
         :     :     :                                               :                             +- ShuffleQueryStage (13), Statistics(X)
         :     :     :                                               :                                +- NativeShuffleExchange (12)
         :     :     :                                               :                                   +- NativeFilter (11)
         :     :     :                                               :                                      +- InputAdapter (10)
         :     :     :                                               :                                         +- NativeParquetScan  (9)
         :     :     :                                               +- NativeSort (31)
         :     :     :                                                  +- InputAdapter (30)
         :     :     :                                                     +- AQEShuffleRead (29)
         :     :     :                                                        +- ShuffleQueryStage (28), Statistics(X)
         :     :     :                                                           +- NativeShuffleExchange (27)
         :     :     :                                                              +- NativeFilter (26)
         :     :     :                                                                 +- InputAdapter (25)
         :     :     :                                                                    +- NativeParquetScan  (24)
         :     :     +- NativeSort (76)
         :     :        +- InputAdapter (75)
         :     :           +- AQEShuffleRead (74)
         :     :              +- ShuffleQueryStage (73), Statistics(X)
         :     :                 +- NativeShuffleExchange (72)
         :     :                    +- NativeProject (71)
         :     :                       +- NativeHashAggregate (70)
         :     :                          +- InputAdapter (69)
         :     :                             +- AQEShuffleRead (68)
         :     :                                +- ShuffleQueryStage (67), Statistics(X)
         :     :                                   +- NativeShuffleExchange (66)
         :     :                                      +- NativeHashAggregate (65)
         :     :                                         +- NativeProject (64)
         :     :                                            +- NativeProject (63)
         :     :                                               +- NativeSortMergeJoin Inner (62)
         :     :                                                  :- NativeSort (53)
         :     :                                                  :  +- InputAdapter (52)
         :     :                                                  :     +- InputAdapter (51)
         :     :                                                  :        +- AQEShuffleRead (50)
         :     :                                                  :           +- ShuffleQueryStage (49), Statistics(X)
         :     :                                                  :              +- ReusedExchange (48)
         :     :                                                  +- NativeSort (61)
         :     :                                                     +- InputAdapter (60)
         :     :                                                        +- AQEShuffleRead (59)
         :     :                                                           +- ShuffleQueryStage (58), Statistics(X)
         :     :                                                              +- NativeShuffleExchange (57)
         :     :                                                                 +- NativeFilter (56)
         :     :                                                                    +- InputAdapter (55)
         :     :                                                                       +- NativeParquetScan  (54)
         :     +- NativeSort (121)
         :        +- InputAdapter (120)
         :           +- AQEShuffleRead (119)
         :              +- ShuffleQueryStage (118), Statistics(X)
         :                 +- NativeShuffleExchange (117)
         :                    +- NativeFilter (116)
         :                       +- NativeProject (115)
         :                          +- NativeHashAggregate (114)
         :                             +- InputAdapter (113)
         :                                +- AQEShuffleRead (112)
         :                                   +- ShuffleQueryStage (111), Statistics(X)
         :                                      +- NativeShuffleExchange (110)
         :                                         +- NativeHashAggregate (109)
         :                                            +- NativeProject (108)
         :                                               +- NativeProject (107)
         :                                                  +- NativeSortMergeJoin Inner (106)
         :                                                     :- NativeSort (99)
         :                                                     :  +- InputAdapter (98)
         :                                                     :     +- AQEShuffleRead (97)
         :                                                     :        +- ShuffleQueryStage (96), Statistics(X)
         :                                                     :           +- NativeShuffleExchange (95)
         :                                                     :              +- NativeProject (94)
         :                                                     :                 +- NativeSortMergeJoin Inner (93)
         :                                                     :                    :- NativeSort (84)
         :                                                     :                    :  +- InputAdapter (83)
         :                                                     :                    :     +- InputAdapter (82)
         :                                                     :                    :        +- AQEShuffleRead (81)
         :                                                     :                    :           +- ShuffleQueryStage (80), Statistics(X)
         :                                                     :                    :              +- ReusedExchange (79)
         :                                                     :                    +- NativeSort (92)
         :                                                     :                       +- InputAdapter (91)
         :                                                     :                          +- AQEShuffleRead (90)
         :                                                     :                             +- ShuffleQueryStage (89), Statistics(X)
         :                                                     :                                +- NativeShuffleExchange (88)
         :                                                     :                                   +- NativeFilter (87)
         :                                                     :                                      +- InputAdapter (86)
         :                                                     :                                         +- NativeParquetScan  (85)
         :                                                     +- NativeSort (105)
         :                                                        +- InputAdapter (104)
         :                                                           +- InputAdapter (103)
         :                                                              +- AQEShuffleRead (102)
         :                                                                 +- ShuffleQueryStage (101), Statistics(X)
         :                                                                    +- ReusedExchange (100)
         +- NativeSort (150)
            +- InputAdapter (149)
               +- AQEShuffleRead (148)
                  +- ShuffleQueryStage (147), Statistics(X)
                     +- NativeShuffleExchange (146)
                        +- NativeProject (145)
                           +- NativeHashAggregate (144)
                              +- InputAdapter (143)
                                 +- AQEShuffleRead (142)
                                    +- ShuffleQueryStage (141), Statistics(X)
                                       +- NativeShuffleExchange (140)
                                          +- NativeHashAggregate (139)
                                             +- NativeProject (138)
                                                +- NativeProject (137)
                                                   +- NativeSortMergeJoin Inner (136)
                                                      :- NativeSort (129)
                                                      :  +- InputAdapter (128)
                                                      :     +- InputAdapter (127)
                                                      :        +- AQEShuffleRead (126)
                                                      :           +- ShuffleQueryStage (125), Statistics(X)
                                                      :              +- ReusedExchange (124)
                                                      +- NativeSort (135)
                                                         +- InputAdapter (134)
                                                            +- InputAdapter (133)
                                                               +- AQEShuffleRead (132)
                                                                  +- ShuffleQueryStage (131), Statistics(X)
                                                                     +- ReusedExchange (130)
+- == Initial Plan ==
   TakeOrderedAndProject (254)
   +- Project (253)
      +- SortMergeJoin Inner (252)
         :- Project (228)
         :  +- SortMergeJoin Inner (227)
         :     :- Project (202)
         :     :  +- SortMergeJoin Inner (201)
         :     :     :- Sort (177)
         :     :     :  +- Exchange (176)
         :     :     :     +- Filter (175)
         :     :     :        +- HashAggregate (174)
         :     :     :           +- Exchange (173)
         :     :     :              +- HashAggregate (172)
         :     :     :                 +- Project (171)
         :     :     :                    +- SortMergeJoin Inner (170)
         :     :     :                       :- Sort (165)
         :     :     :                       :  +- Exchange (164)
         :     :     :                       :     +- Project (163)
         :     :     :                       :        +- SortMergeJoin Inner (162)
         :     :     :                       :           :- Sort (157)
         :     :     :                       :           :  +- Exchange (156)
         :     :     :                       :           :     +- Filter (155)
         :     :     :                       :           :        +- Scan parquet (154)
         :     :     :                       :           +- Sort (161)
         :     :     :                       :              +- Exchange (160)
         :     :     :                       :                 +- Filter (159)
         :     :     :                       :                    +- Scan parquet (158)
         :     :     :                       +- Sort (169)
         :     :     :                          +- Exchange (168)
         :     :     :                             +- Filter (167)
         :     :     :                                +- Scan parquet (166)
         :     :     +- Sort (200)
         :     :        +- Exchange (199)
         :     :           +- HashAggregate (198)
         :     :              +- Exchange (197)
         :     :                 +- HashAggregate (196)
         :     :                    +- Project (195)
         :     :                       +- SortMergeJoin Inner (194)
         :     :                          :- Sort (189)
         :     :                          :  +- Exchange (188)
         :     :                          :     +- Project (187)
         :     :                          :        +- SortMergeJoin Inner (186)
         :     :                          :           :- Sort (181)
         :     :                          :           :  +- Exchange (180)
         :     :                          :           :     +- Filter (179)
         :     :                          :           :        +- Scan parquet (178)
         :     :                          :           +- Sort (185)
         :     :                          :              +- Exchange (184)
         :     :                          :                 +- Filter (183)
         :     :                          :                    +- Scan parquet (182)
         :     :                          +- Sort (193)
         :     :                             +- Exchange (192)
         :     :                                +- Filter (191)
         :     :                                   +- Scan parquet (190)
         :     +- Sort (226)
         :        +- Exchange (225)
         :           +- Filter (224)
         :              +- HashAggregate (223)
         :                 +- Exchange (222)
         :                    +- HashAggregate (221)
         :                       +- Project (220)
         :                          +- SortMergeJoin Inner (219)
         :                             :- Sort (214)
         :                             :  +- Exchange (213)
         :                             :     +- Project (212)
         :                             :        +- SortMergeJoin Inner (211)
         :                             :           :- Sort (206)
         :                             :           :  +- Exchange (205)
         :                             :           :     +- Filter (204)
         :                             :           :        +- Scan parquet (203)
         :                             :           +- Sort (210)
         :                             :              +- Exchange (209)
         :                             :                 +- Filter (208)
         :                             :                    +- Scan parquet (207)
         :                             +- Sort (218)
         :                                +- Exchange (217)
         :                                   +- Filter (216)
         :                                      +- Scan parquet (215)
         +- Sort (251)
            +- Exchange (250)
               +- HashAggregate (249)
                  +- Exchange (248)
                     +- HashAggregate (247)
                        +- Project (246)
                           +- SortMergeJoin Inner (245)
                              :- Sort (240)
                              :  +- Exchange (239)
                              :     +- Project (238)
                              :        +- SortMergeJoin Inner (237)
                              :           :- Sort (232)
                              :           :  +- Exchange (231)
                              :           :     +- Filter (230)
                              :           :        +- Scan parquet (229)
                              :           +- Sort (236)
                              :              +- Exchange (235)
                              :                 +- Filter (234)
                              :                    +- Scan parquet (233)
                              +- Sort (244)
                                 +- Exchange (243)
                                    +- Filter (242)
                                       +- Scan parquet (241)


(154) Scan parquet
Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>

(2) InputAdapter
Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Arguments: [#1, #2, #3, #4, #5, #6, #7, #8]

(3) NativeFilter
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2))

(4) NativeShuffleExchange
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Arguments: hashpartitioning(c_customer_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=1]

(5) ShuffleQueryStage
Output [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Arguments: X

(6) AQEShuffleRead
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Arguments: coalesced

(7) InputAdapter
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]

(8) NativeSort
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Arguments: [c_customer_sk#1 ASC NULLS FIRST], false

(158) Scan parquet
Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(10) InputAdapter
Input [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: [#9, #10, #11, #12]

(11) NativeFilter
Input [4]: [#9#9, #10#10, #11#11, #12#12]
Condition : (isnotnull(ss_customer_sk#10) AND isnotnull(ss_sold_date_sk#9))

(12) NativeShuffleExchange
Input [4]: [#9#9, #10#10, #11#11, #12#12]
Arguments: hashpartitioning(ss_customer_sk#10, 100), ENSURE_REQUIREMENTS, [plan_id=2]

(13) ShuffleQueryStage
Output [4]: [#9#9, #10#10, #11#11, #12#12]
Arguments: X

(14) AQEShuffleRead
Input [4]: [#9#9, #10#10, #11#11, #12#12]
Arguments: coalesced

(15) InputAdapter
Input [4]: [#9#9, #10#10, #11#11, #12#12]

(16) NativeSort
Input [4]: [#9#9, #10#10, #11#11, #12#12]
Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false

(17) NativeSortMergeJoin
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#10]
Join type: Inner
Join condition: None

(18) NativeProject
Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Input [12]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8, #9#9, #10#10, #11#11, #12#12]

(19) NativeShuffleExchange
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: hashpartitioning(ss_sold_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(20) ShuffleQueryStage
Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: X

(21) AQEShuffleRead
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: coalesced

(22) InputAdapter
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]

(23) NativeSort
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: [ss_sold_date_sk#9 ASC NULLS FIRST], false

(166) Scan parquet
Output [2]: [d_date_sk#13, d_year#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(25) InputAdapter
Input [2]: [d_date_sk#13, d_year#14]
Arguments: [#13, #14]

(26) NativeFilter
Input [2]: [#13#13, #14#14]
Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13))

(27) NativeShuffleExchange
Input [2]: [#13#13, #14#14]
Arguments: hashpartitioning(d_date_sk#13, 100), ENSURE_REQUIREMENTS, [plan_id=4]

(28) ShuffleQueryStage
Output [2]: [#13#13, #14#14]
Arguments: X

(29) AQEShuffleRead
Input [2]: [#13#13, #14#14]
Arguments: coalesced

(30) InputAdapter
Input [2]: [#13#13, #14#14]

(31) NativeSort
Input [2]: [#13#13, #14#14]
Arguments: [d_date_sk#13 ASC NULLS FIRST], false

(32) NativeSortMergeJoin
Left keys [1]: [ss_sold_date_sk#9]
Right keys [1]: [d_date_sk#13]
Join type: Inner
Join condition: None

(33) NativeProject
Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#14]
Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, #13#13, #14#14]

(34) NativeProject
Output [9]: [c_customer_id#2 AS c_customer_id#2, c_first_name#3 AS c_first_name#3, c_last_name#4 AS c_last_name#4, d_year#14 AS d_year#14, c_preferred_cust_flag#5 AS c_preferred_cust_flag#5, c_birth_country#6 AS c_birth_country#6, c_login#7 AS c_login#7, c_email_address#8 AS c_email_address#8, UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)) AS _c8#15]
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#14]

(35) NativeHashAggregate
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, _c8#15]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [partial_sum(_c8#15)]
Aggregate Attributes [1]: [sum#16]
Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]

(36) NativeShuffleExchange
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]
Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(37) ShuffleQueryStage
Output [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]
Arguments: X

(38) AQEShuffleRead
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]
Arguments: coalesced

(39) InputAdapter
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]

(40) NativeHashAggregate
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, #17]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18]
Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18]

(41) NativeProject
Output [2]: [c_customer_id#2 AS customer_id#19, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18,18,2) AS year_total#20]
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18]

(42) NativeFilter
Input [2]: [customer_id#19, year_total#20]
Condition : (isnotnull(year_total#20) AND (year_total#20 > 0.00))

(43) NativeShuffleExchange
Input [2]: [customer_id#19, year_total#20]
Arguments: hashpartitioning(customer_id#19, 100), ENSURE_REQUIREMENTS, [plan_id=6]

(44) ShuffleQueryStage
Output [2]: [customer_id#19, year_total#20]
Arguments: X

(45) AQEShuffleRead
Input [2]: [customer_id#19, year_total#20]
Arguments: coalesced

(46) InputAdapter
Input [2]: [customer_id#19, year_total#20]

(47) NativeSort
Input [2]: [customer_id#19, year_total#20]
Arguments: [customer_id#19 ASC NULLS FIRST], false

(48) ReusedExchange [Reuses operator id: 19]
Output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]

(49) ShuffleQueryStage
Output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: X

(50) AQEShuffleRead
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: coalesced

(51) InputAdapter
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: [#21, #22, #23, #24, #25, #26, #27, #28, #29, #30]

(52) InputAdapter
Input [10]: [#21#21, #22#22, #23#23, #24#24, #25#25, #26#26, #27#27, #28#28, #29#29, #30#30]

(53) NativeSort
Input [10]: [#21#21, #22#22, #23#23, #24#24, #25#25, #26#26, #27#27, #28#28, #29#29, #30#30]
Arguments: [ss_sold_date_sk#28 ASC NULLS FIRST], false

(190) Scan parquet
Output [2]: [d_date_sk#31, d_year#32]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(55) InputAdapter
Input [2]: [d_date_sk#31, d_year#32]
Arguments: [#31, #32]

(56) NativeFilter
Input [2]: [#31#31, #32#32]
Condition : ((isnotnull(d_year#32) AND (d_year#32 = 2002)) AND isnotnull(d_date_sk#31))

(57) NativeShuffleExchange
Input [2]: [#31#31, #32#32]
Arguments: hashpartitioning(d_date_sk#31, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(58) ShuffleQueryStage
Output [2]: [#31#31, #32#32]
Arguments: X

(59) AQEShuffleRead
Input [2]: [#31#31, #32#32]
Arguments: coalesced

(60) InputAdapter
Input [2]: [#31#31, #32#32]

(61) NativeSort
Input [2]: [#31#31, #32#32]
Arguments: [d_date_sk#31 ASC NULLS FIRST], false

(62) NativeSortMergeJoin
Left keys [1]: [ss_sold_date_sk#28]
Right keys [1]: [d_date_sk#31]
Join type: Inner
Join condition: None

(63) NativeProject
Output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#32]
Input [12]: [#21#21, #22#22, #23#23, #24#24, #25#25, #26#26, #27#27, #28#28, #29#29, #30#30, #31#31, #32#32]

(64) NativeProject
Output [9]: [c_customer_id#21 AS c_customer_id#21, c_first_name#22 AS c_first_name#22, c_last_name#23 AS c_last_name#23, d_year#32 AS d_year#32, c_preferred_cust_flag#24 AS c_preferred_cust_flag#24, c_birth_country#25 AS c_birth_country#25, c_login#26 AS c_login#26, c_email_address#27 AS c_email_address#27, UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)) AS _c8#33]
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#32]

(65) NativeHashAggregate
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, _c8#33]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [partial_sum(_c8#33)]
Aggregate Attributes [1]: [sum#34]
Results [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]

(66) NativeShuffleExchange
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]
Arguments: hashpartitioning(c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(67) ShuffleQueryStage
Output [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]
Arguments: X

(68) AQEShuffleRead
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]
Arguments: coalesced

(69) InputAdapter
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]

(70) NativeHashAggregate
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, #17]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18]
Results [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18]

(71) NativeProject
Output [3]: [c_customer_id#21 AS customer_id#35, c_preferred_cust_flag#24 AS customer_preferred_cust_flag#36, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18,18,2) AS year_total#37]
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18]

(72) NativeShuffleExchange
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: hashpartitioning(customer_id#35, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(73) ShuffleQueryStage
Output [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: X

(74) AQEShuffleRead
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: coalesced

(75) InputAdapter
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]

(76) NativeSort
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: [customer_id#35 ASC NULLS FIRST], false

(77) NativeSortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#35]
Join type: Inner
Join condition: None

(78) NativeProject
Output [4]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37]
Input [5]: [customer_id#19, year_total#20, customer_id#35, customer_preferred_cust_flag#36, year_total#37]

(79) ReusedExchange [Reuses operator id: 4]
Output [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]

(80) ShuffleQueryStage
Output [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Arguments: X

(81) AQEShuffleRead
Input [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Arguments: coalesced

(82) InputAdapter
Input [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Arguments: [#38, #39, #40, #41, #42, #43, #44, #45]

(83) InputAdapter
Input [8]: [#38#38, #39#39, #40#40, #41#41, #42#42, #43#43, #44#44, #45#45]

(84) NativeSort
Input [8]: [#38#38, #39#39, #40#40, #41#41, #42#42, #43#43, #44#44, #45#45]
Arguments: [c_customer_sk#38 ASC NULLS FIRST], false

(207) Scan parquet
Output [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(86) InputAdapter
Input [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: [#46, #47, #48, #49]

(87) NativeFilter
Input [4]: [#46#46, #47#47, #48#48, #49#49]
Condition : (isnotnull(ws_bill_customer_sk#47) AND isnotnull(ws_sold_date_sk#46))

(88) NativeShuffleExchange
Input [4]: [#46#46, #47#47, #48#48, #49#49]
Arguments: hashpartitioning(ws_bill_customer_sk#47, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(89) ShuffleQueryStage
Output [4]: [#46#46, #47#47, #48#48, #49#49]
Arguments: X

(90) AQEShuffleRead
Input [4]: [#46#46, #47#47, #48#48, #49#49]
Arguments: coalesced

(91) InputAdapter
Input [4]: [#46#46, #47#47, #48#48, #49#49]

(92) NativeSort
Input [4]: [#46#46, #47#47, #48#48, #49#49]
Arguments: [ws_bill_customer_sk#47 ASC NULLS FIRST], false

(93) NativeSortMergeJoin
Left keys [1]: [c_customer_sk#38]
Right keys [1]: [ws_bill_customer_sk#47]
Join type: Inner
Join condition: None

(94) NativeProject
Output [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Input [12]: [#38#38, #39#39, #40#40, #41#41, #42#42, #43#43, #44#44, #45#45, #46#46, #47#47, #48#48, #49#49]

(95) NativeShuffleExchange
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: hashpartitioning(ws_sold_date_sk#46, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(96) ShuffleQueryStage
Output [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: X

(97) AQEShuffleRead
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: coalesced

(98) InputAdapter
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]

(99) NativeSort
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: [ws_sold_date_sk#46 ASC NULLS FIRST], false

(100) ReusedExchange [Reuses operator id: 27]
Output [2]: [d_date_sk#50, d_year#51]

(101) ShuffleQueryStage
Output [2]: [d_date_sk#50, d_year#51]
Arguments: X

(102) AQEShuffleRead
Input [2]: [d_date_sk#50, d_year#51]
Arguments: coalesced

(103) InputAdapter
Input [2]: [d_date_sk#50, d_year#51]
Arguments: [#50, #51]

(104) InputAdapter
Input [2]: [#50#50, #51#51]

(105) NativeSort
Input [2]: [#50#50, #51#51]
Arguments: [d_date_sk#50 ASC NULLS FIRST], false

(106) NativeSortMergeJoin
Left keys [1]: [ws_sold_date_sk#46]
Right keys [1]: [d_date_sk#50]
Join type: Inner
Join condition: None

(107) NativeProject
Output [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#51]
Input [12]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49, #50#50, #51#51]

(108) NativeProject
Output [9]: [c_customer_id#39 AS c_customer_id#39, c_first_name#40 AS c_first_name#40, c_last_name#41 AS c_last_name#41, c_preferred_cust_flag#42 AS c_preferred_cust_flag#42, c_birth_country#43 AS c_birth_country#43, c_login#44 AS c_login#44, c_email_address#45 AS c_email_address#45, d_year#51 AS d_year#51, UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)) AS _c8#52]
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#51]

(109) NativeHashAggregate
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, _c8#52]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51]
Functions [1]: [partial_sum(_c8#52)]
Aggregate Attributes [1]: [sum#53]
Results [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]

(110) NativeShuffleExchange
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]
Arguments: hashpartitioning(c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(111) ShuffleQueryStage
Output [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]
Arguments: X

(112) AQEShuffleRead
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]
Arguments: coalesced

(113) InputAdapter
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]

(114) NativeHashAggregate
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, #17]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54]
Results [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54]

(115) NativeProject
Output [2]: [c_customer_id#39 AS customer_id#55, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54,18,2) AS year_total#56]
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54]

(116) NativeFilter
Input [2]: [customer_id#55, year_total#56]
Condition : (isnotnull(year_total#56) AND (year_total#56 > 0.00))

(117) NativeShuffleExchange
Input [2]: [customer_id#55, year_total#56]
Arguments: hashpartitioning(customer_id#55, 100), ENSURE_REQUIREMENTS, [plan_id=13]

(118) ShuffleQueryStage
Output [2]: [customer_id#55, year_total#56]
Arguments: X

(119) AQEShuffleRead
Input [2]: [customer_id#55, year_total#56]
Arguments: coalesced

(120) InputAdapter
Input [2]: [customer_id#55, year_total#56]

(121) NativeSort
Input [2]: [customer_id#55, year_total#56]
Arguments: [customer_id#55 ASC NULLS FIRST], false

(122) NativeSortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#55]
Join type: Inner
Join condition: None

(123) NativeProject
Output [5]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, year_total#56]
Input [6]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, customer_id#55, year_total#56]

(124) ReusedExchange [Reuses operator id: 95]
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]

(125) ShuffleQueryStage
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: X

(126) AQEShuffleRead
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: coalesced

(127) InputAdapter
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: [#57, #58, #59, #60, #61, #62, #63, #64, #65, #66]

(128) InputAdapter
Input [10]: [#57#57, #58#58, #59#59, #60#60, #61#61, #62#62, #63#63, #64#64, #65#65, #66#66]

(129) NativeSort
Input [10]: [#57#57, #58#58, #59#59, #60#60, #61#61, #62#62, #63#63, #64#64, #65#65, #66#66]
Arguments: [ws_sold_date_sk#64 ASC NULLS FIRST], false

(130) ReusedExchange [Reuses operator id: 57]
Output [2]: [d_date_sk#67, d_year#68]

(131) ShuffleQueryStage
Output [2]: [d_date_sk#67, d_year#68]
Arguments: X

(132) AQEShuffleRead
Input [2]: [d_date_sk#67, d_year#68]
Arguments: coalesced

(133) InputAdapter
Input [2]: [d_date_sk#67, d_year#68]
Arguments: [#67, #68]

(134) InputAdapter
Input [2]: [#67#67, #68#68]

(135) NativeSort
Input [2]: [#67#67, #68#68]
Arguments: [d_date_sk#67 ASC NULLS FIRST], false

(136) NativeSortMergeJoin
Left keys [1]: [ws_sold_date_sk#64]
Right keys [1]: [d_date_sk#67]
Join type: Inner
Join condition: None

(137) NativeProject
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_ext_discount_amt#65, ws_ext_list_price#66, d_year#68]
Input [12]: [#57#57, #58#58, #59#59, #60#60, #61#61, #62#62, #63#63, #64#64, #65#65, #66#66, #67#67, #68#68]

(138) NativeProject
Output [9]: [c_customer_id#57 AS c_customer_id#57, c_first_name#58 AS c_first_name#58, c_last_name#59 AS c_last_name#59, c_preferred_cust_flag#60 AS c_preferred_cust_flag#60, c_birth_country#61 AS c_birth_country#61, c_login#62 AS c_login#62, c_email_address#63 AS c_email_address#63, d_year#68 AS d_year#68, UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)) AS _c8#69]
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_ext_discount_amt#65, ws_ext_list_price#66, d_year#68]

(139) NativeHashAggregate
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, _c8#69]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68]
Functions [1]: [partial_sum(_c8#69)]
Aggregate Attributes [1]: [sum#70]
Results [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]

(140) NativeShuffleExchange
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]
Arguments: hashpartitioning(c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, 100), ENSURE_REQUIREMENTS, [plan_id=14]

(141) ShuffleQueryStage
Output [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]
Arguments: X

(142) AQEShuffleRead
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]
Arguments: coalesced

(143) InputAdapter
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]

(144) NativeHashAggregate
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, #17]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54]
Results [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54]

(145) NativeProject
Output [2]: [c_customer_id#57 AS customer_id#71, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54,18,2) AS year_total#72]
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54]

(146) NativeShuffleExchange
Input [2]: [customer_id#71, year_total#72]
Arguments: hashpartitioning(customer_id#71, 100), ENSURE_REQUIREMENTS, [plan_id=15]

(147) ShuffleQueryStage
Output [2]: [customer_id#71, year_total#72]
Arguments: X

(148) AQEShuffleRead
Input [2]: [customer_id#71, year_total#72]
Arguments: coalesced

(149) InputAdapter
Input [2]: [customer_id#71, year_total#72]

(150) NativeSort
Input [2]: [customer_id#71, year_total#72]
Arguments: [customer_id#71 ASC NULLS FIRST], false

(151) NativeSortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#71]
Join type: Inner
Join condition: (CASE WHEN (year_total#56 > 0.00) THEN (year_total#72 / year_total#56) END > CASE WHEN (year_total#20 > 0.00) THEN (year_total#37 / year_total#20) END)

(152) NativeProject
Output [1]: [customer_preferred_cust_flag#36]
Input [7]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, year_total#56, customer_id#71, year_total#72]

(153) NativeTakeOrdered
Input [1]: [customer_preferred_cust_flag#36]
Arguments: X, X, [customer_preferred_cust_flag#36 ASC NULLS FIRST]

(154) Scan parquet
Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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>

(155) Filter
Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2))

(156) Exchange
Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Arguments: hashpartitioning(c_customer_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=16]

(157) Sort
Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0

(158) Scan parquet
Output [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(159) Filter
Input [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Condition : (isnotnull(ss_customer_sk#10) AND isnotnull(ss_sold_date_sk#9))

(160) Exchange
Input [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: hashpartitioning(ss_customer_sk#10, 100), ENSURE_REQUIREMENTS, [plan_id=17]

(161) Sort
Input [4]: [ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false, 0

(162) SortMergeJoin
Left keys [1]: [c_customer_sk#1]
Right keys [1]: [ss_customer_sk#10]
Join type: Inner
Join condition: None

(163) Project
Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_customer_sk#10, ss_ext_discount_amt#11, ss_ext_list_price#12]

(164) Exchange
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: hashpartitioning(ss_sold_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=18]

(165) Sort
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12]
Arguments: [ss_sold_date_sk#9 ASC NULLS FIRST], false, 0

(166) Scan parquet
Output [2]: [d_date_sk#13, d_year#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(167) Filter
Input [2]: [d_date_sk#13, d_year#14]
Condition : ((isnotnull(d_year#14) AND (d_year#14 = 2001)) AND isnotnull(d_date_sk#13))

(168) Exchange
Input [2]: [d_date_sk#13, d_year#14]
Arguments: hashpartitioning(d_date_sk#13, 100), ENSURE_REQUIREMENTS, [plan_id=19]

(169) Sort
Input [2]: [d_date_sk#13, d_year#14]
Arguments: [d_date_sk#13 ASC NULLS FIRST], false, 0

(170) SortMergeJoin
Left keys [1]: [ss_sold_date_sk#9]
Right keys [1]: [d_date_sk#13]
Join type: Inner
Join condition: None

(171) Project
Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#14]
Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_sold_date_sk#9, ss_ext_discount_amt#11, ss_ext_list_price#12, d_date_sk#13, d_year#14]

(172) HashAggregate
Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#11, ss_ext_list_price#12, d_year#14]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))]
Aggregate Attributes [1]: [sum#16]
Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#73]

(173) Exchange
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#73]
Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 100), ENSURE_REQUIREMENTS, [plan_id=20]

(174) HashAggregate
Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#73]
Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#14, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18]
Results [2]: [c_customer_id#2 AS customer_id#19, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#12 - ss_ext_discount_amt#11)))#18,18,2) AS year_total#20]

(175) Filter
Input [2]: [customer_id#19, year_total#20]
Condition : (isnotnull(year_total#20) AND (year_total#20 > 0.00))

(176) Exchange
Input [2]: [customer_id#19, year_total#20]
Arguments: hashpartitioning(customer_id#19, 100), ENSURE_REQUIREMENTS, [plan_id=21]

(177) Sort
Input [2]: [customer_id#19, year_total#20]
Arguments: [customer_id#19 ASC NULLS FIRST], false, 0

(178) Scan parquet
Output [8]: [c_customer_sk#74, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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>

(179) Filter
Input [8]: [c_customer_sk#74, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Condition : (isnotnull(c_customer_sk#74) AND isnotnull(c_customer_id#21))

(180) Exchange
Input [8]: [c_customer_sk#74, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Arguments: hashpartitioning(c_customer_sk#74, 100), ENSURE_REQUIREMENTS, [plan_id=22]

(181) Sort
Input [8]: [c_customer_sk#74, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Arguments: [c_customer_sk#74 ASC NULLS FIRST], false, 0

(182) Scan parquet
Output [4]: [ss_sold_date_sk#28, ss_customer_sk#75, ss_ext_discount_amt#29, ss_ext_list_price#30]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(183) Filter
Input [4]: [ss_sold_date_sk#28, ss_customer_sk#75, ss_ext_discount_amt#29, ss_ext_list_price#30]
Condition : (isnotnull(ss_customer_sk#75) AND isnotnull(ss_sold_date_sk#28))

(184) Exchange
Input [4]: [ss_sold_date_sk#28, ss_customer_sk#75, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: hashpartitioning(ss_customer_sk#75, 100), ENSURE_REQUIREMENTS, [plan_id=23]

(185) Sort
Input [4]: [ss_sold_date_sk#28, ss_customer_sk#75, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: [ss_customer_sk#75 ASC NULLS FIRST], false, 0

(186) SortMergeJoin
Left keys [1]: [c_customer_sk#74]
Right keys [1]: [ss_customer_sk#75]
Join type: Inner
Join condition: None

(187) Project
Output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Input [12]: [c_customer_sk#74, c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_customer_sk#75, ss_ext_discount_amt#29, ss_ext_list_price#30]

(188) Exchange
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: hashpartitioning(ss_sold_date_sk#28, 100), ENSURE_REQUIREMENTS, [plan_id=24]

(189) Sort
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30]
Arguments: [ss_sold_date_sk#28 ASC NULLS FIRST], false, 0

(190) Scan parquet
Output [2]: [d_date_sk#31, d_year#32]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(191) Filter
Input [2]: [d_date_sk#31, d_year#32]
Condition : ((isnotnull(d_year#32) AND (d_year#32 = 2002)) AND isnotnull(d_date_sk#31))

(192) Exchange
Input [2]: [d_date_sk#31, d_year#32]
Arguments: hashpartitioning(d_date_sk#31, 100), ENSURE_REQUIREMENTS, [plan_id=25]

(193) Sort
Input [2]: [d_date_sk#31, d_year#32]
Arguments: [d_date_sk#31 ASC NULLS FIRST], false, 0

(194) SortMergeJoin
Left keys [1]: [ss_sold_date_sk#28]
Right keys [1]: [d_date_sk#31]
Join type: Inner
Join condition: None

(195) Project
Output [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#32]
Input [12]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_sold_date_sk#28, ss_ext_discount_amt#29, ss_ext_list_price#30, d_date_sk#31, d_year#32]

(196) HashAggregate
Input [10]: [c_customer_id#21, c_first_name#22, c_last_name#23, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, ss_ext_discount_amt#29, ss_ext_list_price#30, d_year#32]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))]
Aggregate Attributes [1]: [sum#34]
Results [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#76]

(197) Exchange
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#76]
Arguments: hashpartitioning(c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, 100), ENSURE_REQUIREMENTS, [plan_id=26]

(198) HashAggregate
Input [9]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27, sum#76]
Keys [8]: [c_customer_id#21, c_first_name#22, c_last_name#23, d_year#32, c_preferred_cust_flag#24, c_birth_country#25, c_login#26, c_email_address#27]
Functions [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18]
Results [3]: [c_customer_id#21 AS customer_id#35, c_preferred_cust_flag#24 AS customer_preferred_cust_flag#36, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#30 - ss_ext_discount_amt#29)))#18,18,2) AS year_total#37]

(199) Exchange
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: hashpartitioning(customer_id#35, 100), ENSURE_REQUIREMENTS, [plan_id=27]

(200) Sort
Input [3]: [customer_id#35, customer_preferred_cust_flag#36, year_total#37]
Arguments: [customer_id#35 ASC NULLS FIRST], false, 0

(201) SortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#35]
Join type: Inner
Join condition: None

(202) Project
Output [4]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37]
Input [5]: [customer_id#19, year_total#20, customer_id#35, customer_preferred_cust_flag#36, year_total#37]

(203) Scan parquet
Output [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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>

(204) Filter
Input [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Condition : (isnotnull(c_customer_sk#38) AND isnotnull(c_customer_id#39))

(205) Exchange
Input [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Arguments: hashpartitioning(c_customer_sk#38, 100), ENSURE_REQUIREMENTS, [plan_id=28]

(206) Sort
Input [8]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45]
Arguments: [c_customer_sk#38 ASC NULLS FIRST], false, 0

(207) Scan parquet
Output [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(208) Filter
Input [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Condition : (isnotnull(ws_bill_customer_sk#47) AND isnotnull(ws_sold_date_sk#46))

(209) Exchange
Input [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: hashpartitioning(ws_bill_customer_sk#47, 100), ENSURE_REQUIREMENTS, [plan_id=29]

(210) Sort
Input [4]: [ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: [ws_bill_customer_sk#47 ASC NULLS FIRST], false, 0

(211) SortMergeJoin
Left keys [1]: [c_customer_sk#38]
Right keys [1]: [ws_bill_customer_sk#47]
Join type: Inner
Join condition: None

(212) Project
Output [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Input [12]: [c_customer_sk#38, c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_bill_customer_sk#47, ws_ext_discount_amt#48, ws_ext_list_price#49]

(213) Exchange
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: hashpartitioning(ws_sold_date_sk#46, 100), ENSURE_REQUIREMENTS, [plan_id=30]

(214) Sort
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49]
Arguments: [ws_sold_date_sk#46 ASC NULLS FIRST], false, 0

(215) Scan parquet
Output [2]: [d_date_sk#50, d_year#51]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(216) Filter
Input [2]: [d_date_sk#50, d_year#51]
Condition : ((isnotnull(d_year#51) AND (d_year#51 = 2001)) AND isnotnull(d_date_sk#50))

(217) Exchange
Input [2]: [d_date_sk#50, d_year#51]
Arguments: hashpartitioning(d_date_sk#50, 100), ENSURE_REQUIREMENTS, [plan_id=31]

(218) Sort
Input [2]: [d_date_sk#50, d_year#51]
Arguments: [d_date_sk#50 ASC NULLS FIRST], false, 0

(219) SortMergeJoin
Left keys [1]: [ws_sold_date_sk#46]
Right keys [1]: [d_date_sk#50]
Join type: Inner
Join condition: None

(220) Project
Output [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#51]
Input [12]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_sold_date_sk#46, ws_ext_discount_amt#48, ws_ext_list_price#49, d_date_sk#50, d_year#51]

(221) HashAggregate
Input [10]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, ws_ext_discount_amt#48, ws_ext_list_price#49, d_year#51]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))]
Aggregate Attributes [1]: [sum#53]
Results [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, sum#77]

(222) Exchange
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, sum#77]
Arguments: hashpartitioning(c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, 100), ENSURE_REQUIREMENTS, [plan_id=32]

(223) HashAggregate
Input [9]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51, sum#77]
Keys [8]: [c_customer_id#39, c_first_name#40, c_last_name#41, c_preferred_cust_flag#42, c_birth_country#43, c_login#44, c_email_address#45, d_year#51]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54]
Results [2]: [c_customer_id#39 AS customer_id#55, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#49 - ws_ext_discount_amt#48)))#54,18,2) AS year_total#56]

(224) Filter
Input [2]: [customer_id#55, year_total#56]
Condition : (isnotnull(year_total#56) AND (year_total#56 > 0.00))

(225) Exchange
Input [2]: [customer_id#55, year_total#56]
Arguments: hashpartitioning(customer_id#55, 100), ENSURE_REQUIREMENTS, [plan_id=33]

(226) Sort
Input [2]: [customer_id#55, year_total#56]
Arguments: [customer_id#55 ASC NULLS FIRST], false, 0

(227) SortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#55]
Join type: Inner
Join condition: None

(228) Project
Output [5]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, year_total#56]
Input [6]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, customer_id#55, year_total#56]

(229) Scan parquet
Output [8]: [c_customer_sk#78, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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>

(230) Filter
Input [8]: [c_customer_sk#78, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63]
Condition : (isnotnull(c_customer_sk#78) AND isnotnull(c_customer_id#57))

(231) Exchange
Input [8]: [c_customer_sk#78, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63]
Arguments: hashpartitioning(c_customer_sk#78, 100), ENSURE_REQUIREMENTS, [plan_id=34]

(232) Sort
Input [8]: [c_customer_sk#78, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63]
Arguments: [c_customer_sk#78 ASC NULLS FIRST], false, 0

(233) Scan parquet
Output [4]: [ws_sold_date_sk#64, ws_bill_customer_sk#79, ws_ext_discount_amt#65, ws_ext_list_price#66]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
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)>

(234) Filter
Input [4]: [ws_sold_date_sk#64, ws_bill_customer_sk#79, ws_ext_discount_amt#65, ws_ext_list_price#66]
Condition : (isnotnull(ws_bill_customer_sk#79) AND isnotnull(ws_sold_date_sk#64))

(235) Exchange
Input [4]: [ws_sold_date_sk#64, ws_bill_customer_sk#79, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: hashpartitioning(ws_bill_customer_sk#79, 100), ENSURE_REQUIREMENTS, [plan_id=35]

(236) Sort
Input [4]: [ws_sold_date_sk#64, ws_bill_customer_sk#79, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: [ws_bill_customer_sk#79 ASC NULLS FIRST], false, 0

(237) SortMergeJoin
Left keys [1]: [c_customer_sk#78]
Right keys [1]: [ws_bill_customer_sk#79]
Join type: Inner
Join condition: None

(238) Project
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Input [12]: [c_customer_sk#78, c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_bill_customer_sk#79, ws_ext_discount_amt#65, ws_ext_list_price#66]

(239) Exchange
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: hashpartitioning(ws_sold_date_sk#64, 100), ENSURE_REQUIREMENTS, [plan_id=36]

(240) Sort
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66]
Arguments: [ws_sold_date_sk#64 ASC NULLS FIRST], false, 0

(241) Scan parquet
Output [2]: [d_date_sk#67, d_year#68]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(242) Filter
Input [2]: [d_date_sk#67, d_year#68]
Condition : ((isnotnull(d_year#68) AND (d_year#68 = 2002)) AND isnotnull(d_date_sk#67))

(243) Exchange
Input [2]: [d_date_sk#67, d_year#68]
Arguments: hashpartitioning(d_date_sk#67, 100), ENSURE_REQUIREMENTS, [plan_id=37]

(244) Sort
Input [2]: [d_date_sk#67, d_year#68]
Arguments: [d_date_sk#67 ASC NULLS FIRST], false, 0

(245) SortMergeJoin
Left keys [1]: [ws_sold_date_sk#64]
Right keys [1]: [d_date_sk#67]
Join type: Inner
Join condition: None

(246) Project
Output [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_ext_discount_amt#65, ws_ext_list_price#66, d_year#68]
Input [12]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_sold_date_sk#64, ws_ext_discount_amt#65, ws_ext_list_price#66, d_date_sk#67, d_year#68]

(247) HashAggregate
Input [10]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, ws_ext_discount_amt#65, ws_ext_list_price#66, d_year#68]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68]
Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))]
Aggregate Attributes [1]: [sum#70]
Results [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, sum#80]

(248) Exchange
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, sum#80]
Arguments: hashpartitioning(c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, 100), ENSURE_REQUIREMENTS, [plan_id=38]

(249) HashAggregate
Input [9]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68, sum#80]
Keys [8]: [c_customer_id#57, c_first_name#58, c_last_name#59, c_preferred_cust_flag#60, c_birth_country#61, c_login#62, c_email_address#63, d_year#68]
Functions [1]: [sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))]
Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54]
Results [2]: [c_customer_id#57 AS customer_id#71, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#66 - ws_ext_discount_amt#65)))#54,18,2) AS year_total#72]

(250) Exchange
Input [2]: [customer_id#71, year_total#72]
Arguments: hashpartitioning(customer_id#71, 100), ENSURE_REQUIREMENTS, [plan_id=39]

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

(252) SortMergeJoin
Left keys [1]: [customer_id#19]
Right keys [1]: [customer_id#71]
Join type: Inner
Join condition: (CASE WHEN (year_total#56 > 0.00) THEN (year_total#72 / year_total#56) END > CASE WHEN (year_total#20 > 0.00) THEN (year_total#37 / year_total#20) END)

(253) Project
Output [1]: [customer_preferred_cust_flag#36]
Input [7]: [customer_id#19, year_total#20, customer_preferred_cust_flag#36, year_total#37, year_total#56, customer_id#71, year_total#72]

(254) TakeOrderedAndProject
Input [1]: [customer_preferred_cust_flag#36]
Arguments: X, [customer_preferred_cust_flag#36 ASC NULLS FIRST], [customer_preferred_cust_flag#36]

(255) AdaptiveSparkPlan
Output [1]: [customer_preferred_cust_flag#36]
Arguments: isFinalPlan=true

