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


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

(2) InputAdapter
Input [2]: [ws_sold_date_sk#1, ws_ext_sales_price#2]
Arguments: [#1, #2]

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

(4) NativeProject
Output [2]: [ws_sold_date_sk#1 AS sold_date_sk#3, ws_ext_sales_price#2 AS sales_price#4]
Input [2]: [#1#1, #2#2]

(81) Scan parquet
Output [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_ext_sales_price:decimal(7,2)>

(6) InputAdapter
Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6]
Arguments: [#5, #6]

(7) NativeFilter
Input [2]: [#5#5, #6#6]
Condition : isnotnull(cs_sold_date_sk#5)

(8) NativeProject
Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_price#8]
Input [2]: [#5#5, #6#6]

(9) NativeUnion
Arguments: [sold_date_sk#3, sales_price#4]

(10) InputAdapter
Input [2]: [sold_date_sk#3, sales_price#4]
Arguments: [#3, #4]

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

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

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

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

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

(87) Scan parquet
Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int,d_day_name:string>

(17) InputAdapter
Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Arguments: [#9, #10, #11]

(18) NativeFilter
Input [3]: [#9#9, #10#10, #11#11]
Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10))

(19) NativeShuffleExchange
Input [3]: [#9#9, #10#10, #11#11]
Arguments: hashpartitioning(d_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=2]

(20) ShuffleQueryStage
Output [3]: [#9#9, #10#10, #11#11]
Arguments: X

(21) AQEShuffleRead
Input [3]: [#9#9, #10#10, #11#11]
Arguments: coalesced

(22) InputAdapter
Input [3]: [#9#9, #10#10, #11#11]

(23) NativeSort
Input [3]: [#9#9, #10#10, #11#11]
Arguments: [d_date_sk#9 ASC NULLS FIRST], false

(24) NativeSortMergeJoin
Left keys [1]: [sold_date_sk#3]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(25) NativeProject
Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11]
Input [5]: [#3#3, #4#4, #9#9, #10#10, #11#11]

(26) NativeProject
Output [8]: [d_week_seq#10 AS d_week_seq#10, UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END) AS _c1#12, UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END) AS _c2#13, UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END) AS _c3#14, UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END) AS _c4#15, UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END) AS _c5#16, UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END) AS _c6#17, UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END) AS _c7#18]
Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11]

(27) NativeHashAggregate
Input [8]: [d_week_seq#10, _c1#12, _c2#13, _c3#14, _c4#15, _c5#16, _c6#17, _c7#18]
Keys [1]: [d_week_seq#10]
Functions [7]: [partial_sum(_c1#12), partial_sum(_c2#13), partial_sum(_c3#14), partial_sum(_c4#15), partial_sum(_c5#16), partial_sum(_c6#17), partial_sum(_c7#18)]
Aggregate Attributes [7]: [sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
Results [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]

(28) NativeShuffleExchange
Input [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]
Arguments: hashpartitioning(d_week_seq#10, 100), ENSURE_REQUIREMENTS, [plan_id=3]

(29) ShuffleQueryStage
Output [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]
Arguments: X

(30) AQEShuffleRead
Input [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]
Arguments: coalesced

(31) InputAdapter
Input [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]

(32) NativeHashAggregate
Input [8]: [d_week_seq#10, #26, #26, #26, #26, #26, #26, #26]
Keys [1]: [d_week_seq#10]
Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33]
Results [8]: [d_week_seq#10, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33]

(33) NativeProject
Output [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27,17,2) AS sun_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28,17,2) AS mon_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29,17,2) AS tue_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30,17,2) AS wed_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31,17,2) AS thu_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32,17,2) AS fri_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33,17,2) AS sat_sales#40]
Input [8]: [d_week_seq#10, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33]

(34) NativeSort
Input [8]: [d_week_seq#10, sun_sales#34, mon_sales#35, tue_sales#36, wed_sales#37, thu_sales#38, fri_sales#39, sat_sales#40]
Arguments: [d_week_seq#10 ASC NULLS FIRST], false

(97) Scan parquet
Output [2]: [d_week_seq#41, d_year#42]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)]
ReadSchema: struct<d_week_seq:int,d_year:int>

(36) InputAdapter
Input [2]: [d_week_seq#41, d_year#42]
Arguments: [#41, #42]

(37) NativeFilter
Input [2]: [#41#41, #42#42]
Condition : ((isnotnull(d_year#42) AND (d_year#42 = 2001)) AND isnotnull(d_week_seq#41))

(38) NativeProject
Output [1]: [d_week_seq#41]
Input [2]: [#41#41, #42#42]

(39) NativeShuffleExchange
Input [1]: [d_week_seq#41]
Arguments: hashpartitioning(d_week_seq#41, 100), ENSURE_REQUIREMENTS, [plan_id=4]

(40) ShuffleQueryStage
Output [1]: [d_week_seq#41]
Arguments: X

(41) AQEShuffleRead
Input [1]: [d_week_seq#41]
Arguments: coalesced

(42) InputAdapter
Input [1]: [d_week_seq#41]

(43) NativeSort
Input [1]: [d_week_seq#41]
Arguments: [d_week_seq#41 ASC NULLS FIRST], false

(44) NativeSortMergeJoin
Left keys [1]: [d_week_seq#10]
Right keys [1]: [d_week_seq#41]
Join type: Inner
Join condition: None

(45) NativeProject
Output [8]: [d_week_seq#10 AS d_week_seq1#43, sun_sales#34 AS sun_sales1#44, mon_sales#35 AS mon_sales1#45, tue_sales#36 AS tue_sales1#46, wed_sales#37 AS wed_sales1#47, thu_sales#38 AS thu_sales1#48, fri_sales#39 AS fri_sales1#49, sat_sales#40 AS sat_sales1#50]
Input [9]: [d_week_seq#10, sun_sales#34, mon_sales#35, tue_sales#36, wed_sales#37, thu_sales#38, fri_sales#39, sat_sales#40, d_week_seq#41]

(46) ReusedExchange [Reuses operator id: 28]
Output [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]

(47) ShuffleQueryStage
Output [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]
Arguments: X

(48) AQEShuffleRead
Input [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]
Arguments: coalesced

(49) InputAdapter
Input [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]
Arguments: [#51, #59, #60, #61, #62, #63, #64, #65]

(50) InputAdapter
Input [8]: [#51#51, #59#52, #60#53, #61#54, #62#55, #63#56, #64#57, #65#58]

(51) NativeHashAggregate
Input [8]: [#51#51, #59#52, #60#53, #61#54, #62#55, #63#56, #64#57, #65#58]
Keys [1]: [d_week_seq#51]
Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33]
Results [8]: [d_week_seq#51, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33]

(52) NativeProject
Output [8]: [d_week_seq#51, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27,17,2) AS sun_sales#67, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28,17,2) AS mon_sales#68, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29,17,2) AS tue_sales#69, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30,17,2) AS wed_sales#70, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31,17,2) AS thu_sales#71, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32,17,2) AS fri_sales#72, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33,17,2) AS sat_sales#73]
Input [8]: [d_week_seq#51, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33]

(53) NativeSort
Input [8]: [d_week_seq#51, sun_sales#67, mon_sales#68, tue_sales#69, wed_sales#70, thu_sales#71, fri_sales#72, sat_sales#73]
Arguments: [d_week_seq#51 ASC NULLS FIRST], false

(123) Scan parquet
Output [2]: [d_week_seq#74, d_year#75]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)]
ReadSchema: struct<d_week_seq:int,d_year:int>

(55) InputAdapter
Input [2]: [d_week_seq#74, d_year#75]
Arguments: [#74, #75]

(56) NativeFilter
Input [2]: [#74#74, #75#75]
Condition : ((isnotnull(d_year#75) AND (d_year#75 = 2002)) AND isnotnull(d_week_seq#74))

(57) NativeProject
Output [1]: [d_week_seq#74]
Input [2]: [#74#74, #75#75]

(58) NativeShuffleExchange
Input [1]: [d_week_seq#74]
Arguments: hashpartitioning(d_week_seq#74, 100), ENSURE_REQUIREMENTS, [plan_id=5]

(59) ShuffleQueryStage
Output [1]: [d_week_seq#74]
Arguments: X

(60) AQEShuffleRead
Input [1]: [d_week_seq#74]
Arguments: coalesced

(61) InputAdapter
Input [1]: [d_week_seq#74]

(62) NativeSort
Input [1]: [d_week_seq#74]
Arguments: [d_week_seq#74 ASC NULLS FIRST], false

(63) NativeSortMergeJoin
Left keys [1]: [d_week_seq#51]
Right keys [1]: [d_week_seq#74]
Join type: Inner
Join condition: None

(64) NativeProject
Output [8]: [d_week_seq#51 AS d_week_seq2#76, sun_sales#67 AS sun_sales2#77, mon_sales#68 AS mon_sales2#78, tue_sales#69 AS tue_sales2#79, wed_sales#70 AS wed_sales2#80, thu_sales#71 AS thu_sales2#81, fri_sales#72 AS fri_sales2#82, sat_sales#73 AS sat_sales2#83]
Input [9]: [d_week_seq#51, sun_sales#67, mon_sales#68, tue_sales#69, wed_sales#70, thu_sales#71, fri_sales#72, sat_sales#73, d_week_seq#74]

(65) NativeShuffleExchange
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: hashpartitioning((d_week_seq2#76 - 53), 100), ENSURE_REQUIREMENTS, [plan_id=6]

(66) ShuffleQueryStage
Output [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: X

(67) AQEShuffleRead
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: coalesced

(68) InputAdapter
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]

(69) NativeSort
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: [(d_week_seq2#76 - 53) ASC NULLS FIRST], false

(70) NativeSortMergeJoin
Left keys [1]: [d_week_seq1#43]
Right keys [1]: [(d_week_seq2#76 - 53)]
Join type: Inner
Join condition: None

(71) Project [codegen id : X]
Output [8]: [d_week_seq1#43, round((sun_sales1#44 / sun_sales2#77), 2) AS round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1#45 / mon_sales2#78), 2) AS round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1#46 / tue_sales2#79), 2) AS round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1#47 / wed_sales2#80), 2) AS round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1#48 / thu_sales2#81), 2) AS round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1#49 / fri_sales2#82), 2) AS round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1#50 / sat_sales2#83), 2) AS round((sat_sales1 / sat_sales2), 2)#90]
Input [16]: [d_week_seq1#43, sun_sales1#44, mon_sales1#45, tue_sales1#46, wed_sales1#47, thu_sales1#48, fri_sales1#49, sat_sales1#50, d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]

(72) ConvertToNative
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]

(73) NativeShuffleExchange
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: rangepartitioning(d_week_seq1#43 ASC NULLS FIRST, 100), ENSURE_REQUIREMENTS, [plan_id=7]

(74) ShuffleQueryStage
Output [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: X

(75) AQEShuffleRead
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: coalesced

(76) InputAdapter
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]

(77) NativeSort
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: [d_week_seq1#43 ASC NULLS FIRST], true

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

(79) Filter
Input [2]: [ws_sold_date_sk#1, ws_ext_sales_price#2]
Condition : isnotnull(ws_sold_date_sk#1)

(80) Project
Output [2]: [ws_sold_date_sk#1 AS sold_date_sk#3, ws_ext_sales_price#2 AS sales_price#4]
Input [2]: [ws_sold_date_sk#1, ws_ext_sales_price#2]

(81) Scan parquet
Output [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_ext_sales_price:decimal(7,2)>

(82) Filter
Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6]
Condition : isnotnull(cs_sold_date_sk#5)

(83) Project
Output [2]: [cs_sold_date_sk#5 AS sold_date_sk#7, cs_ext_sales_price#6 AS sales_price#8]
Input [2]: [cs_sold_date_sk#5, cs_ext_sales_price#6]

(84) Union

(85) Exchange
Input [2]: [sold_date_sk#3, sales_price#4]
Arguments: hashpartitioning(sold_date_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=8]

(86) Sort
Input [2]: [sold_date_sk#3, sales_price#4]
Arguments: [sold_date_sk#3 ASC NULLS FIRST], false, 0

(87) Scan parquet
Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int,d_day_name:string>

(88) Filter
Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10))

(89) Exchange
Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Arguments: hashpartitioning(d_date_sk#9, 100), ENSURE_REQUIREMENTS, [plan_id=9]

(90) Sort
Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
Arguments: [d_date_sk#9 ASC NULLS FIRST], false, 0

(91) SortMergeJoin
Left keys [1]: [sold_date_sk#3]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(92) Project
Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11]
Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11]

(93) HashAggregate
Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11]
Keys [1]: [d_week_seq#10]
Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
Results [8]: [d_week_seq#10, sum#91, sum#92, sum#93, sum#94, sum#95, sum#96, sum#97]

(94) Exchange
Input [8]: [d_week_seq#10, sum#91, sum#92, sum#93, sum#94, sum#95, sum#96, sum#97]
Arguments: hashpartitioning(d_week_seq#10, 100), ENSURE_REQUIREMENTS, [plan_id=10]

(95) HashAggregate
Input [8]: [d_week_seq#10, sum#91, sum#92, sum#93, sum#94, sum#95, sum#96, sum#97]
Keys [1]: [d_week_seq#10]
Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33]
Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday) THEN sales_price#4 END))#27,17,2) AS sun_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday) THEN sales_price#4 END))#28,17,2) AS mon_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday) THEN sales_price#4 END))#29,17,2) AS tue_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#30,17,2) AS wed_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday) THEN sales_price#4 END))#31,17,2) AS thu_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday) THEN sales_price#4 END))#32,17,2) AS fri_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday) THEN sales_price#4 END))#33,17,2) AS sat_sales#40]

(96) Sort
Input [8]: [d_week_seq#10, sun_sales#34, mon_sales#35, tue_sales#36, wed_sales#37, thu_sales#38, fri_sales#39, sat_sales#40]
Arguments: [d_week_seq#10 ASC NULLS FIRST], false, 0

(97) Scan parquet
Output [2]: [d_week_seq#41, d_year#42]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)]
ReadSchema: struct<d_week_seq:int,d_year:int>

(98) Filter
Input [2]: [d_week_seq#41, d_year#42]
Condition : ((isnotnull(d_year#42) AND (d_year#42 = 2001)) AND isnotnull(d_week_seq#41))

(99) Project
Output [1]: [d_week_seq#41]
Input [2]: [d_week_seq#41, d_year#42]

(100) Exchange
Input [1]: [d_week_seq#41]
Arguments: hashpartitioning(d_week_seq#41, 100), ENSURE_REQUIREMENTS, [plan_id=11]

(101) Sort
Input [1]: [d_week_seq#41]
Arguments: [d_week_seq#41 ASC NULLS FIRST], false, 0

(102) SortMergeJoin
Left keys [1]: [d_week_seq#10]
Right keys [1]: [d_week_seq#41]
Join type: Inner
Join condition: None

(103) Project
Output [8]: [d_week_seq#10 AS d_week_seq1#43, sun_sales#34 AS sun_sales1#44, mon_sales#35 AS mon_sales1#45, tue_sales#36 AS tue_sales1#46, wed_sales#37 AS wed_sales1#47, thu_sales#38 AS thu_sales1#48, fri_sales#39 AS fri_sales1#49, sat_sales#40 AS sat_sales1#50]
Input [9]: [d_week_seq#10, sun_sales#34, mon_sales#35, tue_sales#36, wed_sales#37, thu_sales#38, fri_sales#39, sat_sales#40, d_week_seq#41]

(104) Scan parquet
Output [2]: [ws_sold_date_sk#98, ws_ext_sales_price#99]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(ws_sold_date_sk)]
ReadSchema: struct<ws_sold_date_sk:int,ws_ext_sales_price:decimal(7,2)>

(105) Filter
Input [2]: [ws_sold_date_sk#98, ws_ext_sales_price#99]
Condition : isnotnull(ws_sold_date_sk#98)

(106) Project
Output [2]: [ws_sold_date_sk#98 AS sold_date_sk#3, ws_ext_sales_price#99 AS sales_price#4]
Input [2]: [ws_sold_date_sk#98, ws_ext_sales_price#99]

(107) Scan parquet
Output [2]: [cs_sold_date_sk#100, cs_ext_sales_price#101]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(cs_sold_date_sk)]
ReadSchema: struct<cs_sold_date_sk:int,cs_ext_sales_price:decimal(7,2)>

(108) Filter
Input [2]: [cs_sold_date_sk#100, cs_ext_sales_price#101]
Condition : isnotnull(cs_sold_date_sk#100)

(109) Project
Output [2]: [cs_sold_date_sk#100 AS sold_date_sk#7, cs_ext_sales_price#101 AS sales_price#8]
Input [2]: [cs_sold_date_sk#100, cs_ext_sales_price#101]

(110) Union

(111) Exchange
Input [2]: [sold_date_sk#3, sales_price#4]
Arguments: hashpartitioning(sold_date_sk#3, 100), ENSURE_REQUIREMENTS, [plan_id=12]

(112) Sort
Input [2]: [sold_date_sk#3, sales_price#4]
Arguments: [sold_date_sk#3 ASC NULLS FIRST], false, 0

(113) Scan parquet
Output [3]: [d_date_sk#102, d_week_seq#51, d_day_name#66]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int,d_day_name:string>

(114) Filter
Input [3]: [d_date_sk#102, d_week_seq#51, d_day_name#66]
Condition : (isnotnull(d_date_sk#102) AND isnotnull(d_week_seq#51))

(115) Exchange
Input [3]: [d_date_sk#102, d_week_seq#51, d_day_name#66]
Arguments: hashpartitioning(d_date_sk#102, 100), ENSURE_REQUIREMENTS, [plan_id=13]

(116) Sort
Input [3]: [d_date_sk#102, d_week_seq#51, d_day_name#66]
Arguments: [d_date_sk#102 ASC NULLS FIRST], false, 0

(117) SortMergeJoin
Left keys [1]: [sold_date_sk#3]
Right keys [1]: [d_date_sk#102]
Join type: Inner
Join condition: None

(118) Project
Output [3]: [sales_price#4, d_week_seq#51, d_day_name#66]
Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#102, d_week_seq#51, d_day_name#66]

(119) HashAggregate
Input [3]: [sales_price#4, d_week_seq#51, d_day_name#66]
Keys [1]: [d_week_seq#51]
Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum#103, sum#104, sum#105, sum#106, sum#107, sum#108, sum#109]
Results [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]

(120) Exchange
Input [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]
Arguments: hashpartitioning(d_week_seq#51, 100), ENSURE_REQUIREMENTS, [plan_id=14]

(121) HashAggregate
Input [8]: [d_week_seq#51, sum#52, sum#53, sum#54, sum#55, sum#56, sum#57, sum#58]
Keys [1]: [d_week_seq#51]
Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))]
Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33]
Results [8]: [d_week_seq#51, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Sunday) THEN sales_price#4 END))#27,17,2) AS sun_sales#67, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Monday) THEN sales_price#4 END))#28,17,2) AS mon_sales#68, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Tuesday) THEN sales_price#4 END))#29,17,2) AS tue_sales#69, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Wednesday) THEN sales_price#4 END))#30,17,2) AS wed_sales#70, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Thursday) THEN sales_price#4 END))#31,17,2) AS thu_sales#71, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Friday) THEN sales_price#4 END))#32,17,2) AS fri_sales#72, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#66 = Saturday) THEN sales_price#4 END))#33,17,2) AS sat_sales#73]

(122) Sort
Input [8]: [d_week_seq#51, sun_sales#67, mon_sales#68, tue_sales#69, wed_sales#70, thu_sales#71, fri_sales#72, sat_sales#73]
Arguments: [d_week_seq#51 ASC NULLS FIRST], false, 0

(123) Scan parquet
Output [2]: [d_week_seq#74, d_year#75]
Batched: true
Location: InMemoryFileIndex [file:/<warehouse_dir>]
PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)]
ReadSchema: struct<d_week_seq:int,d_year:int>

(124) Filter
Input [2]: [d_week_seq#74, d_year#75]
Condition : ((isnotnull(d_year#75) AND (d_year#75 = 2002)) AND isnotnull(d_week_seq#74))

(125) Project
Output [1]: [d_week_seq#74]
Input [2]: [d_week_seq#74, d_year#75]

(126) Exchange
Input [1]: [d_week_seq#74]
Arguments: hashpartitioning(d_week_seq#74, 100), ENSURE_REQUIREMENTS, [plan_id=15]

(127) Sort
Input [1]: [d_week_seq#74]
Arguments: [d_week_seq#74 ASC NULLS FIRST], false, 0

(128) SortMergeJoin
Left keys [1]: [d_week_seq#51]
Right keys [1]: [d_week_seq#74]
Join type: Inner
Join condition: None

(129) Project
Output [8]: [d_week_seq#51 AS d_week_seq2#76, sun_sales#67 AS sun_sales2#77, mon_sales#68 AS mon_sales2#78, tue_sales#69 AS tue_sales2#79, wed_sales#70 AS wed_sales2#80, thu_sales#71 AS thu_sales2#81, fri_sales#72 AS fri_sales2#82, sat_sales#73 AS sat_sales2#83]
Input [9]: [d_week_seq#51, sun_sales#67, mon_sales#68, tue_sales#69, wed_sales#70, thu_sales#71, fri_sales#72, sat_sales#73, d_week_seq#74]

(130) Exchange
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: hashpartitioning((d_week_seq2#76 - 53), 100), ENSURE_REQUIREMENTS, [plan_id=16]

(131) Sort
Input [8]: [d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]
Arguments: [(d_week_seq2#76 - 53) ASC NULLS FIRST], false, 0

(132) SortMergeJoin
Left keys [1]: [d_week_seq1#43]
Right keys [1]: [(d_week_seq2#76 - 53)]
Join type: Inner
Join condition: None

(133) Project
Output [8]: [d_week_seq1#43, round((sun_sales1#44 / sun_sales2#77), 2) AS round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1#45 / mon_sales2#78), 2) AS round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1#46 / tue_sales2#79), 2) AS round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1#47 / wed_sales2#80), 2) AS round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1#48 / thu_sales2#81), 2) AS round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1#49 / fri_sales2#82), 2) AS round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1#50 / sat_sales2#83), 2) AS round((sat_sales1 / sat_sales2), 2)#90]
Input [16]: [d_week_seq1#43, sun_sales1#44, mon_sales1#45, tue_sales1#46, wed_sales1#47, thu_sales1#48, fri_sales1#49, sat_sales1#50, d_week_seq2#76, sun_sales2#77, mon_sales2#78, tue_sales2#79, wed_sales2#80, thu_sales2#81, fri_sales2#82, sat_sales2#83]

(134) Exchange
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: rangepartitioning(d_week_seq1#43 ASC NULLS FIRST, 100), ENSURE_REQUIREMENTS, [plan_id=17]

(135) Sort
Input [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: [d_week_seq1#43 ASC NULLS FIRST], true, 0

(136) AdaptiveSparkPlan
Output [8]: [d_week_seq1#43, round((sun_sales1 / sun_sales2), 2)#84, round((mon_sales1 / mon_sales2), 2)#85, round((tue_sales1 / tue_sales2), 2)#86, round((wed_sales1 / wed_sales2), 2)#87, round((thu_sales1 / thu_sales2), 2)#88, round((fri_sales1 / fri_sales2), 2)#89, round((sat_sales1 / sat_sales2), 2)#90]
Arguments: isFinalPlan=true

