== Physical Plan ==
AdaptiveSparkPlan (122)
+- == Final Plan ==
   InputAdapter (78)
   +- AQEShuffleRead (77)
      +- ShuffleQueryStage (76), Statistics(X)
         +- NativeShuffleExchange (75)
            +- NativeProject (74)
               +- NativeSortMergeJoin Inner (73)
                  :- NativeSort (64)
                  :  +- InputAdapter (63)
                  :     +- AQEShuffleRead (62)
                  :        +- ShuffleQueryStage (61), Statistics(X)
                  :           +- NativeShuffleExchange (60)
                  :              +- NativeFilter (59)
                  :                 +- NativeProject (58)
                  :                    +- NativeHashAggregate (57)
                  :                       +- InputAdapter (56)
                  :                          +- AQEShuffleRead (55)
                  :                             +- ShuffleQueryStage (54), Statistics(X)
                  :                                +- NativeShuffleExchange (53)
                  :                                   +- NativeHashAggregate (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 ==
   Sort (121)
   +- Exchange (120)
      +- Project (119)
         +- SortMergeJoin Inner (118)
            :- Sort (113)
            :  +- Exchange (112)
            :     +- Filter (111)
            :        +- HashAggregate (110)
            :           +- Exchange (109)
            :              +- HashAggregate (108)
            :                 +- Project (107)
            :                    +- SortMergeJoin Inner (106)
            :                       :- Sort (100)
            :                       :  +- Exchange (99)
            :                       :     +- Project (98)
            :                       :        +- SortMergeJoin Inner (97)
            :                       :           :- Sort (91)
            :                       :           :  +- Exchange (90)
            :                       :           :     +- Project (89)
            :                       :           :        +- SortMergeJoin Inner (88)
            :                       :           :           :- Sort (82)
            :                       :           :           :  +- Exchange (81)
            :                       :           :           :     +- Filter (80)
            :                       :           :           :        +- Scan parquet (79)
            :                       :           :           +- Sort (87)
            :                       :           :              +- Exchange (86)
            :                       :           :                 +- Project (85)
            :                       :           :                    +- Filter (84)
            :                       :           :                       +- Scan parquet (83)
            :                       :           +- Sort (96)
            :                       :              +- Exchange (95)
            :                       :                 +- Project (94)
            :                       :                    +- Filter (93)
            :                       :                       +- Scan parquet (92)
            :                       +- Sort (105)
            :                          +- Exchange (104)
            :                             +- Project (103)
            :                                +- Filter (102)
            :                                   +- Scan parquet (101)
            +- Sort (117)
               +- Exchange (116)
                  +- Filter (115)
                     +- Scan parquet (114)


(79) Scan parquet
Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
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_store_sk:int,ss_ticket_number:int>

(2) InputAdapter
Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: [#1, #2, #3, #4, #5]

(3) NativeFilter
Input [5]: [#1#1, #2#2, #3#3, #4#4, #5#5]
Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2))

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

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

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

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

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

(83) Scan parquet
Output [3]: [d_date_sk#6, d_year#7, d_dom#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>

(10) InputAdapter
Input [3]: [d_date_sk#6, d_year#7, d_dom#8]
Arguments: [#6, #7, #8]

(11) NativeFilter
Input [3]: [#6#6, #7#7, #8#8]
Condition : ((((isnotnull(d_dom#8) AND (d_dom#8 >= 1)) AND (d_dom#8 <= 2)) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6))

(12) NativeProject
Output [1]: [d_date_sk#6]
Input [3]: [#6#6, #7#7, #8#8]

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

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

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

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

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

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

(19) NativeProject
Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Input [6]: [#1#1, #2#2, #3#3, #4#4, #5#5, d_date_sk#6]

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

(21) ShuffleQueryStage
Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: X

(22) AQEShuffleRead
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: coalesced

(23) InputAdapter
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]

(24) NativeSort
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: [ss_store_sk#4 ASC NULLS FIRST], false

(92) Scan parquet
Output [2]: [s_store_sk#9, s_county#10]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [In(s_county, [Bronx County,Franklin Parish,Orange County,Williamson County]), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_county:string>

(26) InputAdapter
Input [2]: [s_store_sk#9, s_county#10]
Arguments: [#9, #10]

(27) NativeFilter
Input [2]: [#9#9, #10#10]
Condition : (s_county#10 IN (Williamson County,Franklin Parish,Bronx County,Orange County) AND isnotnull(s_store_sk#9))

(28) NativeProject
Output [1]: [s_store_sk#9]
Input [2]: [#9#9, #10#10]

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

(30) ShuffleQueryStage
Output [1]: [s_store_sk#9]
Arguments: X

(31) AQEShuffleRead
Input [1]: [s_store_sk#9]
Arguments: coalesced

(32) InputAdapter
Input [1]: [s_store_sk#9]

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

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

(35) NativeProject
Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#9]

(36) NativeShuffleExchange
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: hashpartitioning(ss_hdemo_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(37) ShuffleQueryStage
Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: X

(38) AQEShuffleRead
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: coalesced

(39) InputAdapter
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]

(40) NativeSort
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: [ss_hdemo_sk#3 ASC NULLS FIRST], false

(101) Scan parquet
Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(hd_vehicle_count), Or(EqualTo(hd_buy_potential,>10000),EqualTo(hd_buy_potential,unknown)), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>

(42) InputAdapter
Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
Arguments: [#11, #12, #13, #14]

(43) NativeFilter
Input [4]: [#11#11, #12#12, #13#13, #14#14]
Condition : ((((isnotnull(hd_vehicle_count#14) AND ((hd_buy_potential#12 = >10000) OR (hd_buy_potential#12 = unknown))) AND (hd_vehicle_count#14 > 0)) AND CASE WHEN (hd_vehicle_count#14 > 0) THEN ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.0) END) AND isnotnull(hd_demo_sk#11))

(44) NativeProject
Output [1]: [hd_demo_sk#11]
Input [4]: [#11#11, #12#12, #13#13, #14#14]

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

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

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

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

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

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

(51) NativeProject
Output [2]: [ss_customer_sk#2, ss_ticket_number#5]
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#11]

(52) NativeHashAggregate
Input [2]: [ss_customer_sk#2, ss_ticket_number#5]
Keys [2]: [ss_ticket_number#5, ss_customer_sk#2]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#15]
Results [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]

(53) NativeShuffleExchange
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]
Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(54) ShuffleQueryStage
Output [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]
Arguments: X

(55) AQEShuffleRead
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]
Arguments: coalesced

(56) InputAdapter
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]

(57) NativeHashAggregate
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, #16]
Keys [2]: [ss_ticket_number#5, ss_customer_sk#2]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#17]
Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#17]

(58) NativeProject
Output [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#17 AS cnt#18]
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#17]

(59) NativeFilter
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Condition : ((cnt#18 >= 1) AND (cnt#18 <= 5))

(60) NativeShuffleExchange
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: hashpartitioning(ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(61) ShuffleQueryStage
Output [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: X

(62) AQEShuffleRead
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: coalesced

(63) InputAdapter
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]

(64) NativeSort
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false

(114) Scan parquet
Output [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>

(66) InputAdapter
Input [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Arguments: [#19, #20, #21, #22, #23]

(67) NativeFilter
Input [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]
Condition : isnotnull(c_customer_sk#19)

(68) NativeShuffleExchange
Input [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]
Arguments: hashpartitioning(c_customer_sk#19, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(69) ShuffleQueryStage
Output [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]
Arguments: X

(70) AQEShuffleRead
Input [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]
Arguments: coalesced

(71) InputAdapter
Input [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]

(72) NativeSort
Input [5]: [#19#19, #20#20, #21#21, #22#22, #23#23]
Arguments: [c_customer_sk#19 ASC NULLS FIRST], false

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

(74) NativeProject
Output [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18, #19#19, #20#20, #21#21, #22#22, #23#23]

(75) NativeShuffleExchange
Input [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: rangepartitioning(cnt#18 DESC NULLS LAST, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(76) ShuffleQueryStage
Output [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: X

(77) AQEShuffleRead
Input [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: local

(78) InputAdapter
Input [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]

(79) Scan parquet
Output [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
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_store_sk:int,ss_ticket_number:int>

(80) Filter
Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Condition : (((isnotnull(ss_sold_date_sk#1) AND isnotnull(ss_store_sk#4)) AND isnotnull(ss_hdemo_sk#3)) AND isnotnull(ss_customer_sk#2))

(81) Exchange
Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: hashpartitioning(ss_sold_date_sk#1, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(82) Sort
Input [5]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: [ss_sold_date_sk#1 ASC NULLS FIRST], false, 0

(83) Scan parquet
Output [3]: [d_date_sk#6, d_year#7, d_dom#8]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>

(84) Filter
Input [3]: [d_date_sk#6, d_year#7, d_dom#8]
Condition : ((((isnotnull(d_dom#8) AND (d_dom#8 >= 1)) AND (d_dom#8 <= 2)) AND d_year#7 IN (1999,2000,2001)) AND isnotnull(d_date_sk#6))

(85) Project
Output [1]: [d_date_sk#6]
Input [3]: [d_date_sk#6, d_year#7, d_dom#8]

(86) Exchange
Input [1]: [d_date_sk#6]
Arguments: hashpartitioning(d_date_sk#6, 100), ENSURE_REQUIREMENTS, [plan_id=12]

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

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

(89) Project
Output [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Input [6]: [ss_sold_date_sk#1, ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, d_date_sk#6]

(90) Exchange
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: hashpartitioning(ss_store_sk#4, 100), ENSURE_REQUIREMENTS, [plan_id=13]

(91) Sort
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5]
Arguments: [ss_store_sk#4 ASC NULLS FIRST], false, 0

(92) Scan parquet
Output [2]: [s_store_sk#9, s_county#10]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [In(s_county, [Bronx County,Franklin Parish,Orange County,Williamson County]), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_county:string>

(93) Filter
Input [2]: [s_store_sk#9, s_county#10]
Condition : (s_county#10 IN (Williamson County,Franklin Parish,Bronx County,Orange County) AND isnotnull(s_store_sk#9))

(94) Project
Output [1]: [s_store_sk#9]
Input [2]: [s_store_sk#9, s_county#10]

(95) Exchange
Input [1]: [s_store_sk#9]
Arguments: hashpartitioning(s_store_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=14]

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

(97) SortMergeJoin
Left keys [1]: [ss_store_sk#4]
Right keys [1]: [s_store_sk#9]
Join type: Inner
Join condition: None

(98) Project
Output [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Input [5]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_store_sk#4, ss_ticket_number#5, s_store_sk#9]

(99) Exchange
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: hashpartitioning(ss_hdemo_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=15]

(100) Sort
Input [3]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5]
Arguments: [ss_hdemo_sk#3 ASC NULLS FIRST], false, 0

(101) Scan parquet
Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(hd_vehicle_count), Or(EqualTo(hd_buy_potential,>10000),EqualTo(hd_buy_potential,unknown)), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>

(102) Filter
Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
Condition : ((((isnotnull(hd_vehicle_count#14) AND ((hd_buy_potential#12 = >10000) OR (hd_buy_potential#12 = unknown))) AND (hd_vehicle_count#14 > 0)) AND CASE WHEN (hd_vehicle_count#14 > 0) THEN ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.0) END) AND isnotnull(hd_demo_sk#11))

(103) Project
Output [1]: [hd_demo_sk#11]
Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]

(104) Exchange
Input [1]: [hd_demo_sk#11]
Arguments: hashpartitioning(hd_demo_sk#11, 100), ENSURE_REQUIREMENTS, [plan_id=16]

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

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

(107) Project
Output [2]: [ss_customer_sk#2, ss_ticket_number#5]
Input [4]: [ss_customer_sk#2, ss_hdemo_sk#3, ss_ticket_number#5, hd_demo_sk#11]

(108) HashAggregate
Input [2]: [ss_customer_sk#2, ss_ticket_number#5]
Keys [2]: [ss_ticket_number#5, ss_customer_sk#2]
Functions [1]: [partial_count(1)]
Aggregate Attributes [1]: [count#15]
Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count#24]

(109) Exchange
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#24]
Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=17]

(110) HashAggregate
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, count#24]
Keys [2]: [ss_ticket_number#5, ss_customer_sk#2]
Functions [1]: [count(1)]
Aggregate Attributes [1]: [count(1)#17]
Results [3]: [ss_ticket_number#5, ss_customer_sk#2, count(1)#17 AS cnt#18]

(111) Filter
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Condition : ((cnt#18 >= 1) AND (cnt#18 <= 5))

(112) Exchange
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: hashpartitioning(ss_customer_sk#2, 100), ENSURE_REQUIREMENTS, [plan_id=18]

(113) Sort
Input [3]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(114) Scan parquet
Output [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(c_customer_sk)]
ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>

(115) Filter
Input [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Condition : isnotnull(c_customer_sk#19)

(116) Exchange
Input [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Arguments: hashpartitioning(c_customer_sk#19, 100), ENSURE_REQUIREMENTS, [plan_id=19]

(117) Sort
Input [5]: [c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]
Arguments: [c_customer_sk#19 ASC NULLS FIRST], false, 0

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

(119) Project
Output [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Input [8]: [ss_ticket_number#5, ss_customer_sk#2, cnt#18, c_customer_sk#19, c_salutation#20, c_first_name#21, c_last_name#22, c_preferred_cust_flag#23]

(120) Exchange
Input [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: rangepartitioning(cnt#18 DESC NULLS LAST, 100), ENSURE_REQUIREMENTS, [plan_id=20]

(121) Sort
Input [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: [cnt#18 DESC NULLS LAST], true, 0

(122) AdaptiveSparkPlan
Output [6]: [c_last_name#22, c_first_name#21, c_salutation#20, c_preferred_cust_flag#23, ss_ticket_number#5, cnt#18]
Arguments: isFinalPlan=true

