== Physical Plan ==
AdaptiveSparkPlan (146)
+- == Final Plan ==
   NativeProject (94)
   +- NativeTakeOrdered (93)
      +- NativeFilter (92)
         +- NativeProject (91)
            +- NativeHashAggregate (90)
               +- InputAdapter (89)
                  +- AQEShuffleRead (88)
                     +- ShuffleQueryStage (87), Statistics(X)
                        +- NativeShuffleExchange (86)
                           +- NativeHashAggregate (85)
                              +- NativeProject (84)
                                 +- NativeSortMergeJoin Inner (83)
                                    :- NativeSort (54)
                                    :  +- InputAdapter (53)
                                    :     +- AQEShuffleRead (52)
                                    :        +- ShuffleQueryStage (51), Statistics(X)
                                    :           +- NativeShuffleExchange (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)
                                    +- NativeSort (82)
                                       +- InputAdapter (81)
                                          +- AQEShuffleRead (80)
                                             +- ShuffleQueryStage (79), Statistics(X)
                                                +- NativeShuffleExchange (78)
                                                   +- NativeProject (77)
                                                      +- NativeSortMergeJoin Inner (76)
                                                         :- NativeSort (62)
                                                         :  +- InputAdapter (61)
                                                         :     +- AQEShuffleRead (60)
                                                         :        +- ShuffleQueryStage (59), Statistics(X)
                                                         :           +- NativeShuffleExchange (58)
                                                         :              +- NativeFilter (57)
                                                         :                 +- InputAdapter (56)
                                                         :                    +- NativeParquetScan  (55)
                                                         +- NativeSort (75)
                                                            +- NativeFilter (74)
                                                               +- NativeProject (73)
                                                                  +- NativeHashAggregate (72)
                                                                     +- InputAdapter (71)
                                                                        +- AQEShuffleRead (70)
                                                                           +- ShuffleQueryStage (69), Statistics(X)
                                                                              +- NativeShuffleExchange (68)
                                                                                 +- NativeHashAggregate (67)
                                                                                    +- NativeProject (66)
                                                                                       +- NativeFilter (65)
                                                                                          +- InputAdapter (64)
                                                                                             +- NativeParquetScan  (63)
+- == Initial Plan ==
   TakeOrderedAndProject (145)
   +- Filter (144)
      +- HashAggregate (143)
         +- Exchange (142)
            +- HashAggregate (141)
               +- Project (140)
                  +- SortMergeJoin Inner (139)
                     :- Sort (123)
                     :  +- Exchange (122)
                     :     +- Project (121)
                     :        +- SortMergeJoin Inner (120)
                     :           :- Sort (114)
                     :           :  +- Exchange (113)
                     :           :     +- Project (112)
                     :           :        +- SortMergeJoin Inner (111)
                     :           :           :- Sort (106)
                     :           :           :  +- Exchange (105)
                     :           :           :     +- Project (104)
                     :           :           :        +- SortMergeJoin Inner (103)
                     :           :           :           :- Sort (98)
                     :           :           :           :  +- Exchange (97)
                     :           :           :           :     +- Filter (96)
                     :           :           :           :        +- Scan parquet (95)
                     :           :           :           +- Sort (102)
                     :           :           :              +- Exchange (101)
                     :           :           :                 +- Filter (100)
                     :           :           :                    +- Scan parquet (99)
                     :           :           +- Sort (110)
                     :           :              +- Exchange (109)
                     :           :                 +- Filter (108)
                     :           :                    +- Scan parquet (107)
                     :           +- Sort (119)
                     :              +- Exchange (118)
                     :                 +- Project (117)
                     :                    +- Filter (116)
                     :                       +- Scan parquet (115)
                     +- Sort (138)
                        +- Exchange (137)
                           +- Project (136)
                              +- SortMergeJoin Inner (135)
                                 :- Sort (127)
                                 :  +- Exchange (126)
                                 :     +- Filter (125)
                                 :        +- Scan parquet (124)
                                 +- Sort (134)
                                    +- Filter (133)
                                       +- HashAggregate (132)
                                          +- Exchange (131)
                                             +- HashAggregate (130)
                                                +- Filter (129)
                                                   +- Scan parquet (128)


(95) Scan parquet
Output [2]: [ca_address_sk#1, ca_state#2]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(2) InputAdapter
Input [2]: [ca_address_sk#1, ca_state#2]
Arguments: [#1, #2]

(3) NativeFilter
Input [2]: [#1#1, #2#2]
Condition : isnotnull(ca_address_sk#1)

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

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

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

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

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

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

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

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

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

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

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

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

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

(17) NativeSortMergeJoin
Left keys [1]: [ca_address_sk#1]
Right keys [1]: [c_current_addr_sk#4]
Join type: Inner
Join condition: None

(18) NativeProject
Output [2]: [ca_state#2, c_customer_sk#3]
Input [4]: [#1#1, #2#2, #3#3, #4#4]

(19) NativeShuffleExchange
Input [2]: [ca_state#2, c_customer_sk#3]
Arguments: hashpartitioning(c_customer_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(20) ShuffleQueryStage
Output [2]: [ca_state#2, c_customer_sk#3]
Arguments: X

(21) AQEShuffleRead
Input [2]: [ca_state#2, c_customer_sk#3]
Arguments: coalesced

(22) InputAdapter
Input [2]: [ca_state#2, c_customer_sk#3]

(23) NativeSort
Input [2]: [ca_state#2, c_customer_sk#3]
Arguments: [c_customer_sk#3 ASC NULLS FIRST], false

(107) Scan parquet
Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int,ss_customer_sk:int>

(25) InputAdapter
Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Arguments: [#5, #6, #7]

(26) NativeFilter
Input [3]: [#5#5, #6#6, #7#7]
Condition : ((isnotnull(ss_customer_sk#7) AND isnotnull(ss_sold_date_sk#5)) AND isnotnull(ss_item_sk#6))

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

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

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

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

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

(32) NativeSortMergeJoin
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ss_customer_sk#7]
Join type: Inner
Join condition: None

(33) NativeProject
Output [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Input [5]: [ca_state#2, c_customer_sk#3, #5#5, #6#6, #7#7]

(34) NativeShuffleExchange
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: hashpartitioning(ss_sold_date_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(35) ShuffleQueryStage
Output [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: X

(36) AQEShuffleRead
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: coalesced

(37) InputAdapter
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]

(38) NativeSort
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: [ss_sold_date_sk#5 ASC NULLS FIRST], false

(115) Scan parquet
Output [2]: [d_date_sk#8, d_month_seq#9]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_month_seq:int>

(40) InputAdapter
Input [2]: [d_date_sk#8, d_month_seq#9]
Arguments: [#8, #9]

(41) NativeFilter
Input [2]: [#8#8, #9#9]
Condition : ((isnotnull(d_month_seq#9) AND (d_month_seq#9 = Subquery subquery#10, [id=#11])) AND isnotnull(d_date_sk#8))

(42) NativeProject
Output [1]: [d_date_sk#8]
Input [2]: [#8#8, #9#9]

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

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

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

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

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

(48) NativeSortMergeJoin
Left keys [1]: [ss_sold_date_sk#5]
Right keys [1]: [d_date_sk#8]
Join type: Inner
Join condition: None

(49) NativeProject
Output [2]: [ca_state#2, ss_item_sk#6]
Input [4]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6, d_date_sk#8]

(50) NativeShuffleExchange
Input [2]: [ca_state#2, ss_item_sk#6]
Arguments: hashpartitioning(ss_item_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(51) ShuffleQueryStage
Output [2]: [ca_state#2, ss_item_sk#6]
Arguments: X

(52) AQEShuffleRead
Input [2]: [ca_state#2, ss_item_sk#6]
Arguments: coalesced

(53) InputAdapter
Input [2]: [ca_state#2, ss_item_sk#6]

(54) NativeSort
Input [2]: [ca_state#2, ss_item_sk#6]
Arguments: [ss_item_sk#6 ASC NULLS FIRST], false

(124) Scan parquet
Output [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_category), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_category:string>

(56) InputAdapter
Input [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Arguments: [#12, #13, #14]

(57) NativeFilter
Input [3]: [#12#12, #13#13, #14#14]
Condition : ((isnotnull(i_current_price#13) AND isnotnull(i_category#14)) AND isnotnull(i_item_sk#12))

(58) NativeShuffleExchange
Input [3]: [#12#12, #13#13, #14#14]
Arguments: hashpartitioning(i_category#14, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(59) ShuffleQueryStage
Output [3]: [#12#12, #13#13, #14#14]
Arguments: X

(60) AQEShuffleRead
Input [3]: [#12#12, #13#13, #14#14]
Arguments: coalesced

(61) InputAdapter
Input [3]: [#12#12, #13#13, #14#14]

(62) NativeSort
Input [3]: [#12#12, #13#13, #14#14]
Arguments: [i_category#14 ASC NULLS FIRST], false

(128) Scan parquet
Output [2]: [i_current_price#15, i_category#16]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_category)]
ReadSchema: struct<i_current_price:decimal(7,2),i_category:string>

(64) InputAdapter
Input [2]: [i_current_price#15, i_category#16]
Arguments: [#15, #16]

(65) NativeFilter
Input [2]: [#15#15, #16#16]
Condition : isnotnull(i_category#16)

(66) NativeProject
Output [2]: [i_category#16 AS i_category#16, UnscaledValue(i_current_price#15) AS _c1#17]
Input [2]: [#15#15, #16#16]

(67) NativeHashAggregate
Input [2]: [i_category#16, _c1#17]
Keys [1]: [i_category#16]
Functions [1]: [partial_avg(_c1#17)]
Aggregate Attributes [2]: [sum#18, count#19]
Results [3]: [i_category#16, #20, #21]

(68) NativeShuffleExchange
Input [3]: [i_category#16, #20, #21]
Arguments: hashpartitioning(i_category#16, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(69) ShuffleQueryStage
Output [3]: [i_category#16, #20, #21]
Arguments: X

(70) AQEShuffleRead
Input [3]: [i_category#16, #20, #21]
Arguments: coalesced

(71) InputAdapter
Input [3]: [i_category#16, #20, #21]

(72) NativeHashAggregate
Input [3]: [i_category#16, #20, #21]
Keys [1]: [i_category#16]
Functions [1]: [avg(UnscaledValue(i_current_price#15))]
Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#15))#22]
Results [2]: [i_category#16, avg(UnscaledValue(i_current_price#15))#22]

(73) NativeProject
Output [2]: [cast((avg(UnscaledValue(i_current_price#15))#22 / 100.0) as decimal(11,6)) AS avg(i_current_price)#23, i_category#16]
Input [2]: [i_category#16, avg(UnscaledValue(i_current_price#15))#22]

(74) NativeFilter
Input [2]: [avg(i_current_price)#23, i_category#16]
Condition : isnotnull(avg(i_current_price)#23)

(75) NativeSort
Input [2]: [avg(i_current_price)#23, i_category#16]
Arguments: [i_category#16 ASC NULLS FIRST], false

(76) NativeSortMergeJoin
Left keys [1]: [i_category#14]
Right keys [1]: [i_category#16]
Join type: Inner
Join condition: (cast(i_current_price#13 as decimal(14,7)) > (1.2 * avg(i_current_price)#23))

(77) NativeProject
Output [1]: [i_item_sk#12]
Input [5]: [#12#12, #13#13, #14#14, avg(i_current_price)#23, i_category#16]

(78) NativeShuffleExchange
Input [1]: [i_item_sk#12]
Arguments: hashpartitioning(i_item_sk#12, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(79) ShuffleQueryStage
Output [1]: [i_item_sk#12]
Arguments: X

(80) AQEShuffleRead
Input [1]: [i_item_sk#12]
Arguments: coalesced

(81) InputAdapter
Input [1]: [i_item_sk#12]

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

(83) NativeSortMergeJoin
Left keys [1]: [ss_item_sk#6]
Right keys [1]: [i_item_sk#12]
Join type: Inner
Join condition: None

(84) NativeProject
Output [1]: [ca_state#2]
Input [3]: [ca_state#2, ss_item_sk#6, i_item_sk#12]

(85) NativeHashAggregate
Input [1]: [ca_state#2]
Keys [1]: [ca_state#2]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#24]
Results [2]: [ca_state#2, #21]

(86) NativeShuffleExchange
Input [2]: [ca_state#2, #21]
Arguments: hashpartitioning(ca_state#2, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(87) ShuffleQueryStage
Output [2]: [ca_state#2, #21]
Arguments: X

(88) AQEShuffleRead
Input [2]: [ca_state#2, #21]
Arguments: coalesced

(89) InputAdapter
Input [2]: [ca_state#2, #21]

(90) NativeHashAggregate
Input [2]: [ca_state#2, #21]
Keys [1]: [ca_state#2]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#25]
Results [2]: [ca_state#2, count(1)#25]

(91) NativeProject
Output [3]: [ca_state#2 AS state#26, count(1)#25 AS cnt#27, ca_state#2]
Input [2]: [ca_state#2, count(1)#25]

(92) NativeFilter
Input [3]: [state#26, cnt#27, ca_state#2]
Condition : (cnt#27 >= 10)

(93) NativeTakeOrdered
Input [3]: [state#26, cnt#27, ca_state#2]
Arguments: X, X, [cnt#27 ASC NULLS FIRST, ca_state#2 ASC NULLS FIRST]

(94) NativeProject
Output [2]: [state#26, cnt#27]
Input [3]: [state#26, cnt#27, ca_state#2]

(95) Scan parquet
Output [2]: [ca_address_sk#1, ca_state#2]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_state:string>

(96) Filter
Input [2]: [ca_address_sk#1, ca_state#2]
Condition : isnotnull(ca_address_sk#1)

(97) Exchange
Input [2]: [ca_address_sk#1, ca_state#2]
Arguments: hashpartitioning(ca_address_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(98) Sort
Input [2]: [ca_address_sk#1, ca_state#2]
Arguments: [ca_address_sk#1 ASC NULLS FIRST], false, 0

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

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

(101) Exchange
Input [2]: [c_customer_sk#3, c_current_addr_sk#4]
Arguments: hashpartitioning(c_current_addr_sk#4, 100), ENSURE_REQUIREMENTS, [plan_id=13]

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

(103) SortMergeJoin
Left keys [1]: [ca_address_sk#1]
Right keys [1]: [c_current_addr_sk#4]
Join type: Inner
Join condition: None

(104) Project
Output [2]: [ca_state#2, c_customer_sk#3]
Input [4]: [ca_address_sk#1, ca_state#2, c_customer_sk#3, c_current_addr_sk#4]

(105) Exchange
Input [2]: [ca_state#2, c_customer_sk#3]
Arguments: hashpartitioning(c_customer_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=14]

(106) Sort
Input [2]: [ca_state#2, c_customer_sk#3]
Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0

(107) Scan parquet
Output [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_sold_date_sk), IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_sold_date_sk:int,ss_item_sk:int,ss_customer_sk:int>

(108) Filter
Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Condition : ((isnotnull(ss_customer_sk#7) AND isnotnull(ss_sold_date_sk#5)) AND isnotnull(ss_item_sk#6))

(109) Exchange
Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Arguments: hashpartitioning(ss_customer_sk#7, 100), ENSURE_REQUIREMENTS, [plan_id=15]

(110) Sort
Input [3]: [ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]
Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0

(111) SortMergeJoin
Left keys [1]: [c_customer_sk#3]
Right keys [1]: [ss_customer_sk#7]
Join type: Inner
Join condition: None

(112) Project
Output [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Input [5]: [ca_state#2, c_customer_sk#3, ss_sold_date_sk#5, ss_item_sk#6, ss_customer_sk#7]

(113) Exchange
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: hashpartitioning(ss_sold_date_sk#5, 100), ENSURE_REQUIREMENTS, [plan_id=16]

(114) Sort
Input [3]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6]
Arguments: [ss_sold_date_sk#5 ASC NULLS FIRST], false, 0

(115) Scan parquet
Output [2]: [d_date_sk#8, d_month_seq#9]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_month_seq:int>

(116) Filter
Input [2]: [d_date_sk#8, d_month_seq#9]
Condition : ((isnotnull(d_month_seq#9) AND (d_month_seq#9 = Subquery subquery#10, [id=#11])) AND isnotnull(d_date_sk#8))

(117) Project
Output [1]: [d_date_sk#8]
Input [2]: [d_date_sk#8, d_month_seq#9]

(118) Exchange
Input [1]: [d_date_sk#8]
Arguments: hashpartitioning(d_date_sk#8, 100), ENSURE_REQUIREMENTS, [plan_id=17]

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

(120) SortMergeJoin
Left keys [1]: [ss_sold_date_sk#5]
Right keys [1]: [d_date_sk#8]
Join type: Inner
Join condition: None

(121) Project
Output [2]: [ca_state#2, ss_item_sk#6]
Input [4]: [ca_state#2, ss_sold_date_sk#5, ss_item_sk#6, d_date_sk#8]

(122) Exchange
Input [2]: [ca_state#2, ss_item_sk#6]
Arguments: hashpartitioning(ss_item_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=18]

(123) Sort
Input [2]: [ca_state#2, ss_item_sk#6]
Arguments: [ss_item_sk#6 ASC NULLS FIRST], false, 0

(124) Scan parquet
Output [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_category), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_category:string>

(125) Filter
Input [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Condition : ((isnotnull(i_current_price#13) AND isnotnull(i_category#14)) AND isnotnull(i_item_sk#12))

(126) Exchange
Input [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Arguments: hashpartitioning(i_category#14, 100), ENSURE_REQUIREMENTS, [plan_id=19]

(127) Sort
Input [3]: [i_item_sk#12, i_current_price#13, i_category#14]
Arguments: [i_category#14 ASC NULLS FIRST], false, 0

(128) Scan parquet
Output [2]: [i_current_price#15, i_category#16]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(i_category)]
ReadSchema: struct<i_current_price:decimal(7,2),i_category:string>

(129) Filter
Input [2]: [i_current_price#15, i_category#16]
Condition : isnotnull(i_category#16)

(130) HashAggregate
Input [2]: [i_current_price#15, i_category#16]
Keys [1]: [i_category#16]
Functions [1]: [partial_avg(UnscaledValue(i_current_price#15))]
Aggregate Attributes [2]: [sum#18, count#19]
Results [3]: [i_category#16, sum#28, count#29]

(131) Exchange
Input [3]: [i_category#16, sum#28, count#29]
Arguments: hashpartitioning(i_category#16, 100), ENSURE_REQUIREMENTS, [plan_id=20]

(132) HashAggregate
Input [3]: [i_category#16, sum#28, count#29]
Keys [1]: [i_category#16]
Functions [1]: [avg(UnscaledValue(i_current_price#15))]
Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#15))#22]
Results [2]: [cast((avg(UnscaledValue(i_current_price#15))#22 / 100.0) as decimal(11,6)) AS avg(i_current_price)#23, i_category#16]

(133) Filter
Input [2]: [avg(i_current_price)#23, i_category#16]
Condition : isnotnull(avg(i_current_price)#23)

(134) Sort
Input [2]: [avg(i_current_price)#23, i_category#16]
Arguments: [i_category#16 ASC NULLS FIRST], false, 0

(135) SortMergeJoin
Left keys [1]: [i_category#14]
Right keys [1]: [i_category#16]
Join type: Inner
Join condition: (cast(i_current_price#13 as decimal(14,7)) > (1.2 * avg(i_current_price)#23))

(136) Project
Output [1]: [i_item_sk#12]
Input [5]: [i_item_sk#12, i_current_price#13, i_category#14, avg(i_current_price)#23, i_category#16]

(137) Exchange
Input [1]: [i_item_sk#12]
Arguments: hashpartitioning(i_item_sk#12, 100), ENSURE_REQUIREMENTS, [plan_id=21]

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

(139) SortMergeJoin
Left keys [1]: [ss_item_sk#6]
Right keys [1]: [i_item_sk#12]
Join type: Inner
Join condition: None

(140) Project
Output [1]: [ca_state#2]
Input [3]: [ca_state#2, ss_item_sk#6, i_item_sk#12]

(141) HashAggregate
Input [1]: [ca_state#2]
Keys [1]: [ca_state#2]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#24]
Results [2]: [ca_state#2, count#30]

(142) Exchange
Input [2]: [ca_state#2, count#30]
Arguments: hashpartitioning(ca_state#2, 100), ENSURE_REQUIREMENTS, [plan_id=22]

(143) HashAggregate
Input [2]: [ca_state#2, count#30]
Keys [1]: [ca_state#2]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#25]
Results [3]: [ca_state#2 AS state#26, count(1)#25 AS cnt#27, ca_state#2]

(144) Filter
Input [3]: [state#26, cnt#27, ca_state#2]
Condition : (cnt#27 >= 10)

(145) TakeOrderedAndProject
Input [3]: [state#26, cnt#27, ca_state#2]
Arguments: X, [cnt#27 ASC NULLS FIRST, ca_state#2 ASC NULLS FIRST], [state#26, cnt#27]

(146) AdaptiveSparkPlan
Output [2]: [state#26, cnt#27]
Arguments: isFinalPlan=true

===== Subqueries =====

Subquery:1 Hosting operator id = 41 Hosting Expression = Subquery subquery#10, [id=#11]
AdaptiveSparkPlan (164)
+- == Final Plan ==
   NativeProject (157)
   +- NativeHashAggregate (156)
      +- InputAdapter (155)
         +- AQEShuffleRead (154)
            +- ShuffleQueryStage (153), Statistics(X)
               +- NativeShuffleExchange (152)
                  +- NativeHashAggregate (151)
                     +- NativeProject (150)
                        +- NativeFilter (149)
                           +- InputAdapter (148)
                              +- NativeParquetScan  (147)
+- == Initial Plan ==
   HashAggregate (163)
   +- Exchange (162)
      +- HashAggregate (161)
         +- Project (160)
            +- Filter (159)
               +- Scan parquet (158)


(158) Scan parquet
Output [3]: [d_month_seq#31, d_year#32, d_moy#33]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)]
ReadSchema: struct<d_month_seq:int,d_year:int,d_moy:int>

(148) InputAdapter
Input [3]: [d_month_seq#31, d_year#32, d_moy#33]
Arguments: [#31, #32, #33]

(149) NativeFilter
Input [3]: [#31#31, #32#32, #33#33]
Condition : (((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2000)) AND (d_moy#33 = 1))

(150) NativeProject
Output [1]: [d_month_seq#31]
Input [3]: [#31#31, #32#32, #33#33]

(151) NativeHashAggregate
Input [1]: [d_month_seq#31]
Keys [1]: [d_month_seq#31]
Functions: []
Aggregate Attributes: []
Results [1]: [d_month_seq#31]

(152) NativeShuffleExchange
Input [1]: [d_month_seq#31]
Arguments: hashpartitioning(d_month_seq#31, 100), ENSURE_REQUIREMENTS, [plan_id=23]

(153) ShuffleQueryStage
Output [1]: [d_month_seq#31]
Arguments: X

(154) AQEShuffleRead
Input [1]: [d_month_seq#31]
Arguments: coalesced

(155) InputAdapter
Input [1]: [d_month_seq#31]

(156) NativeHashAggregate
Input [1]: [d_month_seq#31]
Keys [1]: [d_month_seq#31]
Functions: []
Aggregate Attributes: []
Results [1]: [d_month_seq#31]

(157) NativeProject
Output [1]: [d_month_seq#31]
Input [1]: [d_month_seq#31]

(158) Scan parquet
Output [3]: [d_month_seq#31, d_year#32, d_moy#33]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)]
ReadSchema: struct<d_month_seq:int,d_year:int,d_moy:int>

(159) Filter
Input [3]: [d_month_seq#31, d_year#32, d_moy#33]
Condition : (((isnotnull(d_year#32) AND isnotnull(d_moy#33)) AND (d_year#32 = 2000)) AND (d_moy#33 = 1))

(160) Project
Output [1]: [d_month_seq#31]
Input [3]: [d_month_seq#31, d_year#32, d_moy#33]

(161) HashAggregate
Input [1]: [d_month_seq#31]
Keys [1]: [d_month_seq#31]
Functions: []
Aggregate Attributes: []
Results [1]: [d_month_seq#31]

(162) Exchange
Input [1]: [d_month_seq#31]
Arguments: hashpartitioning(d_month_seq#31, 100), ENSURE_REQUIREMENTS, [plan_id=24]

(163) HashAggregate
Input [1]: [d_month_seq#31]
Keys [1]: [d_month_seq#31]
Functions: []
Aggregate Attributes: []
Results [1]: [d_month_seq#31]

(164) AdaptiveSparkPlan
Output [1]: [d_month_seq#31]
Arguments: isFinalPlan=true


