== Physical Plan ==
AdaptiveSparkPlan (90)
+- == Final Plan ==
   NativeTakeOrdered (58)
   +- NativeProject (57)
      +- NativeHashAggregate (56)
         +- InputAdapter (55)
            +- AQEShuffleRead (54)
               +- ShuffleQueryStage (53), Statistics(X)
                  +- NativeShuffleExchange (52)
                     +- NativeHashAggregate (51)
                        +- NativeProject (50)
                           +- NativeProject (49)
                              +- NativeSortMergeJoin Inner (48)
                                 :- NativeSort (38)
                                 :  +- InputAdapter (37)
                                 :     +- AQEShuffleRead (36)
                                 :        +- ShuffleQueryStage (35), Statistics(X)
                                 :           +- NativeShuffleExchange (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 (47)
                                    +- InputAdapter (46)
                                       +- AQEShuffleRead (45)
                                          +- ShuffleQueryStage (44), Statistics(X)
                                             +- NativeShuffleExchange (43)
                                                +- NativeProject (42)
                                                   +- NativeFilter (41)
                                                      +- InputAdapter (40)
                                                         +- NativeParquetScan  (39)
+- == Initial Plan ==
   TakeOrderedAndProject (89)
   +- HashAggregate (88)
      +- Exchange (87)
         +- HashAggregate (86)
            +- Project (85)
               +- SortMergeJoin Inner (84)
                  :- Sort (78)
                  :  +- Exchange (77)
                  :     +- Project (76)
                  :        +- SortMergeJoin Inner (75)
                  :           :- Sort (70)
                  :           :  +- Exchange (69)
                  :           :     +- Project (68)
                  :           :        +- SortMergeJoin Inner (67)
                  :           :           :- Sort (62)
                  :           :           :  +- Exchange (61)
                  :           :           :     +- Filter (60)
                  :           :           :        +- Scan parquet (59)
                  :           :           +- Sort (66)
                  :           :              +- Exchange (65)
                  :           :                 +- Filter (64)
                  :           :                    +- Scan parquet (63)
                  :           +- Sort (74)
                  :              +- Exchange (73)
                  :                 +- Filter (72)
                  :                    +- Scan parquet (71)
                  +- Sort (83)
                     +- Exchange (82)
                        +- Project (81)
                           +- Filter (80)
                              +- Scan parquet (79)


(59) Scan parquet
Output [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_bill_customer_sk:int,cs_sales_price:decimal(7,2)>

(2) InputAdapter
Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Arguments: [#1, #2, #3]

(3) NativeFilter
Input [3]: [#1#1, #2#2, #3#3]
Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1))

(4) NativeShuffleExchange
Input [3]: [#1#1, #2#2, #3#3]
Arguments: hashpartitioning(cs_bill_customer_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: [cs_bill_customer_sk#2 ASC NULLS FIRST], false

(63) Scan parquet
Output [2]: [c_customer_sk#4, c_current_addr_sk#5]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>

(10) InputAdapter
Input [2]: [c_customer_sk#4, c_current_addr_sk#5]
Arguments: [#4, #5]

(11) NativeFilter
Input [2]: [#4#4, #5#5]
Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5))

(12) NativeShuffleExchange
Input [2]: [#4#4, #5#5]
Arguments: hashpartitioning(c_customer_sk#4, 100), ENSURE_REQUIREMENTS, [plan_id=2]

(13) ShuffleQueryStage
Output [2]: [#4#4, #5#5]
Arguments: X

(14) AQEShuffleRead
Input [2]: [#4#4, #5#5]
Arguments: coalesced

(15) InputAdapter
Input [2]: [#4#4, #5#5]

(16) NativeSort
Input [2]: [#4#4, #5#5]
Arguments: [c_customer_sk#4 ASC NULLS FIRST], false

(17) NativeSortMergeJoin
Left keys [1]: [cs_bill_customer_sk#2]
Right keys [1]: [c_customer_sk#4]
Join type: Inner
Join condition: None

(18) NativeProject
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Input [5]: [#1#1, #2#2, #3#3, #4#4, #5#5]

(19) NativeShuffleExchange
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: hashpartitioning(c_current_addr_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(20) ShuffleQueryStage
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: X

(21) AQEShuffleRead
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: coalesced

(22) InputAdapter
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]

(23) NativeSort
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false

(71) Scan parquet
Output [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_zip:string>

(25) InputAdapter
Input [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Arguments: [#6, #7, #8]

(26) NativeFilter
Input [3]: [#6#6, #7#7, #8#8]
Condition : isnotnull(ca_address_sk#6)

(27) NativeShuffleExchange
Input [3]: [#6#6, #7#7, #8#8]
Arguments: hashpartitioning(ca_address_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=4]

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

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

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

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

(32) NativeSortMergeJoin
Left keys [1]: [c_current_addr_sk#5]
Right keys [1]: [ca_address_sk#6]
Join type: Inner
Join condition: ((substr(ca_zip#8, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#7 IN (CA,WA,GA)) OR (cs_sales_price#3 > 500.00))

(33) NativeProject
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Input [6]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5, #6#6, #7#7, #8#8]

(34) NativeShuffleExchange
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: hashpartitioning(cs_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(35) ShuffleQueryStage
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: X

(36) AQEShuffleRead
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: coalesced

(37) InputAdapter
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]

(38) NativeSort
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: [cs_sold_date_sk#1 ASC NULLS FIRST], false

(79) Scan parquet
Output [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

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

(41) NativeFilter
Input [3]: [#9#9, #10#10, #11#11]
Condition : ((((isnotnull(d_qoy#11) AND isnotnull(d_year#10)) AND (d_qoy#11 = 2)) AND (d_year#10 = 2001)) AND isnotnull(d_date_sk#9))

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

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

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

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

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

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

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

(49) NativeProject
Output [2]: [cs_sales_price#3, ca_zip#8]
Input [4]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8, d_date_sk#9]

(50) NativeProject
Output [2]: [ca_zip#8 AS ca_zip#8, UnscaledValue(cs_sales_price#3) AS _c1#12]
Input [2]: [cs_sales_price#3, ca_zip#8]

(51) NativeHashAggregate
Input [2]: [ca_zip#8, _c1#12]
Keys [1]: [ca_zip#8]
Functions [1]: [partial_sum(_c1#12)]
Aggregate Attributes [1]: [sum#13]
Results [2]: [ca_zip#8, #14]

(52) NativeShuffleExchange
Input [2]: [ca_zip#8, #14]
Arguments: hashpartitioning(ca_zip#8, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(53) ShuffleQueryStage
Output [2]: [ca_zip#8, #14]
Arguments: X

(54) AQEShuffleRead
Input [2]: [ca_zip#8, #14]
Arguments: coalesced

(55) InputAdapter
Input [2]: [ca_zip#8, #14]

(56) NativeHashAggregate
Input [2]: [ca_zip#8, #14]
Keys [1]: [ca_zip#8]
Functions [1]: [sum(UnscaledValue(cs_sales_price#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#15]
Results [2]: [ca_zip#8, sum(UnscaledValue(cs_sales_price#3))#15]

(57) NativeProject
Output [2]: [ca_zip#8, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#15,17,2) AS sum(cs_sales_price)#16]
Input [2]: [ca_zip#8, sum(UnscaledValue(cs_sales_price#3))#15]

(58) NativeTakeOrdered
Input [2]: [ca_zip#8, sum(cs_sales_price)#16]
Arguments: X, X, [ca_zip#8 ASC NULLS FIRST]

(59) Scan parquet
Output [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_bill_customer_sk:int,cs_sales_price:decimal(7,2)>

(60) Filter
Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Condition : (isnotnull(cs_bill_customer_sk#2) AND isnotnull(cs_sold_date_sk#1))

(61) Exchange
Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Arguments: hashpartitioning(cs_bill_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(62) Sort
Input [3]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3]
Arguments: [cs_bill_customer_sk#2 ASC NULLS FIRST], false, 0

(63) Scan parquet
Output [2]: [c_customer_sk#4, c_current_addr_sk#5]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>

(64) Filter
Input [2]: [c_customer_sk#4, c_current_addr_sk#5]
Condition : (isnotnull(c_customer_sk#4) AND isnotnull(c_current_addr_sk#5))

(65) Exchange
Input [2]: [c_customer_sk#4, c_current_addr_sk#5]
Arguments: hashpartitioning(c_customer_sk#4, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(66) Sort
Input [2]: [c_customer_sk#4, c_current_addr_sk#5]
Arguments: [c_customer_sk#4 ASC NULLS FIRST], false, 0

(67) SortMergeJoin
Left keys [1]: [cs_bill_customer_sk#2]
Right keys [1]: [c_customer_sk#4]
Join type: Inner
Join condition: None

(68) Project
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Input [5]: [cs_sold_date_sk#1, cs_bill_customer_sk#2, cs_sales_price#3, c_customer_sk#4, c_current_addr_sk#5]

(69) Exchange
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: hashpartitioning(c_current_addr_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(70) Sort
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5]
Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0

(71) Scan parquet
Output [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_zip:string>

(72) Filter
Input [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Condition : isnotnull(ca_address_sk#6)

(73) Exchange
Input [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Arguments: hashpartitioning(ca_address_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(74) Sort
Input [3]: [ca_address_sk#6, ca_state#7, ca_zip#8]
Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0

(75) SortMergeJoin
Left keys [1]: [c_current_addr_sk#5]
Right keys [1]: [ca_address_sk#6]
Join type: Inner
Join condition: ((substr(ca_zip#8, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#7 IN (CA,WA,GA)) OR (cs_sales_price#3 > 500.00))

(76) Project
Output [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Input [6]: [cs_sold_date_sk#1, cs_sales_price#3, c_current_addr_sk#5, ca_address_sk#6, ca_state#7, ca_zip#8]

(77) Exchange
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: hashpartitioning(cs_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(78) Sort
Input [3]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8]
Arguments: [cs_sold_date_sk#1 ASC NULLS FIRST], false, 0

(79) Scan parquet
Output [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

(80) Filter
Input [3]: [d_date_sk#9, d_year#10, d_qoy#11]
Condition : ((((isnotnull(d_qoy#11) AND isnotnull(d_year#10)) AND (d_qoy#11 = 2)) AND (d_year#10 = 2001)) AND isnotnull(d_date_sk#9))

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

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

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

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

(85) Project
Output [2]: [cs_sales_price#3, ca_zip#8]
Input [4]: [cs_sold_date_sk#1, cs_sales_price#3, ca_zip#8, d_date_sk#9]

(86) HashAggregate
Input [2]: [cs_sales_price#3, ca_zip#8]
Keys [1]: [ca_zip#8]
Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#3))]
Aggregate Attributes [1]: [sum#13]
Results [2]: [ca_zip#8, sum#17]

(87) Exchange
Input [2]: [ca_zip#8, sum#17]
Arguments: hashpartitioning(ca_zip#8, 100), ENSURE_REQUIREMENTS, [plan_id=14]

(88) HashAggregate
Input [2]: [ca_zip#8, sum#17]
Keys [1]: [ca_zip#8]
Functions [1]: [sum(UnscaledValue(cs_sales_price#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#15]
Results [2]: [ca_zip#8, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#15,17,2) AS sum(cs_sales_price)#16]

(89) TakeOrderedAndProject
Input [2]: [ca_zip#8, sum(cs_sales_price)#16]
Arguments: X, [ca_zip#8 ASC NULLS FIRST], [ca_zip#8, sum(cs_sales_price)#16]

(90) AdaptiveSparkPlan
Output [2]: [ca_zip#8, sum(cs_sales_price)#16]
Arguments: isFinalPlan=true

