== Physical Plan ==
AdaptiveSparkPlan (111)
+- == Final Plan ==
   NativeProject (69)
   +- NativeHashAggregate (68)
      +- ShuffleQueryStage (67), Statistics(X)
         +- NativeShuffleExchange (66)
            +- NativeHashAggregate (65)
               +- NativeProject (64)
                  +- NativeProject (63)
                     +- NativeSortMergeJoin Inner (62)
                        :- NativeSort (55)
                        :  +- InputAdapter (54)
                        :     +- AQEShuffleRead (53)
                        :        +- ShuffleQueryStage (52), Statistics(X)
                        :           +- NativeShuffleExchange (51)
                        :              +- NativeProject (50)
                        :                 +- NativeSortMergeJoin Inner (49)
                        :                    :- 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 (48)
                        :                       +- NativeFilter (47)
                        :                          +- NativeProject (46)
                        :                             +- NativeHashAggregate (45)
                        :                                +- InputAdapter (44)
                        :                                   +- AQEShuffleRead (43)
                        :                                      +- ShuffleQueryStage (42), Statistics(X)
                        :                                         +- NativeShuffleExchange (41)
                        :                                            +- NativeHashAggregate (40)
                        :                                               +- NativeProject (39)
                        :                                                  +- NativeProject (38)
                        :                                                     +- NativeSortMergeJoin Inner (37)
                        :                                                        :- NativeSort (27)
                        :                                                        :  +- InputAdapter (26)
                        :                                                        :     +- AQEShuffleRead (25)
                        :                                                        :        +- ShuffleQueryStage (24), Statistics(X)
                        :                                                        :           +- NativeShuffleExchange (23)
                        :                                                        :              +- NativeFilter (22)
                        :                                                        :                 +- InputAdapter (21)
                        :                                                        :                    +- NativeParquetScan  (20)
                        :                                                        +- NativeSort (36)
                        :                                                           +- InputAdapter (35)
                        :                                                              +- AQEShuffleRead (34)
                        :                                                                 +- ShuffleQueryStage (33), Statistics(X)
                        :                                                                    +- NativeShuffleExchange (32)
                        :                                                                       +- NativeProject (31)
                        :                                                                          +- NativeFilter (30)
                        :                                                                             +- InputAdapter (29)
                        :                                                                                +- NativeParquetScan  (28)
                        +- NativeSort (61)
                           +- InputAdapter (60)
                              +- InputAdapter (59)
                                 +- AQEShuffleRead (58)
                                    +- ShuffleQueryStage (57), Statistics(X)
                                       +- ReusedExchange (56)
+- == Initial Plan ==
   HashAggregate (110)
   +- Exchange (109)
      +- HashAggregate (108)
         +- Project (107)
            +- SortMergeJoin Inner (106)
               :- Sort (100)
               :  +- Exchange (99)
               :     +- Project (98)
               :        +- SortMergeJoin Inner (97)
               :           :- Project (80)
               :           :  +- SortMergeJoin Inner (79)
               :           :     :- Sort (73)
               :           :     :  +- Exchange (72)
               :           :     :     +- Filter (71)
               :           :     :        +- Scan parquet (70)
               :           :     +- Sort (78)
               :           :        +- Exchange (77)
               :           :           +- Project (76)
               :           :              +- Filter (75)
               :           :                 +- Scan parquet (74)
               :           +- Sort (96)
               :              +- Filter (95)
               :                 +- HashAggregate (94)
               :                    +- Exchange (93)
               :                       +- HashAggregate (92)
               :                          +- Project (91)
               :                             +- SortMergeJoin Inner (90)
               :                                :- Sort (84)
               :                                :  +- Exchange (83)
               :                                :     +- Filter (82)
               :                                :        +- Scan parquet (81)
               :                                +- Sort (89)
               :                                   +- Exchange (88)
               :                                      +- Project (87)
               :                                         +- Filter (86)
               :                                            +- Scan parquet (85)
               +- Sort (105)
                  +- Exchange (104)
                     +- Project (103)
                        +- Filter (102)
                           +- Scan parquet (101)


(70) Scan parquet
Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt), IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_ext_discount_amt:decimal(7,2)>

(2) InputAdapter
Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Arguments: [#1, #2, #3]

(3) NativeFilter
Input [3]: [#1#1, #2#2, #3#3]
Condition : ((isnotnull(ws_item_sk#2) AND isnotnull(ws_ext_discount_amt#3)) AND isnotnull(ws_sold_date_sk#1))

(4) NativeShuffleExchange
Input [3]: [#1#1, #2#2, #3#3]
Arguments: hashpartitioning(ws_item_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=1]

(5) ShuffleQueryStage
Output [3]: [#1#1, #2#2, #3#3]
Arguments: X

(6) AQEShuffleRead
Input [3]: [#1#1, #2#2, #3#3]
Arguments: coalesced

(7) InputAdapter
Input [3]: [#1#1, #2#2, #3#3]

(8) NativeSort
Input [3]: [#1#1, #2#2, #3#3]
Arguments: [ws_item_sk#2 ASC NULLS FIRST], false

(74) Scan parquet
Output [2]: [i_item_sk#4, i_manufact_id#5]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_manufact_id:int>

(10) InputAdapter
Input [2]: [i_item_sk#4, i_manufact_id#5]
Arguments: [#4, #5]

(11) NativeFilter
Input [2]: [#4#4, #5#5]
Condition : ((isnotnull(i_manufact_id#5) AND (i_manufact_id#5 = 350)) AND isnotnull(i_item_sk#4))

(12) NativeProject
Output [1]: [i_item_sk#4]
Input [2]: [#4#4, #5#5]

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

(14) ShuffleQueryStage
Output [1]: [i_item_sk#4]
Arguments: X

(15) AQEShuffleRead
Input [1]: [i_item_sk#4]
Arguments: coalesced

(16) InputAdapter
Input [1]: [i_item_sk#4]

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

(18) NativeSortMergeJoin
Left keys [1]: [ws_item_sk#2]
Right keys [1]: [i_item_sk#4]
Join type: Inner
Join condition: None

(19) NativeProject
Output [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, i_item_sk#4]
Input [4]: [#1#1, #2#2, #3#3, i_item_sk#4]

(81) Scan parquet
Output [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_ext_discount_amt:decimal(7,2)>

(21) InputAdapter
Input [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Arguments: [#6, #7, #8]

(22) NativeFilter
Input [3]: [#6#6, #7#7, #8#8]
Condition : (isnotnull(ws_sold_date_sk#6) AND isnotnull(ws_item_sk#7))

(23) NativeShuffleExchange
Input [3]: [#6#6, #7#7, #8#8]
Arguments: hashpartitioning(ws_sold_date_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(24) ShuffleQueryStage
Output [3]: [#6#6, #7#7, #8#8]
Arguments: X

(25) AQEShuffleRead
Input [3]: [#6#6, #7#7, #8#8]
Arguments: coalesced

(26) InputAdapter
Input [3]: [#6#6, #7#7, #8#8]

(27) NativeSort
Input [3]: [#6#6, #7#7, #8#8]
Arguments: [ws_sold_date_sk#6 ASC NULLS FIRST], false

(85) Scan parquet
Output [2]: [d_date_sk#9, d_date#10]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(29) InputAdapter
Input [2]: [d_date_sk#9, d_date#10]
Arguments: [#9, #10]

(30) NativeFilter
Input [2]: [#9#9, #10#10]
Condition : (((isnotnull(d_date#10) AND (d_date#10 >= 2000-01-27)) AND (d_date#10 <= 2000-04-26)) AND isnotnull(d_date_sk#9))

(31) NativeProject
Output [1]: [d_date_sk#9]
Input [2]: [#9#9, #10#10]

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

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

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

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

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

(37) NativeSortMergeJoin
Left keys [1]: [ws_sold_date_sk#6]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(38) NativeProject
Output [2]: [ws_item_sk#7, ws_ext_discount_amt#8]
Input [4]: [#6#6, #7#7, #8#8, d_date_sk#9]

(39) NativeProject
Output [2]: [ws_item_sk#7 AS ws_item_sk#7, UnscaledValue(ws_ext_discount_amt#8) AS _c1#11]
Input [2]: [ws_item_sk#7, ws_ext_discount_amt#8]

(40) NativeHashAggregate
Input [2]: [ws_item_sk#7, _c1#11]
Keys [1]: [ws_item_sk#7]
Functions [1]: [partial_avg(_c1#11)]
Aggregate Attributes [2]: [sum#12, count#13]
Results [3]: [ws_item_sk#7, #14, #15]

(41) NativeShuffleExchange
Input [3]: [ws_item_sk#7, #14, #15]
Arguments: hashpartitioning(ws_item_sk#7, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(42) ShuffleQueryStage
Output [3]: [ws_item_sk#7, #14, #15]
Arguments: X

(43) AQEShuffleRead
Input [3]: [ws_item_sk#7, #14, #15]
Arguments: coalesced

(44) InputAdapter
Input [3]: [ws_item_sk#7, #14, #15]

(45) NativeHashAggregate
Input [3]: [ws_item_sk#7, #14, #15]
Keys [1]: [ws_item_sk#7]
Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#8))]
Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#8))#16]
Results [2]: [ws_item_sk#7, avg(UnscaledValue(ws_ext_discount_amt#8))#16]

(46) NativeProject
Output [2]: [(1.3 * cast((avg(UnscaledValue(ws_ext_discount_amt#8))#16 / 100.0) as decimal(11,6))) AS (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]
Input [2]: [ws_item_sk#7, avg(UnscaledValue(ws_ext_discount_amt#8))#16]

(47) NativeFilter
Input [2]: [(1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]
Condition : isnotnull((1.3 * avg(ws_ext_discount_amt))#17)

(48) NativeSort
Input [2]: [(1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]
Arguments: [ws_item_sk#7 ASC NULLS FIRST], false

(49) NativeSortMergeJoin
Left keys [1]: [i_item_sk#4]
Right keys [1]: [ws_item_sk#7]
Join type: Inner
Join condition: (cast(ws_ext_discount_amt#3 as decimal(14,7)) > (1.3 * avg(ws_ext_discount_amt))#17)

(50) NativeProject
Output [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Input [5]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, i_item_sk#4, (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]

(51) NativeShuffleExchange
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: hashpartitioning(ws_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=6]

(52) ShuffleQueryStage
Output [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: X

(53) AQEShuffleRead
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: coalesced

(54) InputAdapter
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]

(55) NativeSort
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: [ws_sold_date_sk#1 ASC NULLS FIRST], false

(56) ReusedExchange [Reuses operator id: 32]
Output [1]: [d_date_sk#18]

(57) ShuffleQueryStage
Output [1]: [d_date_sk#18]
Arguments: X

(58) AQEShuffleRead
Input [1]: [d_date_sk#18]
Arguments: coalesced

(59) InputAdapter
Input [1]: [d_date_sk#18]
Arguments: [#18]

(60) InputAdapter
Input [1]: [#18#18]

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

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

(63) NativeProject
Output [1]: [ws_ext_discount_amt#3]
Input [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, #18#18]

(64) NativeProject
Output [1]: [UnscaledValue(ws_ext_discount_amt#3) AS _c0#19]
Input [1]: [ws_ext_discount_amt#3]

(65) NativeHashAggregate
Input [1]: [_c0#19]
Keys: []
Functions [1]: [partial_sum(_c0#19)]
Aggregate Attributes [1]: [sum#20]
Results [1]: [#15]

(66) NativeShuffleExchange
Input [1]: [#15]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=7]

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

(68) NativeHashAggregate
Input [1]: [#15]
Keys: []
Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#21]
Results [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#21]

(69) NativeProject
Output [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#3))#21,17,2) AS Excess Discount Amount #22]
Input [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#21]

(70) Scan parquet
Output [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt), IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_ext_discount_amt:decimal(7,2)>

(71) Filter
Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Condition : ((isnotnull(ws_item_sk#2) AND isnotnull(ws_ext_discount_amt#3)) AND isnotnull(ws_sold_date_sk#1))

(72) Exchange
Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Arguments: hashpartitioning(ws_item_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(73) Sort
Input [3]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3]
Arguments: [ws_item_sk#2 ASC NULLS FIRST], false, 0

(74) Scan parquet
Output [2]: [i_item_sk#4, i_manufact_id#5]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_manufact_id:int>

(75) Filter
Input [2]: [i_item_sk#4, i_manufact_id#5]
Condition : ((isnotnull(i_manufact_id#5) AND (i_manufact_id#5 = 350)) AND isnotnull(i_item_sk#4))

(76) Project
Output [1]: [i_item_sk#4]
Input [2]: [i_item_sk#4, i_manufact_id#5]

(77) Exchange
Input [1]: [i_item_sk#4]
Arguments: hashpartitioning(i_item_sk#4, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(78) Sort
Input [1]: [i_item_sk#4]
Arguments: [i_item_sk#4 ASC NULLS FIRST], false, 0

(79) SortMergeJoin
Left keys [1]: [ws_item_sk#2]
Right keys [1]: [i_item_sk#4]
Join type: Inner
Join condition: None

(80) Project
Output [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, i_item_sk#4]
Input [4]: [ws_sold_date_sk#1, ws_item_sk#2, ws_ext_discount_amt#3, i_item_sk#4]

(81) Scan parquet
Output [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ws_sold_date_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_item_sk:int,ws_ext_discount_amt:decimal(7,2)>

(82) Filter
Input [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Condition : (isnotnull(ws_sold_date_sk#6) AND isnotnull(ws_item_sk#7))

(83) Exchange
Input [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Arguments: hashpartitioning(ws_sold_date_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(84) Sort
Input [3]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8]
Arguments: [ws_sold_date_sk#6 ASC NULLS FIRST], false, 0

(85) Scan parquet
Output [2]: [d_date_sk#9, d_date#10]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(86) Filter
Input [2]: [d_date_sk#9, d_date#10]
Condition : (((isnotnull(d_date#10) AND (d_date#10 >= 2000-01-27)) AND (d_date#10 <= 2000-04-26)) AND isnotnull(d_date_sk#9))

(87) Project
Output [1]: [d_date_sk#9]
Input [2]: [d_date_sk#9, d_date#10]

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

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

(90) SortMergeJoin
Left keys [1]: [ws_sold_date_sk#6]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(91) Project
Output [2]: [ws_item_sk#7, ws_ext_discount_amt#8]
Input [4]: [ws_sold_date_sk#6, ws_item_sk#7, ws_ext_discount_amt#8, d_date_sk#9]

(92) HashAggregate
Input [2]: [ws_item_sk#7, ws_ext_discount_amt#8]
Keys [1]: [ws_item_sk#7]
Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#8))]
Aggregate Attributes [2]: [sum#12, count#13]
Results [3]: [ws_item_sk#7, sum#23, count#24]

(93) Exchange
Input [3]: [ws_item_sk#7, sum#23, count#24]
Arguments: hashpartitioning(ws_item_sk#7, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(94) HashAggregate
Input [3]: [ws_item_sk#7, sum#23, count#24]
Keys [1]: [ws_item_sk#7]
Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#8))]
Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#8))#16]
Results [2]: [(1.3 * cast((avg(UnscaledValue(ws_ext_discount_amt#8))#16 / 100.0) as decimal(11,6))) AS (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]

(95) Filter
Input [2]: [(1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]
Condition : isnotnull((1.3 * avg(ws_ext_discount_amt))#17)

(96) Sort
Input [2]: [(1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]
Arguments: [ws_item_sk#7 ASC NULLS FIRST], false, 0

(97) SortMergeJoin
Left keys [1]: [i_item_sk#4]
Right keys [1]: [ws_item_sk#7]
Join type: Inner
Join condition: (cast(ws_ext_discount_amt#3 as decimal(14,7)) > (1.3 * avg(ws_ext_discount_amt))#17)

(98) Project
Output [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Input [5]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, i_item_sk#4, (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#7]

(99) Exchange
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: hashpartitioning(ws_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=13]

(100) Sort
Input [2]: [ws_sold_date_sk#1, ws_ext_discount_amt#3]
Arguments: [ws_sold_date_sk#1 ASC NULLS FIRST], false, 0

(101) Scan parquet
Output [2]: [d_date_sk#18, d_date#25]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(102) Filter
Input [2]: [d_date_sk#18, d_date#25]
Condition : (((isnotnull(d_date#25) AND (d_date#25 >= 2000-01-27)) AND (d_date#25 <= 2000-04-26)) AND isnotnull(d_date_sk#18))

(103) Project
Output [1]: [d_date_sk#18]
Input [2]: [d_date_sk#18, d_date#25]

(104) Exchange
Input [1]: [d_date_sk#18]
Arguments: hashpartitioning(d_date_sk#18, 100), ENSURE_REQUIREMENTS, [plan_id=14]

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

(106) SortMergeJoin
Left keys [1]: [ws_sold_date_sk#1]
Right keys [1]: [d_date_sk#18]
Join type: Inner
Join condition: None

(107) Project
Output [1]: [ws_ext_discount_amt#3]
Input [3]: [ws_sold_date_sk#1, ws_ext_discount_amt#3, d_date_sk#18]

(108) HashAggregate
Input [1]: [ws_ext_discount_amt#3]
Keys: []
Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#3))]
Aggregate Attributes [1]: [sum#20]
Results [1]: [sum#26]

(109) Exchange
Input [1]: [sum#26]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]

(110) HashAggregate
Input [1]: [sum#26]
Keys: []
Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#3))#21]
Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#3))#21,17,2) AS Excess Discount Amount #22]

(111) AdaptiveSparkPlan
Output [1]: [Excess Discount Amount #22]
Arguments: isFinalPlan=true

