== Physical Plan ==
TakeOrderedAndProject (146)
+- * HashAggregate (145)
   +- Exchange (144)
      +- * HashAggregate (143)
         +- Union (142)
            :- * HashAggregate (121)
            :  +- Exchange (120)
            :     +- * HashAggregate (119)
            :        +- Union (118)
            :           :- * Filter (81)
            :           :  +- * HashAggregate (80)
            :           :     +- Exchange (79)
            :           :        +- * HashAggregate (78)
            :           :           +- * Project (77)
            :           :              +- * BroadcastHashJoin Inner BuildRight (76)
            :           :                 :- * Project (66)
            :           :                 :  +- * BroadcastHashJoin Inner BuildRight (65)
            :           :                 :     :- * SortMergeJoin LeftSemi (63)
            :           :                 :     :  :- * Sort (5)
            :           :                 :     :  :  +- Exchange (4)
            :           :                 :     :  :     +- * Filter (3)
            :           :                 :     :  :        +- * ColumnarToRow (2)
            :           :                 :     :  :           +- Scan parquet default.store_sales (1)
            :           :                 :     :  +- * Sort (62)
            :           :                 :     :     +- Exchange (61)
            :           :                 :     :        +- * Project (60)
            :           :                 :     :           +- * BroadcastHashJoin Inner BuildRight (59)
            :           :                 :     :              :- * Filter (8)
            :           :                 :     :              :  +- * ColumnarToRow (7)
            :           :                 :     :              :     +- Scan parquet default.item (6)
            :           :                 :     :              +- BroadcastExchange (58)
            :           :                 :     :                 +- * HashAggregate (57)
            :           :                 :     :                    +- Exchange (56)
            :           :                 :     :                       +- * HashAggregate (55)
            :           :                 :     :                          +- * SortMergeJoin LeftSemi (54)
            :           :                 :     :                             :- * Sort (42)
            :           :                 :     :                             :  +- Exchange (41)
            :           :                 :     :                             :     +- * HashAggregate (40)
            :           :                 :     :                             :        +- Exchange (39)
            :           :                 :     :                             :           +- * HashAggregate (38)
            :           :                 :     :                             :              +- * Project (37)
            :           :                 :     :                             :                 +- * BroadcastHashJoin Inner BuildRight (36)
            :           :                 :     :                             :                    :- * Project (14)
            :           :                 :     :                             :                    :  +- * BroadcastHashJoin Inner BuildRight (13)
            :           :                 :     :                             :                    :     :- * Filter (11)
            :           :                 :     :                             :                    :     :  +- * ColumnarToRow (10)
            :           :                 :     :                             :                    :     :     +- Scan parquet default.store_sales (9)
            :           :                 :     :                             :                    :     +- ReusedExchange (12)
            :           :                 :     :                             :                    +- BroadcastExchange (35)
            :           :                 :     :                             :                       +- * SortMergeJoin LeftSemi (34)
            :           :                 :     :                             :                          :- * Sort (19)
            :           :                 :     :                             :                          :  +- Exchange (18)
            :           :                 :     :                             :                          :     +- * Filter (17)
            :           :                 :     :                             :                          :        +- * ColumnarToRow (16)
            :           :                 :     :                             :                          :           +- Scan parquet default.item (15)
            :           :                 :     :                             :                          +- * Sort (33)
            :           :                 :     :                             :                             +- Exchange (32)
            :           :                 :     :                             :                                +- * Project (31)
            :           :                 :     :                             :                                   +- * BroadcastHashJoin Inner BuildRight (30)
            :           :                 :     :                             :                                      :- * Project (25)
            :           :                 :     :                             :                                      :  +- * BroadcastHashJoin Inner BuildRight (24)
            :           :                 :     :                             :                                      :     :- * Filter (22)
            :           :                 :     :                             :                                      :     :  +- * ColumnarToRow (21)
            :           :                 :     :                             :                                      :     :     +- Scan parquet default.catalog_sales (20)
            :           :                 :     :                             :                                      :     +- ReusedExchange (23)
            :           :                 :     :                             :                                      +- BroadcastExchange (29)
            :           :                 :     :                             :                                         +- * Filter (28)
            :           :                 :     :                             :                                            +- * ColumnarToRow (27)
            :           :                 :     :                             :                                               +- Scan parquet default.item (26)
            :           :                 :     :                             +- * Sort (53)
            :           :                 :     :                                +- Exchange (52)
            :           :                 :     :                                   +- * Project (51)
            :           :                 :     :                                      +- * BroadcastHashJoin Inner BuildRight (50)
            :           :                 :     :                                         :- * Project (48)
            :           :                 :     :                                         :  +- * BroadcastHashJoin Inner BuildRight (47)
            :           :                 :     :                                         :     :- * Filter (45)
            :           :                 :     :                                         :     :  +- * ColumnarToRow (44)
            :           :                 :     :                                         :     :     +- Scan parquet default.web_sales (43)
            :           :                 :     :                                         :     +- ReusedExchange (46)
            :           :                 :     :                                         +- ReusedExchange (49)
            :           :                 :     +- ReusedExchange (64)
            :           :                 +- BroadcastExchange (75)
            :           :                    +- * SortMergeJoin LeftSemi (74)
            :           :                       :- * Sort (71)
            :           :                       :  +- Exchange (70)
            :           :                       :     +- * Filter (69)
            :           :                       :        +- * ColumnarToRow (68)
            :           :                       :           +- Scan parquet default.item (67)
            :           :                       +- * Sort (73)
            :           :                          +- ReusedExchange (72)
            :           :- * Filter (99)
            :           :  +- * HashAggregate (98)
            :           :     +- Exchange (97)
            :           :        +- * HashAggregate (96)
            :           :           +- * Project (95)
            :           :              +- * BroadcastHashJoin Inner BuildRight (94)
            :           :                 :- * Project (92)
            :           :                 :  +- * BroadcastHashJoin Inner BuildRight (91)
            :           :                 :     :- * SortMergeJoin LeftSemi (89)
            :           :                 :     :  :- * Sort (86)
            :           :                 :     :  :  +- Exchange (85)
            :           :                 :     :  :     +- * Filter (84)
            :           :                 :     :  :        +- * ColumnarToRow (83)
            :           :                 :     :  :           +- Scan parquet default.catalog_sales (82)
            :           :                 :     :  +- * Sort (88)
            :           :                 :     :     +- ReusedExchange (87)
            :           :                 :     +- ReusedExchange (90)
            :           :                 +- ReusedExchange (93)
            :           +- * Filter (117)
            :              +- * HashAggregate (116)
            :                 +- Exchange (115)
            :                    +- * HashAggregate (114)
            :                       +- * Project (113)
            :                          +- * BroadcastHashJoin Inner BuildRight (112)
            :                             :- * Project (110)
            :                             :  +- * BroadcastHashJoin Inner BuildRight (109)
            :                             :     :- * SortMergeJoin LeftSemi (107)
            :                             :     :  :- * Sort (104)
            :                             :     :  :  +- Exchange (103)
            :                             :     :  :     +- * Filter (102)
            :                             :     :  :        +- * ColumnarToRow (101)
            :                             :     :  :           +- Scan parquet default.web_sales (100)
            :                             :     :  +- * Sort (106)
            :                             :     :     +- ReusedExchange (105)
            :                             :     +- ReusedExchange (108)
            :                             +- ReusedExchange (111)
            :- * HashAggregate (126)
            :  +- Exchange (125)
            :     +- * HashAggregate (124)
            :        +- * HashAggregate (123)
            :           +- ReusedExchange (122)
            :- * HashAggregate (131)
            :  +- Exchange (130)
            :     +- * HashAggregate (129)
            :        +- * HashAggregate (128)
            :           +- ReusedExchange (127)
            :- * HashAggregate (136)
            :  +- Exchange (135)
            :     +- * HashAggregate (134)
            :        +- * HashAggregate (133)
            :           +- ReusedExchange (132)
            +- * HashAggregate (141)
               +- Exchange (140)
                  +- * HashAggregate (139)
                     +- * HashAggregate (138)
                        +- ReusedExchange (137)


(1) Scan parquet default.store_sales
Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>

(2) ColumnarToRow [codegen id : 1]
Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]

(3) Filter [codegen id : 1]
Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
Condition : isnotnull(ss_item_sk#1)

(4) Exchange
Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6]

(5) Sort [codegen id : 2]
Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0

(6) Scan parquet default.item
Output [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>

(7) ColumnarToRow [codegen id : 20]
Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10]

(8) Filter [codegen id : 20]
Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10]
Condition : ((isnotnull(i_brand_id#8) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10))

(9) Scan parquet default.store_sales
Output [2]: [ss_item_sk#11, ss_sold_date_sk#12]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int>

(10) ColumnarToRow [codegen id : 11]
Input [2]: [ss_item_sk#11, ss_sold_date_sk#12]

(11) Filter [codegen id : 11]
Input [2]: [ss_item_sk#11, ss_sold_date_sk#12]
Condition : isnotnull(ss_item_sk#11)

(12) ReusedExchange [Reuses operator id: 180]
Output [1]: [d_date_sk#14]

(13) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [ss_sold_date_sk#12]
Right keys [1]: [d_date_sk#14]
Join condition: None

(14) Project [codegen id : 11]
Output [1]: [ss_item_sk#11]
Input [3]: [ss_item_sk#11, ss_sold_date_sk#12, d_date_sk#14]

(15) Scan parquet default.item
Output [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>

(16) ColumnarToRow [codegen id : 4]
Input [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]

(17) Filter [codegen id : 4]
Input [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]
Condition : (((isnotnull(i_item_sk#15) AND isnotnull(i_brand_id#16)) AND isnotnull(i_class_id#17)) AND isnotnull(i_category_id#18))

(18) Exchange
Input [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]
Arguments: hashpartitioning(coalesce(i_brand_id#16, 0), isnull(i_brand_id#16), coalesce(i_class_id#17, 0), isnull(i_class_id#17), coalesce(i_category_id#18, 0), isnull(i_category_id#18), 5), ENSURE_REQUIREMENTS, [id=#19]

(19) Sort [codegen id : 5]
Input [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]
Arguments: [coalesce(i_brand_id#16, 0) ASC NULLS FIRST, isnull(i_brand_id#16) ASC NULLS FIRST, coalesce(i_class_id#17, 0) ASC NULLS FIRST, isnull(i_class_id#17) ASC NULLS FIRST, coalesce(i_category_id#18, 0) ASC NULLS FIRST, isnull(i_category_id#18) ASC NULLS FIRST], false, 0

(20) Scan parquet default.catalog_sales
Output [2]: [cs_item_sk#20, cs_sold_date_sk#21]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#21), dynamicpruningexpression(cs_sold_date_sk#21 IN dynamicpruning#13)]
PushedFilters: [IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_item_sk:int>

(21) ColumnarToRow [codegen id : 8]
Input [2]: [cs_item_sk#20, cs_sold_date_sk#21]

(22) Filter [codegen id : 8]
Input [2]: [cs_item_sk#20, cs_sold_date_sk#21]
Condition : isnotnull(cs_item_sk#20)

(23) ReusedExchange [Reuses operator id: 180]
Output [1]: [d_date_sk#22]

(24) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [cs_sold_date_sk#21]
Right keys [1]: [d_date_sk#22]
Join condition: None

(25) Project [codegen id : 8]
Output [1]: [cs_item_sk#20]
Input [3]: [cs_item_sk#20, cs_sold_date_sk#21, d_date_sk#22]

(26) Scan parquet default.item
Output [4]: [i_item_sk#23, i_brand_id#24, i_class_id#25, i_category_id#26]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>

(27) ColumnarToRow [codegen id : 7]
Input [4]: [i_item_sk#23, i_brand_id#24, i_class_id#25, i_category_id#26]

(28) Filter [codegen id : 7]
Input [4]: [i_item_sk#23, i_brand_id#24, i_class_id#25, i_category_id#26]
Condition : isnotnull(i_item_sk#23)

(29) BroadcastExchange
Input [4]: [i_item_sk#23, i_brand_id#24, i_class_id#25, i_category_id#26]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27]

(30) BroadcastHashJoin [codegen id : 8]
Left keys [1]: [cs_item_sk#20]
Right keys [1]: [i_item_sk#23]
Join condition: None

(31) Project [codegen id : 8]
Output [3]: [i_brand_id#24, i_class_id#25, i_category_id#26]
Input [5]: [cs_item_sk#20, i_item_sk#23, i_brand_id#24, i_class_id#25, i_category_id#26]

(32) Exchange
Input [3]: [i_brand_id#24, i_class_id#25, i_category_id#26]
Arguments: hashpartitioning(coalesce(i_brand_id#24, 0), isnull(i_brand_id#24), coalesce(i_class_id#25, 0), isnull(i_class_id#25), coalesce(i_category_id#26, 0), isnull(i_category_id#26), 5), ENSURE_REQUIREMENTS, [id=#28]

(33) Sort [codegen id : 9]
Input [3]: [i_brand_id#24, i_class_id#25, i_category_id#26]
Arguments: [coalesce(i_brand_id#24, 0) ASC NULLS FIRST, isnull(i_brand_id#24) ASC NULLS FIRST, coalesce(i_class_id#25, 0) ASC NULLS FIRST, isnull(i_class_id#25) ASC NULLS FIRST, coalesce(i_category_id#26, 0) ASC NULLS FIRST, isnull(i_category_id#26) ASC NULLS FIRST], false, 0

(34) SortMergeJoin [codegen id : 10]
Left keys [6]: [coalesce(i_brand_id#16, 0), isnull(i_brand_id#16), coalesce(i_class_id#17, 0), isnull(i_class_id#17), coalesce(i_category_id#18, 0), isnull(i_category_id#18)]
Right keys [6]: [coalesce(i_brand_id#24, 0), isnull(i_brand_id#24), coalesce(i_class_id#25, 0), isnull(i_class_id#25), coalesce(i_category_id#26, 0), isnull(i_category_id#26)]
Join condition: None

(35) BroadcastExchange
Input [4]: [i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29]

(36) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [ss_item_sk#11]
Right keys [1]: [i_item_sk#15]
Join condition: None

(37) Project [codegen id : 11]
Output [3]: [i_brand_id#16 AS brand_id#30, i_class_id#17 AS class_id#31, i_category_id#18 AS category_id#32]
Input [5]: [ss_item_sk#11, i_item_sk#15, i_brand_id#16, i_class_id#17, i_category_id#18]

(38) HashAggregate [codegen id : 11]
Input [3]: [brand_id#30, class_id#31, category_id#32]
Keys [3]: [brand_id#30, class_id#31, category_id#32]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#30, class_id#31, category_id#32]

(39) Exchange
Input [3]: [brand_id#30, class_id#31, category_id#32]
Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#33]

(40) HashAggregate [codegen id : 12]
Input [3]: [brand_id#30, class_id#31, category_id#32]
Keys [3]: [brand_id#30, class_id#31, category_id#32]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#30, class_id#31, category_id#32]

(41) Exchange
Input [3]: [brand_id#30, class_id#31, category_id#32]
Arguments: hashpartitioning(coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32), 5), ENSURE_REQUIREMENTS, [id=#34]

(42) Sort [codegen id : 13]
Input [3]: [brand_id#30, class_id#31, category_id#32]
Arguments: [coalesce(brand_id#30, 0) ASC NULLS FIRST, isnull(brand_id#30) ASC NULLS FIRST, coalesce(class_id#31, 0) ASC NULLS FIRST, isnull(class_id#31) ASC NULLS FIRST, coalesce(category_id#32, 0) ASC NULLS FIRST, isnull(category_id#32) ASC NULLS FIRST], false, 0

(43) Scan parquet default.web_sales
Output [2]: [ws_item_sk#35, ws_sold_date_sk#36]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#36), dynamicpruningexpression(ws_sold_date_sk#36 IN dynamicpruning#13)]
PushedFilters: [IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int>

(44) ColumnarToRow [codegen id : 16]
Input [2]: [ws_item_sk#35, ws_sold_date_sk#36]

(45) Filter [codegen id : 16]
Input [2]: [ws_item_sk#35, ws_sold_date_sk#36]
Condition : isnotnull(ws_item_sk#35)

(46) ReusedExchange [Reuses operator id: 180]
Output [1]: [d_date_sk#37]

(47) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [ws_sold_date_sk#36]
Right keys [1]: [d_date_sk#37]
Join condition: None

(48) Project [codegen id : 16]
Output [1]: [ws_item_sk#35]
Input [3]: [ws_item_sk#35, ws_sold_date_sk#36, d_date_sk#37]

(49) ReusedExchange [Reuses operator id: 29]
Output [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]

(50) BroadcastHashJoin [codegen id : 16]
Left keys [1]: [ws_item_sk#35]
Right keys [1]: [i_item_sk#38]
Join condition: None

(51) Project [codegen id : 16]
Output [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
Input [5]: [ws_item_sk#35, i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]

(52) Exchange
Input [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
Arguments: hashpartitioning(coalesce(i_brand_id#39, 0), isnull(i_brand_id#39), coalesce(i_class_id#40, 0), isnull(i_class_id#40), coalesce(i_category_id#41, 0), isnull(i_category_id#41), 5), ENSURE_REQUIREMENTS, [id=#42]

(53) Sort [codegen id : 17]
Input [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
Arguments: [coalesce(i_brand_id#39, 0) ASC NULLS FIRST, isnull(i_brand_id#39) ASC NULLS FIRST, coalesce(i_class_id#40, 0) ASC NULLS FIRST, isnull(i_class_id#40) ASC NULLS FIRST, coalesce(i_category_id#41, 0) ASC NULLS FIRST, isnull(i_category_id#41) ASC NULLS FIRST], false, 0

(54) SortMergeJoin [codegen id : 18]
Left keys [6]: [coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32)]
Right keys [6]: [coalesce(i_brand_id#39, 0), isnull(i_brand_id#39), coalesce(i_class_id#40, 0), isnull(i_class_id#40), coalesce(i_category_id#41, 0), isnull(i_category_id#41)]
Join condition: None

(55) HashAggregate [codegen id : 18]
Input [3]: [brand_id#30, class_id#31, category_id#32]
Keys [3]: [brand_id#30, class_id#31, category_id#32]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#30, class_id#31, category_id#32]

(56) Exchange
Input [3]: [brand_id#30, class_id#31, category_id#32]
Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#43]

(57) HashAggregate [codegen id : 19]
Input [3]: [brand_id#30, class_id#31, category_id#32]
Keys [3]: [brand_id#30, class_id#31, category_id#32]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#30, class_id#31, category_id#32]

(58) BroadcastExchange
Input [3]: [brand_id#30, class_id#31, category_id#32]
Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#44]

(59) BroadcastHashJoin [codegen id : 20]
Left keys [3]: [i_brand_id#8, i_class_id#9, i_category_id#10]
Right keys [3]: [brand_id#30, class_id#31, category_id#32]
Join condition: None

(60) Project [codegen id : 20]
Output [1]: [i_item_sk#7 AS ss_item_sk#45]
Input [7]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, brand_id#30, class_id#31, category_id#32]

(61) Exchange
Input [1]: [ss_item_sk#45]
Arguments: hashpartitioning(ss_item_sk#45, 5), ENSURE_REQUIREMENTS, [id=#46]

(62) Sort [codegen id : 21]
Input [1]: [ss_item_sk#45]
Arguments: [ss_item_sk#45 ASC NULLS FIRST], false, 0

(63) SortMergeJoin [codegen id : 45]
Left keys [1]: [ss_item_sk#1]
Right keys [1]: [ss_item_sk#45]
Join condition: None

(64) ReusedExchange [Reuses operator id: 175]
Output [1]: [d_date_sk#47]

(65) BroadcastHashJoin [codegen id : 45]
Left keys [1]: [ss_sold_date_sk#4]
Right keys [1]: [d_date_sk#47]
Join condition: None

(66) Project [codegen id : 45]
Output [3]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3]
Input [5]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, d_date_sk#47]

(67) Scan parquet default.item
Output [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>

(68) ColumnarToRow [codegen id : 23]
Input [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]

(69) Filter [codegen id : 23]
Input [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]
Condition : isnotnull(i_item_sk#48)

(70) Exchange
Input [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]
Arguments: hashpartitioning(i_item_sk#48, 5), ENSURE_REQUIREMENTS, [id=#52]

(71) Sort [codegen id : 24]
Input [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]
Arguments: [i_item_sk#48 ASC NULLS FIRST], false, 0

(72) ReusedExchange [Reuses operator id: 61]
Output [1]: [ss_item_sk#45]

(73) Sort [codegen id : 43]
Input [1]: [ss_item_sk#45]
Arguments: [ss_item_sk#45 ASC NULLS FIRST], false, 0

(74) SortMergeJoin [codegen id : 44]
Left keys [1]: [i_item_sk#48]
Right keys [1]: [ss_item_sk#45]
Join condition: None

(75) BroadcastExchange
Input [4]: [i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#53]

(76) BroadcastHashJoin [codegen id : 45]
Left keys [1]: [ss_item_sk#1]
Right keys [1]: [i_item_sk#48]
Join condition: None

(77) Project [codegen id : 45]
Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#49, i_class_id#50, i_category_id#51]
Input [7]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, i_item_sk#48, i_brand_id#49, i_class_id#50, i_category_id#51]

(78) HashAggregate [codegen id : 45]
Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#49, i_class_id#50, i_category_id#51]
Keys [3]: [i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)]
Aggregate Attributes [3]: [sum#54, isEmpty#55, count#56]
Results [6]: [i_brand_id#49, i_class_id#50, i_category_id#51, sum#57, isEmpty#58, count#59]

(79) Exchange
Input [6]: [i_brand_id#49, i_class_id#50, i_category_id#51, sum#57, isEmpty#58, count#59]
Arguments: hashpartitioning(i_brand_id#49, i_class_id#50, i_category_id#51, 5), ENSURE_REQUIREMENTS, [id=#60]

(80) HashAggregate [codegen id : 46]
Input [6]: [i_brand_id#49, i_class_id#50, i_category_id#51, sum#57, isEmpty#58, count#59]
Keys [3]: [i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)]
Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61, count(1)#62]
Results [6]: [store AS channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61 AS sales#64, count(1)#62 AS number_sales#65]

(81) Filter [codegen id : 46]
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sales#64, number_sales#65]
Condition : (isnotnull(sales#64) AND (cast(sales#64 as decimal(32,6)) > cast(Subquery scalar-subquery#66, [id=#67] as decimal(32,6))))

(82) Scan parquet default.catalog_sales
Output [4]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#71), dynamicpruningexpression(cs_sold_date_sk#71 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>

(83) ColumnarToRow [codegen id : 47]
Input [4]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71]

(84) Filter [codegen id : 47]
Input [4]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71]
Condition : isnotnull(cs_item_sk#68)

(85) Exchange
Input [4]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71]
Arguments: hashpartitioning(cs_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#72]

(86) Sort [codegen id : 48]
Input [4]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71]
Arguments: [cs_item_sk#68 ASC NULLS FIRST], false, 0

(87) ReusedExchange [Reuses operator id: 61]
Output [1]: [ss_item_sk#45]

(88) Sort [codegen id : 67]
Input [1]: [ss_item_sk#45]
Arguments: [ss_item_sk#45 ASC NULLS FIRST], false, 0

(89) SortMergeJoin [codegen id : 91]
Left keys [1]: [cs_item_sk#68]
Right keys [1]: [ss_item_sk#45]
Join condition: None

(90) ReusedExchange [Reuses operator id: 175]
Output [1]: [d_date_sk#73]

(91) BroadcastHashJoin [codegen id : 91]
Left keys [1]: [cs_sold_date_sk#71]
Right keys [1]: [d_date_sk#73]
Join condition: None

(92) Project [codegen id : 91]
Output [3]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70]
Input [5]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, cs_sold_date_sk#71, d_date_sk#73]

(93) ReusedExchange [Reuses operator id: 75]
Output [4]: [i_item_sk#74, i_brand_id#75, i_class_id#76, i_category_id#77]

(94) BroadcastHashJoin [codegen id : 91]
Left keys [1]: [cs_item_sk#68]
Right keys [1]: [i_item_sk#74]
Join condition: None

(95) Project [codegen id : 91]
Output [5]: [cs_quantity#69, cs_list_price#70, i_brand_id#75, i_class_id#76, i_category_id#77]
Input [7]: [cs_item_sk#68, cs_quantity#69, cs_list_price#70, i_item_sk#74, i_brand_id#75, i_class_id#76, i_category_id#77]

(96) HashAggregate [codegen id : 91]
Input [5]: [cs_quantity#69, cs_list_price#70, i_brand_id#75, i_class_id#76, i_category_id#77]
Keys [3]: [i_brand_id#75, i_class_id#76, i_category_id#77]
Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#70 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)]
Aggregate Attributes [3]: [sum#78, isEmpty#79, count#80]
Results [6]: [i_brand_id#75, i_class_id#76, i_category_id#77, sum#81, isEmpty#82, count#83]

(97) Exchange
Input [6]: [i_brand_id#75, i_class_id#76, i_category_id#77, sum#81, isEmpty#82, count#83]
Arguments: hashpartitioning(i_brand_id#75, i_class_id#76, i_category_id#77, 5), ENSURE_REQUIREMENTS, [id=#84]

(98) HashAggregate [codegen id : 92]
Input [6]: [i_brand_id#75, i_class_id#76, i_category_id#77, sum#81, isEmpty#82, count#83]
Keys [3]: [i_brand_id#75, i_class_id#76, i_category_id#77]
Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#70 as decimal(12,2)))), DecimalType(18,2), true)), count(1)]
Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#85, count(1)#86]
Results [6]: [catalog AS channel#87, i_brand_id#75, i_class_id#76, i_category_id#77, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#69 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#70 as decimal(12,2)))), DecimalType(18,2), true))#85 AS sales#88, count(1)#86 AS number_sales#89]

(99) Filter [codegen id : 92]
Input [6]: [channel#87, i_brand_id#75, i_class_id#76, i_category_id#77, sales#88, number_sales#89]
Condition : (isnotnull(sales#88) AND (cast(sales#88 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6))))

(100) Scan parquet default.web_sales
Output [4]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#93), dynamicpruningexpression(ws_sold_date_sk#93 IN dynamicpruning#5)]
PushedFilters: [IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>

(101) ColumnarToRow [codegen id : 93]
Input [4]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]

(102) Filter [codegen id : 93]
Input [4]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
Condition : isnotnull(ws_item_sk#90)

(103) Exchange
Input [4]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
Arguments: hashpartitioning(ws_item_sk#90, 5), ENSURE_REQUIREMENTS, [id=#94]

(104) Sort [codegen id : 94]
Input [4]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
Arguments: [ws_item_sk#90 ASC NULLS FIRST], false, 0

(105) ReusedExchange [Reuses operator id: 61]
Output [1]: [ss_item_sk#45]

(106) Sort [codegen id : 113]
Input [1]: [ss_item_sk#45]
Arguments: [ss_item_sk#45 ASC NULLS FIRST], false, 0

(107) SortMergeJoin [codegen id : 137]
Left keys [1]: [ws_item_sk#90]
Right keys [1]: [ss_item_sk#45]
Join condition: None

(108) ReusedExchange [Reuses operator id: 175]
Output [1]: [d_date_sk#95]

(109) BroadcastHashJoin [codegen id : 137]
Left keys [1]: [ws_sold_date_sk#93]
Right keys [1]: [d_date_sk#95]
Join condition: None

(110) Project [codegen id : 137]
Output [3]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92]
Input [5]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93, d_date_sk#95]

(111) ReusedExchange [Reuses operator id: 75]
Output [4]: [i_item_sk#96, i_brand_id#97, i_class_id#98, i_category_id#99]

(112) BroadcastHashJoin [codegen id : 137]
Left keys [1]: [ws_item_sk#90]
Right keys [1]: [i_item_sk#96]
Join condition: None

(113) Project [codegen id : 137]
Output [5]: [ws_quantity#91, ws_list_price#92, i_brand_id#97, i_class_id#98, i_category_id#99]
Input [7]: [ws_item_sk#90, ws_quantity#91, ws_list_price#92, i_item_sk#96, i_brand_id#97, i_class_id#98, i_category_id#99]

(114) HashAggregate [codegen id : 137]
Input [5]: [ws_quantity#91, ws_list_price#92, i_brand_id#97, i_class_id#98, i_category_id#99]
Keys [3]: [i_brand_id#97, i_class_id#98, i_category_id#99]
Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#91 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#92 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)]
Aggregate Attributes [3]: [sum#100, isEmpty#101, count#102]
Results [6]: [i_brand_id#97, i_class_id#98, i_category_id#99, sum#103, isEmpty#104, count#105]

(115) Exchange
Input [6]: [i_brand_id#97, i_class_id#98, i_category_id#99, sum#103, isEmpty#104, count#105]
Arguments: hashpartitioning(i_brand_id#97, i_class_id#98, i_category_id#99, 5), ENSURE_REQUIREMENTS, [id=#106]

(116) HashAggregate [codegen id : 138]
Input [6]: [i_brand_id#97, i_class_id#98, i_category_id#99, sum#103, isEmpty#104, count#105]
Keys [3]: [i_brand_id#97, i_class_id#98, i_category_id#99]
Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#91 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#92 as decimal(12,2)))), DecimalType(18,2), true)), count(1)]
Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#91 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#92 as decimal(12,2)))), DecimalType(18,2), true))#107, count(1)#108]
Results [6]: [web AS channel#109, i_brand_id#97, i_class_id#98, i_category_id#99, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#91 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#92 as decimal(12,2)))), DecimalType(18,2), true))#107 AS sales#110, count(1)#108 AS number_sales#111]

(117) Filter [codegen id : 138]
Input [6]: [channel#109, i_brand_id#97, i_class_id#98, i_category_id#99, sales#110, number_sales#111]
Condition : (isnotnull(sales#110) AND (cast(sales#110 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6))))

(118) Union

(119) HashAggregate [codegen id : 139]
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sales#64, number_sales#65]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [partial_sum(sales#64), partial_sum(number_sales#65)]
Aggregate Attributes [3]: [sum#112, isEmpty#113, sum#114]
Results [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]

(120) Exchange
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Arguments: hashpartitioning(channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, 5), ENSURE_REQUIREMENTS, [id=#118]

(121) HashAggregate [codegen id : 140]
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(sales#64), sum(number_sales#65)]
Aggregate Attributes [2]: [sum(sales#64)#119, sum(number_sales#65)#120]
Results [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum(sales#64)#119 AS sum_sales#121, sum(number_sales#65)#120 AS number_sales#122]

(122) ReusedExchange [Reuses operator id: 120]
Output [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]

(123) HashAggregate [codegen id : 280]
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(sales#64), sum(number_sales#65)]
Aggregate Attributes [2]: [sum(sales#64)#119, sum(number_sales#65)#120]
Results [5]: [channel#63, i_brand_id#49, i_class_id#50, sum(sales#64)#119 AS sum_sales#121, sum(number_sales#65)#120 AS number_sales#122]

(124) HashAggregate [codegen id : 280]
Input [5]: [channel#63, i_brand_id#49, i_class_id#50, sum_sales#121, number_sales#122]
Keys [3]: [channel#63, i_brand_id#49, i_class_id#50]
Functions [2]: [partial_sum(sum_sales#121), partial_sum(number_sales#122)]
Aggregate Attributes [3]: [sum#123, isEmpty#124, sum#125]
Results [6]: [channel#63, i_brand_id#49, i_class_id#50, sum#126, isEmpty#127, sum#128]

(125) Exchange
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, sum#126, isEmpty#127, sum#128]
Arguments: hashpartitioning(channel#63, i_brand_id#49, i_class_id#50, 5), ENSURE_REQUIREMENTS, [id=#129]

(126) HashAggregate [codegen id : 281]
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, sum#126, isEmpty#127, sum#128]
Keys [3]: [channel#63, i_brand_id#49, i_class_id#50]
Functions [2]: [sum(sum_sales#121), sum(number_sales#122)]
Aggregate Attributes [2]: [sum(sum_sales#121)#130, sum(number_sales#122)#131]
Results [6]: [channel#63, i_brand_id#49, i_class_id#50, null AS i_category_id#132, sum(sum_sales#121)#130 AS sum(sum_sales)#133, sum(number_sales#122)#131 AS sum(number_sales)#134]

(127) ReusedExchange [Reuses operator id: 120]
Output [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]

(128) HashAggregate [codegen id : 421]
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(sales#64), sum(number_sales#65)]
Aggregate Attributes [2]: [sum(sales#64)#119, sum(number_sales#65)#120]
Results [4]: [channel#63, i_brand_id#49, sum(sales#64)#119 AS sum_sales#121, sum(number_sales#65)#120 AS number_sales#122]

(129) HashAggregate [codegen id : 421]
Input [4]: [channel#63, i_brand_id#49, sum_sales#121, number_sales#122]
Keys [2]: [channel#63, i_brand_id#49]
Functions [2]: [partial_sum(sum_sales#121), partial_sum(number_sales#122)]
Aggregate Attributes [3]: [sum#135, isEmpty#136, sum#137]
Results [5]: [channel#63, i_brand_id#49, sum#138, isEmpty#139, sum#140]

(130) Exchange
Input [5]: [channel#63, i_brand_id#49, sum#138, isEmpty#139, sum#140]
Arguments: hashpartitioning(channel#63, i_brand_id#49, 5), ENSURE_REQUIREMENTS, [id=#141]

(131) HashAggregate [codegen id : 422]
Input [5]: [channel#63, i_brand_id#49, sum#138, isEmpty#139, sum#140]
Keys [2]: [channel#63, i_brand_id#49]
Functions [2]: [sum(sum_sales#121), sum(number_sales#122)]
Aggregate Attributes [2]: [sum(sum_sales#121)#142, sum(number_sales#122)#143]
Results [6]: [channel#63, i_brand_id#49, null AS i_class_id#144, null AS i_category_id#145, sum(sum_sales#121)#142 AS sum(sum_sales)#146, sum(number_sales#122)#143 AS sum(number_sales)#147]

(132) ReusedExchange [Reuses operator id: 120]
Output [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]

(133) HashAggregate [codegen id : 562]
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(sales#64), sum(number_sales#65)]
Aggregate Attributes [2]: [sum(sales#64)#119, sum(number_sales#65)#120]
Results [3]: [channel#63, sum(sales#64)#119 AS sum_sales#121, sum(number_sales#65)#120 AS number_sales#122]

(134) HashAggregate [codegen id : 562]
Input [3]: [channel#63, sum_sales#121, number_sales#122]
Keys [1]: [channel#63]
Functions [2]: [partial_sum(sum_sales#121), partial_sum(number_sales#122)]
Aggregate Attributes [3]: [sum#148, isEmpty#149, sum#150]
Results [4]: [channel#63, sum#151, isEmpty#152, sum#153]

(135) Exchange
Input [4]: [channel#63, sum#151, isEmpty#152, sum#153]
Arguments: hashpartitioning(channel#63, 5), ENSURE_REQUIREMENTS, [id=#154]

(136) HashAggregate [codegen id : 563]
Input [4]: [channel#63, sum#151, isEmpty#152, sum#153]
Keys [1]: [channel#63]
Functions [2]: [sum(sum_sales#121), sum(number_sales#122)]
Aggregate Attributes [2]: [sum(sum_sales#121)#155, sum(number_sales#122)#156]
Results [6]: [channel#63, null AS i_brand_id#157, null AS i_class_id#158, null AS i_category_id#159, sum(sum_sales#121)#155 AS sum(sum_sales)#160, sum(number_sales#122)#156 AS sum(number_sales)#161]

(137) ReusedExchange [Reuses operator id: 120]
Output [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]

(138) HashAggregate [codegen id : 703]
Input [7]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum#115, isEmpty#116, sum#117]
Keys [4]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51]
Functions [2]: [sum(sales#64), sum(number_sales#65)]
Aggregate Attributes [2]: [sum(sales#64)#119, sum(number_sales#65)#120]
Results [2]: [sum(sales#64)#119 AS sum_sales#121, sum(number_sales#65)#120 AS number_sales#122]

(139) HashAggregate [codegen id : 703]
Input [2]: [sum_sales#121, number_sales#122]
Keys: []
Functions [2]: [partial_sum(sum_sales#121), partial_sum(number_sales#122)]
Aggregate Attributes [3]: [sum#162, isEmpty#163, sum#164]
Results [3]: [sum#165, isEmpty#166, sum#167]

(140) Exchange
Input [3]: [sum#165, isEmpty#166, sum#167]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#168]

(141) HashAggregate [codegen id : 704]
Input [3]: [sum#165, isEmpty#166, sum#167]
Keys: []
Functions [2]: [sum(sum_sales#121), sum(number_sales#122)]
Aggregate Attributes [2]: [sum(sum_sales#121)#169, sum(number_sales#122)#170]
Results [6]: [null AS channel#171, null AS i_brand_id#172, null AS i_class_id#173, null AS i_category_id#174, sum(sum_sales#121)#169 AS sum(sum_sales)#175, sum(number_sales#122)#170 AS sum(number_sales)#176]

(142) Union

(143) HashAggregate [codegen id : 705]
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Keys [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Functions: []
Aggregate Attributes: []
Results [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]

(144) Exchange
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Arguments: hashpartitioning(channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122, 5), ENSURE_REQUIREMENTS, [id=#177]

(145) HashAggregate [codegen id : 706]
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Keys [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Functions: []
Aggregate Attributes: []
Results [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]

(146) TakeOrderedAndProject
Input [6]: [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]
Arguments: 100, [channel#63 ASC NULLS FIRST, i_brand_id#49 ASC NULLS FIRST, i_class_id#50 ASC NULLS FIRST, i_category_id#51 ASC NULLS FIRST], [channel#63, i_brand_id#49, i_class_id#50, i_category_id#51, sum_sales#121, number_sales#122]

===== Subqueries =====

Subquery:1 Hosting operator id = 81 Hosting Expression = Subquery scalar-subquery#66, [id=#67]
* HashAggregate (165)
+- Exchange (164)
   +- * HashAggregate (163)
      +- Union (162)
         :- * Project (151)
         :  +- * BroadcastHashJoin Inner BuildRight (150)
         :     :- * ColumnarToRow (148)
         :     :  +- Scan parquet default.store_sales (147)
         :     +- ReusedExchange (149)
         :- * Project (156)
         :  +- * BroadcastHashJoin Inner BuildRight (155)
         :     :- * ColumnarToRow (153)
         :     :  +- Scan parquet default.catalog_sales (152)
         :     +- ReusedExchange (154)
         +- * Project (161)
            +- * BroadcastHashJoin Inner BuildRight (160)
               :- * ColumnarToRow (158)
               :  +- Scan parquet default.web_sales (157)
               +- ReusedExchange (159)


(147) Scan parquet default.store_sales
Output [3]: [ss_quantity#178, ss_list_price#179, ss_sold_date_sk#180]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#180), dynamicpruningexpression(ss_sold_date_sk#180 IN dynamicpruning#13)]
ReadSchema: struct<ss_quantity:int,ss_list_price:decimal(7,2)>

(148) ColumnarToRow [codegen id : 2]
Input [3]: [ss_quantity#178, ss_list_price#179, ss_sold_date_sk#180]

(149) ReusedExchange [Reuses operator id: 180]
Output [1]: [d_date_sk#181]

(150) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#180]
Right keys [1]: [d_date_sk#181]
Join condition: None

(151) Project [codegen id : 2]
Output [2]: [ss_quantity#178 AS quantity#182, ss_list_price#179 AS list_price#183]
Input [4]: [ss_quantity#178, ss_list_price#179, ss_sold_date_sk#180, d_date_sk#181]

(152) Scan parquet default.catalog_sales
Output [3]: [cs_quantity#184, cs_list_price#185, cs_sold_date_sk#186]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#186), dynamicpruningexpression(cs_sold_date_sk#186 IN dynamicpruning#187)]
ReadSchema: struct<cs_quantity:int,cs_list_price:decimal(7,2)>

(153) ColumnarToRow [codegen id : 4]
Input [3]: [cs_quantity#184, cs_list_price#185, cs_sold_date_sk#186]

(154) ReusedExchange [Reuses operator id: 170]
Output [1]: [d_date_sk#188]

(155) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_sold_date_sk#186]
Right keys [1]: [d_date_sk#188]
Join condition: None

(156) Project [codegen id : 4]
Output [2]: [cs_quantity#184 AS quantity#189, cs_list_price#185 AS list_price#190]
Input [4]: [cs_quantity#184, cs_list_price#185, cs_sold_date_sk#186, d_date_sk#188]

(157) Scan parquet default.web_sales
Output [3]: [ws_quantity#191, ws_list_price#192, ws_sold_date_sk#193]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#193), dynamicpruningexpression(ws_sold_date_sk#193 IN dynamicpruning#187)]
ReadSchema: struct<ws_quantity:int,ws_list_price:decimal(7,2)>

(158) ColumnarToRow [codegen id : 6]
Input [3]: [ws_quantity#191, ws_list_price#192, ws_sold_date_sk#193]

(159) ReusedExchange [Reuses operator id: 170]
Output [1]: [d_date_sk#194]

(160) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_sold_date_sk#193]
Right keys [1]: [d_date_sk#194]
Join condition: None

(161) Project [codegen id : 6]
Output [2]: [ws_quantity#191 AS quantity#195, ws_list_price#192 AS list_price#196]
Input [4]: [ws_quantity#191, ws_list_price#192, ws_sold_date_sk#193, d_date_sk#194]

(162) Union

(163) HashAggregate [codegen id : 7]
Input [2]: [quantity#182, list_price#183]
Keys: []
Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#182 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#183 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [2]: [sum#197, count#198]
Results [2]: [sum#199, count#200]

(164) Exchange
Input [2]: [sum#199, count#200]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#201]

(165) HashAggregate [codegen id : 8]
Input [2]: [sum#199, count#200]
Keys: []
Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#182 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#183 as decimal(12,2)))), DecimalType(18,2), true))]
Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#182 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#183 as decimal(12,2)))), DecimalType(18,2), true))#202]
Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#182 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#183 as decimal(12,2)))), DecimalType(18,2), true))#202 AS average_sales#203]

Subquery:2 Hosting operator id = 147 Hosting Expression = ss_sold_date_sk#180 IN dynamicpruning#13

Subquery:3 Hosting operator id = 152 Hosting Expression = cs_sold_date_sk#186 IN dynamicpruning#187
BroadcastExchange (170)
+- * Project (169)
   +- * Filter (168)
      +- * ColumnarToRow (167)
         +- Scan parquet default.date_dim (166)


(166) Scan parquet default.date_dim
Output [2]: [d_date_sk#188, d_year#204]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(167) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#188, d_year#204]

(168) Filter [codegen id : 1]
Input [2]: [d_date_sk#188, d_year#204]
Condition : (((isnotnull(d_year#204) AND (d_year#204 >= 1998)) AND (d_year#204 <= 2000)) AND isnotnull(d_date_sk#188))

(169) Project [codegen id : 1]
Output [1]: [d_date_sk#188]
Input [2]: [d_date_sk#188, d_year#204]

(170) BroadcastExchange
Input [1]: [d_date_sk#188]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#205]

Subquery:4 Hosting operator id = 157 Hosting Expression = ws_sold_date_sk#193 IN dynamicpruning#187

Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
BroadcastExchange (175)
+- * Project (174)
   +- * Filter (173)
      +- * ColumnarToRow (172)
         +- Scan parquet default.date_dim (171)


(171) Scan parquet default.date_dim
Output [3]: [d_date_sk#47, d_year#206, d_moy#207]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,11), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(172) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#47, d_year#206, d_moy#207]

(173) Filter [codegen id : 1]
Input [3]: [d_date_sk#47, d_year#206, d_moy#207]
Condition : ((((isnotnull(d_year#206) AND isnotnull(d_moy#207)) AND (d_year#206 = 2000)) AND (d_moy#207 = 11)) AND isnotnull(d_date_sk#47))

(174) Project [codegen id : 1]
Output [1]: [d_date_sk#47]
Input [3]: [d_date_sk#47, d_year#206, d_moy#207]

(175) BroadcastExchange
Input [1]: [d_date_sk#47]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#208]

Subquery:6 Hosting operator id = 9 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13
BroadcastExchange (180)
+- * Project (179)
   +- * Filter (178)
      +- * ColumnarToRow (177)
         +- Scan parquet default.date_dim (176)


(176) Scan parquet default.date_dim
Output [2]: [d_date_sk#14, d_year#209]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int>

(177) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#14, d_year#209]

(178) Filter [codegen id : 1]
Input [2]: [d_date_sk#14, d_year#209]
Condition : (((isnotnull(d_year#209) AND (d_year#209 >= 1999)) AND (d_year#209 <= 2001)) AND isnotnull(d_date_sk#14))

(179) Project [codegen id : 1]
Output [1]: [d_date_sk#14]
Input [2]: [d_date_sk#14, d_year#209]

(180) BroadcastExchange
Input [1]: [d_date_sk#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#210]

Subquery:7 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#21 IN dynamicpruning#13

Subquery:8 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#36 IN dynamicpruning#13

Subquery:9 Hosting operator id = 99 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67]

Subquery:10 Hosting operator id = 82 Hosting Expression = cs_sold_date_sk#71 IN dynamicpruning#5

Subquery:11 Hosting operator id = 117 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67]

Subquery:12 Hosting operator id = 100 Hosting Expression = ws_sold_date_sk#93 IN dynamicpruning#5


