== Physical Plan ==
AdaptiveSparkPlan (118)
+- == Final Plan ==
   NativeProject (76)
   +- NativeTakeOrdered (75)
      +- NativeProject (74)
         +- NativeSortMergeJoin Inner (73)
            :- NativeSort (64)
            :  +- InputAdapter (63)
            :     +- AQEShuffleRead (62)
            :        +- ShuffleQueryStage (61), Statistics(X)
            :           +- NativeShuffleExchange (60)
            :              +- NativeProject (59)
            :                 +- NativeHashAggregate (58)
            :                    +- InputAdapter (57)
            :                       +- AQEShuffleRead (56)
            :                          +- ShuffleQueryStage (55), Statistics(X)
            :                             +- NativeShuffleExchange (54)
            :                                +- NativeHashAggregate (53)
            :                                   +- NativeProject (52)
            :                                      +- NativeProject (51)
            :                                         +- NativeSortMergeJoin Inner (50)
            :                                            :- NativeSort (40)
            :                                            :  +- InputAdapter (39)
            :                                            :     +- AQEShuffleRead (38)
            :                                            :        +- ShuffleQueryStage (37), Statistics(X)
            :                                            :           +- NativeShuffleExchange (36)
            :                                            :              +- NativeProject (35)
            :                                            :                 +- NativeSortMergeJoin Inner (34)
            :                                            :                    :- NativeSort (24)
            :                                            :                    :  +- InputAdapter (23)
            :                                            :                    :     +- AQEShuffleRead (22)
            :                                            :                    :        +- ShuffleQueryStage (21), Statistics(X)
            :                                            :                    :           +- NativeShuffleExchange (20)
            :                                            :                    :              +- NativeProject (19)
            :                                            :                    :                 +- NativeSortMergeJoin Inner (18)
            :                                            :                    :                    :- NativeSort (8)
            :                                            :                    :                    :  +- InputAdapter (7)
            :                                            :                    :                    :     +- AQEShuffleRead (6)
            :                                            :                    :                    :        +- ShuffleQueryStage (5), Statistics(X)
            :                                            :                    :                    :           +- NativeShuffleExchange (4)
            :                                            :                    :                    :              +- NativeFilter (3)
            :                                            :                    :                    :                 +- InputAdapter (2)
            :                                            :                    :                    :                    +- NativeParquetScan  (1)
            :                                            :                    :                    +- NativeSort (17)
            :                                            :                    :                       +- InputAdapter (16)
            :                                            :                    :                          +- AQEShuffleRead (15)
            :                                            :                    :                             +- ShuffleQueryStage (14), Statistics(X)
            :                                            :                    :                                +- NativeShuffleExchange (13)
            :                                            :                    :                                   +- NativeProject (12)
            :                                            :                    :                                      +- NativeFilter (11)
            :                                            :                    :                                         +- InputAdapter (10)
            :                                            :                    :                                            +- NativeParquetScan  (9)
            :                                            :                    +- NativeSort (33)
            :                                            :                       +- InputAdapter (32)
            :                                            :                          +- AQEShuffleRead (31)
            :                                            :                             +- ShuffleQueryStage (30), Statistics(X)
            :                                            :                                +- NativeShuffleExchange (29)
            :                                            :                                   +- NativeProject (28)
            :                                            :                                      +- NativeFilter (27)
            :                                            :                                         +- InputAdapter (26)
            :                                            :                                            +- NativeParquetScan  (25)
            :                                            +- NativeSort (49)
            :                                               +- InputAdapter (48)
            :                                                  +- AQEShuffleRead (47)
            :                                                     +- ShuffleQueryStage (46), Statistics(X)
            :                                                        +- NativeShuffleExchange (45)
            :                                                           +- NativeProject (44)
            :                                                              +- NativeFilter (43)
            :                                                                 +- InputAdapter (42)
            :                                                                    +- NativeParquetScan  (41)
            +- NativeSort (72)
               +- InputAdapter (71)
                  +- AQEShuffleRead (70)
                     +- ShuffleQueryStage (69), Statistics(X)
                        +- NativeShuffleExchange (68)
                           +- NativeFilter (67)
                              +- InputAdapter (66)
                                 +- NativeParquetScan  (65)
+- == Initial Plan ==
   TakeOrderedAndProject (117)
   +- Project (116)
      +- SortMergeJoin Inner (115)
         :- Sort (110)
         :  +- Exchange (109)
         :     +- HashAggregate (108)
         :        +- Exchange (107)
         :           +- HashAggregate (106)
         :              +- Project (105)
         :                 +- SortMergeJoin Inner (104)
         :                    :- Sort (98)
         :                    :  +- Exchange (97)
         :                    :     +- Project (96)
         :                    :        +- SortMergeJoin Inner (95)
         :                    :           :- Sort (89)
         :                    :           :  +- Exchange (88)
         :                    :           :     +- Project (87)
         :                    :           :        +- SortMergeJoin Inner (86)
         :                    :           :           :- Sort (80)
         :                    :           :           :  +- Exchange (79)
         :                    :           :           :     +- Filter (78)
         :                    :           :           :        +- Scan parquet (77)
         :                    :           :           +- Sort (85)
         :                    :           :              +- Exchange (84)
         :                    :           :                 +- Project (83)
         :                    :           :                    +- Filter (82)
         :                    :           :                       +- Scan parquet (81)
         :                    :           +- Sort (94)
         :                    :              +- Exchange (93)
         :                    :                 +- Project (92)
         :                    :                    +- Filter (91)
         :                    :                       +- Scan parquet (90)
         :                    +- Sort (103)
         :                       +- Exchange (102)
         :                          +- Project (101)
         :                             +- Filter (100)
         :                                +- Scan parquet (99)
         +- Sort (114)
            +- Exchange (113)
               +- Filter (112)
                  +- Scan parquet (111)


(77) Scan parquet
Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_customer_sk:int,ss_hdemo_sk:int,ss_addr_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_coupon_amt:decimal(7,2),ss_net_profit:decimal(7,2)>

(2) InputAdapter
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#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(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2))

(4) NativeShuffleExchange
Input [8]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8]
Arguments: hashpartitioning(ss_sold_date_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: [ss_sold_date_sk#1 ASC NULLS FIRST], false

(81) Scan parquet
Output [3]: [d_date_sk#9, d_year#10, d_dow#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>

(10) InputAdapter
Input [3]: [d_date_sk#9, d_year#10, d_dow#11]
Arguments: [#9, #10, #11]

(11) NativeFilter
Input [3]: [#9#9, #10#10, #11#11]
Condition : (((isnotnull(d_dow#11) AND (d_dow#11 = 1)) AND d_year#10 IN (1999,2000,2001)) AND isnotnull(d_date_sk#9))

(12) NativeProject
Output [1]: [d_date_sk#9]
Input [3]: [#9#9, #10#10, #11#11]

(13) NativeShuffleExchange
Input [1]: [d_date_sk#9]
Arguments: hashpartitioning(d_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=2]

(14) ShuffleQueryStage
Output [1]: [d_date_sk#9]
Arguments: X

(15) AQEShuffleRead
Input [1]: [d_date_sk#9]
Arguments: coalesced

(16) InputAdapter
Input [1]: [d_date_sk#9]

(17) NativeSort
Input [1]: [d_date_sk#9]
Arguments: [d_date_sk#9 ASC NULLS FIRST], false

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

(19) NativeProject
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Input [9]: [#1#1, #2#2, #3#3, #4#4, #5#5, #6#6, #7#7, #8#8, d_date_sk#9]

(20) NativeShuffleExchange
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: hashpartitioning(ss_store_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(21) ShuffleQueryStage
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: X

(22) AQEShuffleRead
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: coalesced

(23) InputAdapter
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]

(24) NativeSort
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: [ss_store_sk#5 ASC NULLS FIRST], false

(90) Scan parquet
Output [3]: [s_store_sk#12, s_number_employees#13, s_city#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_number_employees:int,s_city:string>

(26) InputAdapter
Input [3]: [s_store_sk#12, s_number_employees#13, s_city#14]
Arguments: [#12, #13, #14]

(27) NativeFilter
Input [3]: [#12#12, #13#13, #14#14]
Condition : (((isnotnull(s_number_employees#13) AND (s_number_employees#13 >= 200)) AND (s_number_employees#13 <= 295)) AND isnotnull(s_store_sk#12))

(28) NativeProject
Output [2]: [s_store_sk#12, s_city#14]
Input [3]: [#12#12, #13#13, #14#14]

(29) NativeShuffleExchange
Input [2]: [s_store_sk#12, s_city#14]
Arguments: hashpartitioning(s_store_sk#12, 100), ENSURE_REQUIREMENTS, [plan_id=4]

(30) ShuffleQueryStage
Output [2]: [s_store_sk#12, s_city#14]
Arguments: X

(31) AQEShuffleRead
Input [2]: [s_store_sk#12, s_city#14]
Arguments: coalesced

(32) InputAdapter
Input [2]: [s_store_sk#12, s_city#14]

(33) NativeSort
Input [2]: [s_store_sk#12, s_city#14]
Arguments: [s_store_sk#12 ASC NULLS FIRST], false

(34) NativeSortMergeJoin
Left keys [1]: [ss_store_sk#5]
Right keys [1]: [s_store_sk#12]
Join type: Inner
Join condition: None

(35) NativeProject
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Input [9]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#12, s_city#14]

(36) NativeShuffleExchange
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: hashpartitioning(ss_hdemo_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(37) ShuffleQueryStage
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: X

(38) AQEShuffleRead
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: coalesced

(39) InputAdapter
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]

(40) NativeSort
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: [ss_hdemo_sk#3 ASC NULLS FIRST], false

(99) Scan parquet
Output [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [Or(EqualTo(hd_dep_count,6),GreaterThan(hd_vehicle_count,2)), IsNotNull(hd_demo_sk)]
ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>

(42) InputAdapter
Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
Arguments: [#15, #16, #17]

(43) NativeFilter
Input [3]: [#15#15, #16#16, #17#17]
Condition : (((hd_dep_count#16 = 6) OR (hd_vehicle_count#17 > 2)) AND isnotnull(hd_demo_sk#15))

(44) NativeProject
Output [1]: [hd_demo_sk#15]
Input [3]: [#15#15, #16#16, #17#17]

(45) NativeShuffleExchange
Input [1]: [hd_demo_sk#15]
Arguments: hashpartitioning(hd_demo_sk#15, 100), ENSURE_REQUIREMENTS, [plan_id=6]

(46) ShuffleQueryStage
Output [1]: [hd_demo_sk#15]
Arguments: X

(47) AQEShuffleRead
Input [1]: [hd_demo_sk#15]
Arguments: coalesced

(48) InputAdapter
Input [1]: [hd_demo_sk#15]

(49) NativeSort
Input [1]: [hd_demo_sk#15]
Arguments: [hd_demo_sk#15 ASC NULLS FIRST], false

(50) NativeSortMergeJoin
Left keys [1]: [ss_hdemo_sk#3]
Right keys [1]: [hd_demo_sk#15]
Join type: Inner
Join condition: None

(51) NativeProject
Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14, hd_demo_sk#15]

(52) NativeProject
Output [6]: [ss_ticket_number#6 AS ss_ticket_number#6, ss_customer_sk#2 AS ss_customer_sk#2, ss_addr_sk#4 AS ss_addr_sk#4, s_city#14 AS s_city#14, UnscaledValue(ss_coupon_amt#7) AS _c4#18, UnscaledValue(ss_net_profit#8) AS _c5#19]
Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]

(53) NativeHashAggregate
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, _c4#18, _c5#19]
Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14]
Functions [2]: [partial_sum(_c4#18), partial_sum(_c5#19)]
Aggregate Attributes [2]: [sum#20, sum#21]
Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]

(54) NativeShuffleExchange
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]
Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(55) ShuffleQueryStage
Output [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]
Arguments: X

(56) AQEShuffleRead
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]
Arguments: coalesced

(57) InputAdapter
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]

(58) NativeHashAggregate
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, #22, #22]
Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14]
Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))]
Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#23, sum(UnscaledValue(ss_net_profit#8))#24]
Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, sum(UnscaledValue(ss_coupon_amt#7))#23, sum(UnscaledValue(ss_net_profit#8))#24]

(59) NativeProject
Output [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#23,17,2) AS amt#25, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#24,17,2) AS profit#26]
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, sum(UnscaledValue(ss_coupon_amt#7))#23, sum(UnscaledValue(ss_net_profit#8))#24]

(60) NativeShuffleExchange
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: hashpartitioning(ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(61) ShuffleQueryStage
Output [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: X

(62) AQEShuffleRead
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: coalesced

(63) InputAdapter
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]

(64) NativeSort
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false

(111) Scan parquet
Output [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string>

(66) InputAdapter
Input [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Arguments: [#27, #28, #29]

(67) NativeFilter
Input [3]: [#27#27, #28#28, #29#29]
Condition : isnotnull(c_customer_sk#27)

(68) NativeShuffleExchange
Input [3]: [#27#27, #28#28, #29#29]
Arguments: hashpartitioning(c_customer_sk#27, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(69) ShuffleQueryStage
Output [3]: [#27#27, #28#28, #29#29]
Arguments: X

(70) AQEShuffleRead
Input [3]: [#27#27, #28#28, #29#29]
Arguments: coalesced

(71) InputAdapter
Input [3]: [#27#27, #28#28, #29#29]

(72) NativeSort
Input [3]: [#27#27, #28#28, #29#29]
Arguments: [c_customer_sk#27 ASC NULLS FIRST], false

(73) NativeSortMergeJoin
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#27]
Join type: Inner
Join condition: None

(74) NativeProject
Output [7]: [c_last_name#29, c_first_name#28, substr(s_city#14, 1, 30) AS substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26, s_city#14]
Input [8]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26, #27#27, #28#28, #29#29]

(75) NativeTakeOrdered
Input [7]: [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26, s_city#14]
Arguments: X, X, [c_last_name#29 ASC NULLS FIRST, c_first_name#28 ASC NULLS FIRST, substr(s_city#14, 1, 30) ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST, profit#26 ASC NULLS FIRST]

(76) NativeProject
Output [6]: [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26]
Input [7]: [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26, s_city#14]

(77) Scan parquet
Output [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ss_sold_date_sk), IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_customer_sk:int,ss_hdemo_sk:int,ss_addr_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_coupon_amt:decimal(7,2),ss_net_profit:decimal(7,2)>

(78) Filter
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#5)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2))

(79) Exchange
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: hashpartitioning(ss_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(80) Sort
Input [8]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: [ss_sold_date_sk#1 ASC NULLS FIRST], false, 0

(81) Scan parquet
Output [3]: [d_date_sk#9, d_year#10, d_dow#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>

(82) Filter
Input [3]: [d_date_sk#9, d_year#10, d_dow#11]
Condition : (((isnotnull(d_dow#11) AND (d_dow#11 = 1)) AND d_year#10 IN (1999,2000,2001)) AND isnotnull(d_date_sk#9))

(83) Project
Output [1]: [d_date_sk#9]
Input [3]: [d_date_sk#9, d_year#10, d_dow#11]

(84) Exchange
Input [1]: [d_date_sk#9]
Arguments: hashpartitioning(d_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(85) Sort
Input [1]: [d_date_sk#9]
Arguments: [d_date_sk#9 ASC NULLS FIRST], false, 0

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

(87) Project
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Input [9]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, d_date_sk#9]

(88) Exchange
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: hashpartitioning(ss_store_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(89) Sort
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8]
Arguments: [ss_store_sk#5 ASC NULLS FIRST], false, 0

(90) Scan parquet
Output [3]: [s_store_sk#12, s_number_employees#13, s_city#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_number_employees:int,s_city:string>

(91) Filter
Input [3]: [s_store_sk#12, s_number_employees#13, s_city#14]
Condition : (((isnotnull(s_number_employees#13) AND (s_number_employees#13 >= 200)) AND (s_number_employees#13 <= 295)) AND isnotnull(s_store_sk#12))

(92) Project
Output [2]: [s_store_sk#12, s_city#14]
Input [3]: [s_store_sk#12, s_number_employees#13, s_city#14]

(93) Exchange
Input [2]: [s_store_sk#12, s_city#14]
Arguments: hashpartitioning(s_store_sk#12, 100), ENSURE_REQUIREMENTS, [plan_id=13]

(94) Sort
Input [2]: [s_store_sk#12, s_city#14]
Arguments: [s_store_sk#12 ASC NULLS FIRST], false, 0

(95) SortMergeJoin
Left keys [1]: [ss_store_sk#5]
Right keys [1]: [s_store_sk#12]
Join type: Inner
Join condition: None

(96) Project
Output [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Input [9]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_store_sk#5, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_store_sk#12, s_city#14]

(97) Exchange
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: hashpartitioning(ss_hdemo_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=14]

(98) Sort
Input [7]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Arguments: [ss_hdemo_sk#3 ASC NULLS FIRST], false, 0

(99) Scan parquet
Output [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [Or(EqualTo(hd_dep_count,6),GreaterThan(hd_vehicle_count,2)), IsNotNull(hd_demo_sk)]
ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>

(100) Filter
Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
Condition : (((hd_dep_count#16 = 6) OR (hd_vehicle_count#17 > 2)) AND isnotnull(hd_demo_sk#15))

(101) Project
Output [1]: [hd_demo_sk#15]
Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]

(102) Exchange
Input [1]: [hd_demo_sk#15]
Arguments: hashpartitioning(hd_demo_sk#15, 100), ENSURE_REQUIREMENTS, [plan_id=15]

(103) Sort
Input [1]: [hd_demo_sk#15]
Arguments: [hd_demo_sk#15 ASC NULLS FIRST], false, 0

(104) SortMergeJoin
Left keys [1]: [ss_hdemo_sk#3]
Right keys [1]: [hd_demo_sk#15]
Join type: Inner
Join condition: None

(105) Project
Output [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Input [8]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14, hd_demo_sk#15]

(106) HashAggregate
Input [6]: [ss_customer_sk#2, ss_addr_sk#4, ss_ticket_number#6, ss_coupon_amt#7, ss_net_profit#8, s_city#14]
Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14]
Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#7)), partial_sum(UnscaledValue(ss_net_profit#8))]
Aggregate Attributes [2]: [sum#20, sum#21]
Results [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, sum#31, sum#32]

(107) Exchange
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, sum#31, sum#32]
Arguments: hashpartitioning(ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, 100), ENSURE_REQUIREMENTS, [plan_id=16]

(108) HashAggregate
Input [6]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14, sum#31, sum#32]
Keys [4]: [ss_ticket_number#6, ss_customer_sk#2, ss_addr_sk#4, s_city#14]
Functions [2]: [sum(UnscaledValue(ss_coupon_amt#7)), sum(UnscaledValue(ss_net_profit#8))]
Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#7))#23, sum(UnscaledValue(ss_net_profit#8))#24]
Results [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#7))#23,17,2) AS amt#25, MakeDecimal(sum(UnscaledValue(ss_net_profit#8))#24,17,2) AS profit#26]

(109) Exchange
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: hashpartitioning(ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=17]

(110) Sort
Input [5]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(111) Scan parquet
Output [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string>

(112) Filter
Input [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Condition : isnotnull(c_customer_sk#27)

(113) Exchange
Input [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Arguments: hashpartitioning(c_customer_sk#27, 100), ENSURE_REQUIREMENTS, [plan_id=18]

(114) Sort
Input [3]: [c_customer_sk#27, c_first_name#28, c_last_name#29]
Arguments: [c_customer_sk#27 ASC NULLS FIRST], false, 0

(115) SortMergeJoin
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#27]
Join type: Inner
Join condition: None

(116) Project
Output [7]: [c_last_name#29, c_first_name#28, substr(s_city#14, 1, 30) AS substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26, s_city#14]
Input [8]: [ss_ticket_number#6, ss_customer_sk#2, s_city#14, amt#25, profit#26, c_customer_sk#27, c_first_name#28, c_last_name#29]

(117) TakeOrderedAndProject
Input [7]: [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26, s_city#14]
Arguments: X, [c_last_name#29 ASC NULLS FIRST, c_first_name#28 ASC NULLS FIRST, substr(s_city#14, 1, 30) ASC NULLS FIRST, ss_ticket_number#6 ASC NULLS FIRST, profit#26 ASC NULLS FIRST], [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26]

(118) AdaptiveSparkPlan
Output [6]: [c_last_name#29, c_first_name#28, substr(s_city, 1, 30)#30, ss_ticket_number#6, amt#25, profit#26]
Arguments: isFinalPlan=true

