== Physical Plan ==
TakeOrderedAndProject (96)
+- * BroadcastHashJoin Inner BuildRight (95)
   :- * Filter (74)
   :  +- * HashAggregate (73)
   :     +- Exchange (72)
   :        +- * HashAggregate (71)
   :           +- * Project (70)
   :              +- * BroadcastHashJoin Inner BuildRight (69)
   :                 :- * Project (63)
   :                 :  +- * BroadcastHashJoin Inner BuildRight (62)
   :                 :     :- * BroadcastHashJoin LeftSemi BuildRight (55)
   :                 :     :  :- * Filter (3)
   :                 :     :  :  +- * ColumnarToRow (2)
   :                 :     :  :     +- Scan parquet spark_catalog.default.store_sales (1)
   :                 :     :  +- BroadcastExchange (54)
   :                 :     :     +- * Project (53)
   :                 :     :        +- * BroadcastHashJoin Inner BuildRight (52)
   :                 :     :           :- * Filter (6)
   :                 :     :           :  +- * ColumnarToRow (5)
   :                 :     :           :     +- Scan parquet spark_catalog.default.item (4)
   :                 :     :           +- BroadcastExchange (51)
   :                 :     :              +- * BroadcastHashJoin LeftSemi BuildRight (50)
   :                 :     :                 :- * HashAggregate (39)
   :                 :     :                 :  +- Exchange (38)
   :                 :     :                 :     +- * HashAggregate (37)
   :                 :     :                 :        +- * Project (36)
   :                 :     :                 :           +- * BroadcastHashJoin Inner BuildRight (35)
   :                 :     :                 :              :- * Project (33)
   :                 :     :                 :              :  +- * BroadcastHashJoin Inner BuildRight (32)
   :                 :     :                 :              :     :- * Filter (9)
   :                 :     :                 :              :     :  +- * ColumnarToRow (8)
   :                 :     :                 :              :     :     +- Scan parquet spark_catalog.default.store_sales (7)
   :                 :     :                 :              :     +- BroadcastExchange (31)
   :                 :     :                 :              :        +- * BroadcastHashJoin LeftSemi BuildRight (30)
   :                 :     :                 :              :           :- * Filter (12)
   :                 :     :                 :              :           :  +- * ColumnarToRow (11)
   :                 :     :                 :              :           :     +- Scan parquet spark_catalog.default.item (10)
   :                 :     :                 :              :           +- BroadcastExchange (29)
   :                 :     :                 :              :              +- * Project (28)
   :                 :     :                 :              :                 +- * BroadcastHashJoin Inner BuildRight (27)
   :                 :     :                 :              :                    :- * Project (21)
   :                 :     :                 :              :                    :  +- * BroadcastHashJoin Inner BuildRight (20)
   :                 :     :                 :              :                    :     :- * Filter (15)
   :                 :     :                 :              :                    :     :  +- * ColumnarToRow (14)
   :                 :     :                 :              :                    :     :     +- Scan parquet spark_catalog.default.catalog_sales (13)
   :                 :     :                 :              :                    :     +- BroadcastExchange (19)
   :                 :     :                 :              :                    :        +- * Filter (18)
   :                 :     :                 :              :                    :           +- * ColumnarToRow (17)
   :                 :     :                 :              :                    :              +- Scan parquet spark_catalog.default.item (16)
   :                 :     :                 :              :                    +- BroadcastExchange (26)
   :                 :     :                 :              :                       +- * Project (25)
   :                 :     :                 :              :                          +- * Filter (24)
   :                 :     :                 :              :                             +- * ColumnarToRow (23)
   :                 :     :                 :              :                                +- Scan parquet spark_catalog.default.date_dim (22)
   :                 :     :                 :              +- ReusedExchange (34)
   :                 :     :                 +- BroadcastExchange (49)
   :                 :     :                    +- * Project (48)
   :                 :     :                       +- * BroadcastHashJoin Inner BuildRight (47)
   :                 :     :                          :- * Project (45)
   :                 :     :                          :  +- * BroadcastHashJoin Inner BuildRight (44)
   :                 :     :                          :     :- * Filter (42)
   :                 :     :                          :     :  +- * ColumnarToRow (41)
   :                 :     :                          :     :     +- Scan parquet spark_catalog.default.web_sales (40)
   :                 :     :                          :     +- ReusedExchange (43)
   :                 :     :                          +- ReusedExchange (46)
   :                 :     +- BroadcastExchange (61)
   :                 :        +- * BroadcastHashJoin LeftSemi BuildRight (60)
   :                 :           :- * Filter (58)
   :                 :           :  +- * ColumnarToRow (57)
   :                 :           :     +- Scan parquet spark_catalog.default.item (56)
   :                 :           +- ReusedExchange (59)
   :                 +- BroadcastExchange (68)
   :                    +- * Project (67)
   :                       +- * Filter (66)
   :                          +- * ColumnarToRow (65)
   :                             +- Scan parquet spark_catalog.default.date_dim (64)
   +- BroadcastExchange (94)
      +- * Filter (93)
         +- * HashAggregate (92)
            +- Exchange (91)
               +- * HashAggregate (90)
                  +- * Project (89)
                     +- * BroadcastHashJoin Inner BuildRight (88)
                        :- * Project (82)
                        :  +- * BroadcastHashJoin Inner BuildRight (81)
                        :     :- * BroadcastHashJoin LeftSemi BuildRight (79)
                        :     :  :- * Filter (77)
                        :     :  :  +- * ColumnarToRow (76)
                        :     :  :     +- Scan parquet spark_catalog.default.store_sales (75)
                        :     :  +- ReusedExchange (78)
                        :     +- ReusedExchange (80)
                        +- BroadcastExchange (87)
                           +- * Project (86)
                              +- * Filter (85)
                                 +- * ColumnarToRow (84)
                                    +- Scan parquet spark_catalog.default.date_dim (83)


(1) Scan parquet spark_catalog.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)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>

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

(3) Filter [codegen id : 25]
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) Scan parquet spark_catalog.default.item
Output [4]: [i_item_sk#5, i_brand_id#6, i_class_id#7, i_category_id#8]
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>

(5) ColumnarToRow [codegen id : 11]
Input [4]: [i_item_sk#5, i_brand_id#6, i_class_id#7, i_category_id#8]

(6) Filter [codegen id : 11]
Input [4]: [i_item_sk#5, i_brand_id#6, i_class_id#7, i_category_id#8]
Condition : ((isnotnull(i_brand_id#6) AND isnotnull(i_class_id#7)) AND isnotnull(i_category_id#8))

(7) Scan parquet spark_catalog.default.store_sales
Output [2]: [ss_item_sk#9, ss_sold_date_sk#10]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#10)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int>

(8) ColumnarToRow [codegen id : 6]
Input [2]: [ss_item_sk#9, ss_sold_date_sk#10]

(9) Filter [codegen id : 6]
Input [2]: [ss_item_sk#9, ss_sold_date_sk#10]
Condition : isnotnull(ss_item_sk#9)

(10) Scan parquet spark_catalog.default.item
Output [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14]
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>

(11) ColumnarToRow [codegen id : 4]
Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14]

(12) Filter [codegen id : 4]
Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14]
Condition : (((isnotnull(i_item_sk#11) AND isnotnull(i_brand_id#12)) AND isnotnull(i_class_id#13)) AND isnotnull(i_category_id#14))

(13) Scan parquet spark_catalog.default.catalog_sales
Output [2]: [cs_item_sk#15, cs_sold_date_sk#16]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#16)]
PushedFilters: [IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_item_sk:int>

(14) ColumnarToRow [codegen id : 3]
Input [2]: [cs_item_sk#15, cs_sold_date_sk#16]

(15) Filter [codegen id : 3]
Input [2]: [cs_item_sk#15, cs_sold_date_sk#16]
Condition : isnotnull(cs_item_sk#15)

(16) Scan parquet spark_catalog.default.item
Output [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20]
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>

(17) ColumnarToRow [codegen id : 1]
Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20]

(18) Filter [codegen id : 1]
Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20]
Condition : isnotnull(i_item_sk#17)

(19) BroadcastExchange
Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]

(20) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [cs_item_sk#15]
Right keys [1]: [i_item_sk#17]
Join type: Inner
Join condition: None

(21) Project [codegen id : 3]
Output [4]: [cs_sold_date_sk#16, i_brand_id#18, i_class_id#19, i_category_id#20]
Input [6]: [cs_item_sk#15, cs_sold_date_sk#16, i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20]

(22) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#21, d_year#22]
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>

(23) ColumnarToRow [codegen id : 2]
Input [2]: [d_date_sk#21, d_year#22]

(24) Filter [codegen id : 2]
Input [2]: [d_date_sk#21, d_year#22]
Condition : (((isnotnull(d_year#22) AND (d_year#22 >= 1999)) AND (d_year#22 <= 2001)) AND isnotnull(d_date_sk#21))

(25) Project [codegen id : 2]
Output [1]: [d_date_sk#21]
Input [2]: [d_date_sk#21, d_year#22]

(26) BroadcastExchange
Input [1]: [d_date_sk#21]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]

(27) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [cs_sold_date_sk#16]
Right keys [1]: [d_date_sk#21]
Join type: Inner
Join condition: None

(28) Project [codegen id : 3]
Output [3]: [i_brand_id#18, i_class_id#19, i_category_id#20]
Input [5]: [cs_sold_date_sk#16, i_brand_id#18, i_class_id#19, i_category_id#20, d_date_sk#21]

(29) BroadcastExchange
Input [3]: [i_brand_id#18, i_class_id#19, i_category_id#20]
Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=3]

(30) BroadcastHashJoin [codegen id : 4]
Left keys [6]: [coalesce(i_brand_id#12, 0), isnull(i_brand_id#12), coalesce(i_class_id#13, 0), isnull(i_class_id#13), coalesce(i_category_id#14, 0), isnull(i_category_id#14)]
Right keys [6]: [coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20)]
Join type: LeftSemi
Join condition: None

(31) BroadcastExchange
Input [4]: [i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(32) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_item_sk#9]
Right keys [1]: [i_item_sk#11]
Join type: Inner
Join condition: None

(33) Project [codegen id : 6]
Output [4]: [ss_sold_date_sk#10, i_brand_id#12, i_class_id#13, i_category_id#14]
Input [6]: [ss_item_sk#9, ss_sold_date_sk#10, i_item_sk#11, i_brand_id#12, i_class_id#13, i_category_id#14]

(34) ReusedExchange [Reuses operator id: 26]
Output [1]: [d_date_sk#23]

(35) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#10]
Right keys [1]: [d_date_sk#23]
Join type: Inner
Join condition: None

(36) Project [codegen id : 6]
Output [3]: [i_brand_id#12 AS brand_id#24, i_class_id#13 AS class_id#25, i_category_id#14 AS category_id#26]
Input [5]: [ss_sold_date_sk#10, i_brand_id#12, i_class_id#13, i_category_id#14, d_date_sk#23]

(37) HashAggregate [codegen id : 6]
Input [3]: [brand_id#24, class_id#25, category_id#26]
Keys [3]: [brand_id#24, class_id#25, category_id#26]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#24, class_id#25, category_id#26]

(38) Exchange
Input [3]: [brand_id#24, class_id#25, category_id#26]
Arguments: hashpartitioning(brand_id#24, class_id#25, category_id#26, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(39) HashAggregate [codegen id : 10]
Input [3]: [brand_id#24, class_id#25, category_id#26]
Keys [3]: [brand_id#24, class_id#25, category_id#26]
Functions: []
Aggregate Attributes: []
Results [3]: [brand_id#24, class_id#25, category_id#26]

(40) Scan parquet spark_catalog.default.web_sales
Output [2]: [ws_item_sk#27, ws_sold_date_sk#28]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#28)]
PushedFilters: [IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int>

(41) ColumnarToRow [codegen id : 9]
Input [2]: [ws_item_sk#27, ws_sold_date_sk#28]

(42) Filter [codegen id : 9]
Input [2]: [ws_item_sk#27, ws_sold_date_sk#28]
Condition : isnotnull(ws_item_sk#27)

(43) ReusedExchange [Reuses operator id: 19]
Output [4]: [i_item_sk#29, i_brand_id#30, i_class_id#31, i_category_id#32]

(44) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ws_item_sk#27]
Right keys [1]: [i_item_sk#29]
Join type: Inner
Join condition: None

(45) Project [codegen id : 9]
Output [4]: [ws_sold_date_sk#28, i_brand_id#30, i_class_id#31, i_category_id#32]
Input [6]: [ws_item_sk#27, ws_sold_date_sk#28, i_item_sk#29, i_brand_id#30, i_class_id#31, i_category_id#32]

(46) ReusedExchange [Reuses operator id: 26]
Output [1]: [d_date_sk#33]

(47) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ws_sold_date_sk#28]
Right keys [1]: [d_date_sk#33]
Join type: Inner
Join condition: None

(48) Project [codegen id : 9]
Output [3]: [i_brand_id#30, i_class_id#31, i_category_id#32]
Input [5]: [ws_sold_date_sk#28, i_brand_id#30, i_class_id#31, i_category_id#32, d_date_sk#33]

(49) BroadcastExchange
Input [3]: [i_brand_id#30, i_class_id#31, i_category_id#32]
Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=6]

(50) BroadcastHashJoin [codegen id : 10]
Left keys [6]: [coalesce(brand_id#24, 0), isnull(brand_id#24), coalesce(class_id#25, 0), isnull(class_id#25), coalesce(category_id#26, 0), isnull(category_id#26)]
Right keys [6]: [coalesce(i_brand_id#30, 0), isnull(i_brand_id#30), coalesce(i_class_id#31, 0), isnull(i_class_id#31), coalesce(i_category_id#32, 0), isnull(i_category_id#32)]
Join type: LeftSemi
Join condition: None

(51) BroadcastExchange
Input [3]: [brand_id#24, class_id#25, category_id#26]
Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [plan_id=7]

(52) BroadcastHashJoin [codegen id : 11]
Left keys [3]: [i_brand_id#6, i_class_id#7, i_category_id#8]
Right keys [3]: [brand_id#24, class_id#25, category_id#26]
Join type: Inner
Join condition: None

(53) Project [codegen id : 11]
Output [1]: [i_item_sk#5 AS ss_item_sk#34]
Input [7]: [i_item_sk#5, i_brand_id#6, i_class_id#7, i_category_id#8, brand_id#24, class_id#25, category_id#26]

(54) BroadcastExchange
Input [1]: [ss_item_sk#34]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=8]

(55) BroadcastHashJoin [codegen id : 25]
Left keys [1]: [ss_item_sk#1]
Right keys [1]: [ss_item_sk#34]
Join type: LeftSemi
Join condition: None

(56) Scan parquet spark_catalog.default.item
Output [4]: [i_item_sk#35, i_brand_id#36, i_class_id#37, i_category_id#38]
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>

(57) ColumnarToRow [codegen id : 23]
Input [4]: [i_item_sk#35, i_brand_id#36, i_class_id#37, i_category_id#38]

(58) Filter [codegen id : 23]
Input [4]: [i_item_sk#35, i_brand_id#36, i_class_id#37, i_category_id#38]
Condition : (((isnotnull(i_item_sk#35) AND isnotnull(i_brand_id#36)) AND isnotnull(i_class_id#37)) AND isnotnull(i_category_id#38))

(59) ReusedExchange [Reuses operator id: 54]
Output [1]: [ss_item_sk#34]

(60) BroadcastHashJoin [codegen id : 23]
Left keys [1]: [i_item_sk#35]
Right keys [1]: [ss_item_sk#34]
Join type: LeftSemi
Join condition: None

(61) BroadcastExchange
Input [4]: [i_item_sk#35, i_brand_id#36, i_class_id#37, i_category_id#38]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]

(62) BroadcastHashJoin [codegen id : 25]
Left keys [1]: [ss_item_sk#1]
Right keys [1]: [i_item_sk#35]
Join type: Inner
Join condition: None

(63) Project [codegen id : 25]
Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#36, i_class_id#37, i_category_id#38]
Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#35, i_brand_id#36, i_class_id#37, i_category_id#38]

(64) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#39, d_week_seq#40]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int>

(65) ColumnarToRow [codegen id : 24]
Input [2]: [d_date_sk#39, d_week_seq#40]

(66) Filter [codegen id : 24]
Input [2]: [d_date_sk#39, d_week_seq#40]
Condition : ((isnotnull(d_week_seq#40) AND (d_week_seq#40 = Subquery scalar-subquery#41, [id=#42])) AND isnotnull(d_date_sk#39))

(67) Project [codegen id : 24]
Output [1]: [d_date_sk#39]
Input [2]: [d_date_sk#39, d_week_seq#40]

(68) BroadcastExchange
Input [1]: [d_date_sk#39]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=10]

(69) BroadcastHashJoin [codegen id : 25]
Left keys [1]: [ss_sold_date_sk#4]
Right keys [1]: [d_date_sk#39]
Join type: Inner
Join condition: None

(70) Project [codegen id : 25]
Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#36, i_class_id#37, i_category_id#38]
Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#36, i_class_id#37, i_category_id#38, d_date_sk#39]

(71) HashAggregate [codegen id : 25]
Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#36, i_class_id#37, i_category_id#38]
Keys [3]: [i_brand_id#36, i_class_id#37, i_category_id#38]
Functions [2]: [partial_sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), partial_count(1)]
Aggregate Attributes [3]: [sum#43, isEmpty#44, count#45]
Results [6]: [i_brand_id#36, i_class_id#37, i_category_id#38, sum#46, isEmpty#47, count#48]

(72) Exchange
Input [6]: [i_brand_id#36, i_class_id#37, i_category_id#38, sum#46, isEmpty#47, count#48]
Arguments: hashpartitioning(i_brand_id#36, i_class_id#37, i_category_id#38, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(73) HashAggregate [codegen id : 52]
Input [6]: [i_brand_id#36, i_class_id#37, i_category_id#38, sum#46, isEmpty#47, count#48]
Keys [3]: [i_brand_id#36, i_class_id#37, i_category_id#38]
Functions [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), count(1)]
Aggregate Attributes [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49, count(1)#50]
Results [6]: [store AS channel#51, i_brand_id#36, i_class_id#37, i_category_id#38, sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49 AS sales#52, count(1)#50 AS number_sales#53]

(74) Filter [codegen id : 52]
Input [6]: [channel#51, i_brand_id#36, i_class_id#37, i_category_id#38, sales#52, number_sales#53]
Condition : (isnotnull(sales#52) AND (cast(sales#52 as decimal(32,6)) > cast(Subquery scalar-subquery#54, [id=#55] as decimal(32,6))))

(75) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#59)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>

(76) ColumnarToRow [codegen id : 50]
Input [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]

(77) Filter [codegen id : 50]
Input [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]
Condition : isnotnull(ss_item_sk#56)

(78) ReusedExchange [Reuses operator id: 54]
Output [1]: [ss_item_sk#34]

(79) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_item_sk#56]
Right keys [1]: [ss_item_sk#34]
Join type: LeftSemi
Join condition: None

(80) ReusedExchange [Reuses operator id: 61]
Output [4]: [i_item_sk#60, i_brand_id#61, i_class_id#62, i_category_id#63]

(81) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_item_sk#56]
Right keys [1]: [i_item_sk#60]
Join type: Inner
Join condition: None

(82) Project [codegen id : 50]
Output [6]: [ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_brand_id#61, i_class_id#62, i_category_id#63]
Input [8]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_item_sk#60, i_brand_id#61, i_class_id#62, i_category_id#63]

(83) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#64, d_week_seq#65]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int>

(84) ColumnarToRow [codegen id : 49]
Input [2]: [d_date_sk#64, d_week_seq#65]

(85) Filter [codegen id : 49]
Input [2]: [d_date_sk#64, d_week_seq#65]
Condition : ((isnotnull(d_week_seq#65) AND (d_week_seq#65 = Subquery scalar-subquery#66, [id=#67])) AND isnotnull(d_date_sk#64))

(86) Project [codegen id : 49]
Output [1]: [d_date_sk#64]
Input [2]: [d_date_sk#64, d_week_seq#65]

(87) BroadcastExchange
Input [1]: [d_date_sk#64]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]

(88) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_sold_date_sk#59]
Right keys [1]: [d_date_sk#64]
Join type: Inner
Join condition: None

(89) Project [codegen id : 50]
Output [5]: [ss_quantity#57, ss_list_price#58, i_brand_id#61, i_class_id#62, i_category_id#63]
Input [7]: [ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_brand_id#61, i_class_id#62, i_category_id#63, d_date_sk#64]

(90) HashAggregate [codegen id : 50]
Input [5]: [ss_quantity#57, ss_list_price#58, i_brand_id#61, i_class_id#62, i_category_id#63]
Keys [3]: [i_brand_id#61, i_class_id#62, i_category_id#63]
Functions [2]: [partial_sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58)), partial_count(1)]
Aggregate Attributes [3]: [sum#68, isEmpty#69, count#70]
Results [6]: [i_brand_id#61, i_class_id#62, i_category_id#63, sum#71, isEmpty#72, count#73]

(91) Exchange
Input [6]: [i_brand_id#61, i_class_id#62, i_category_id#63, sum#71, isEmpty#72, count#73]
Arguments: hashpartitioning(i_brand_id#61, i_class_id#62, i_category_id#63, 5), ENSURE_REQUIREMENTS, [plan_id=13]

(92) HashAggregate [codegen id : 51]
Input [6]: [i_brand_id#61, i_class_id#62, i_category_id#63, sum#71, isEmpty#72, count#73]
Keys [3]: [i_brand_id#61, i_class_id#62, i_category_id#63]
Functions [2]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58)), count(1)]
Aggregate Attributes [2]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58))#74, count(1)#75]
Results [6]: [store AS channel#76, i_brand_id#61, i_class_id#62, i_category_id#63, sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58))#74 AS sales#77, count(1)#75 AS number_sales#78]

(93) Filter [codegen id : 51]
Input [6]: [channel#76, i_brand_id#61, i_class_id#62, i_category_id#63, sales#77, number_sales#78]
Condition : (isnotnull(sales#77) AND (cast(sales#77 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#54, [id=#55] as decimal(32,6))))

(94) BroadcastExchange
Input [6]: [channel#76, i_brand_id#61, i_class_id#62, i_category_id#63, sales#77, number_sales#78]
Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [plan_id=14]

(95) BroadcastHashJoin [codegen id : 52]
Left keys [3]: [i_brand_id#36, i_class_id#37, i_category_id#38]
Right keys [3]: [i_brand_id#61, i_class_id#62, i_category_id#63]
Join type: Inner
Join condition: None

(96) TakeOrderedAndProject
Input [12]: [channel#51, i_brand_id#36, i_class_id#37, i_category_id#38, sales#52, number_sales#53, channel#76, i_brand_id#61, i_class_id#62, i_category_id#63, sales#77, number_sales#78]
Arguments: 100, [i_brand_id#36 ASC NULLS FIRST, i_class_id#37 ASC NULLS FIRST, i_category_id#38 ASC NULLS FIRST], [channel#51, i_brand_id#36, i_class_id#37, i_category_id#38, sales#52, number_sales#53, channel#76, i_brand_id#61, i_class_id#62, i_category_id#63, sales#77, number_sales#78]

===== Subqueries =====

Subquery:1 Hosting operator id = 74 Hosting Expression = Subquery scalar-subquery#54, [id=#55]
* HashAggregate (115)
+- Exchange (114)
   +- * HashAggregate (113)
      +- Union (112)
         :- * Project (101)
         :  +- * BroadcastHashJoin Inner BuildRight (100)
         :     :- * ColumnarToRow (98)
         :     :  +- Scan parquet spark_catalog.default.store_sales (97)
         :     +- ReusedExchange (99)
         :- * Project (106)
         :  +- * BroadcastHashJoin Inner BuildRight (105)
         :     :- * ColumnarToRow (103)
         :     :  +- Scan parquet spark_catalog.default.catalog_sales (102)
         :     +- ReusedExchange (104)
         +- * Project (111)
            +- * BroadcastHashJoin Inner BuildRight (110)
               :- * ColumnarToRow (108)
               :  +- Scan parquet spark_catalog.default.web_sales (107)
               +- ReusedExchange (109)


(97) Scan parquet spark_catalog.default.store_sales
Output [3]: [ss_quantity#79, ss_list_price#80, ss_sold_date_sk#81]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#81)]
ReadSchema: struct<ss_quantity:int,ss_list_price:decimal(7,2)>

(98) ColumnarToRow [codegen id : 2]
Input [3]: [ss_quantity#79, ss_list_price#80, ss_sold_date_sk#81]

(99) ReusedExchange [Reuses operator id: 26]
Output [1]: [d_date_sk#82]

(100) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#81]
Right keys [1]: [d_date_sk#82]
Join type: Inner
Join condition: None

(101) Project [codegen id : 2]
Output [2]: [ss_quantity#79 AS quantity#83, ss_list_price#80 AS list_price#84]
Input [4]: [ss_quantity#79, ss_list_price#80, ss_sold_date_sk#81, d_date_sk#82]

(102) Scan parquet spark_catalog.default.catalog_sales
Output [3]: [cs_quantity#85, cs_list_price#86, cs_sold_date_sk#87]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#87)]
ReadSchema: struct<cs_quantity:int,cs_list_price:decimal(7,2)>

(103) ColumnarToRow [codegen id : 4]
Input [3]: [cs_quantity#85, cs_list_price#86, cs_sold_date_sk#87]

(104) ReusedExchange [Reuses operator id: 26]
Output [1]: [d_date_sk#88]

(105) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_sold_date_sk#87]
Right keys [1]: [d_date_sk#88]
Join type: Inner
Join condition: None

(106) Project [codegen id : 4]
Output [2]: [cs_quantity#85 AS quantity#89, cs_list_price#86 AS list_price#90]
Input [4]: [cs_quantity#85, cs_list_price#86, cs_sold_date_sk#87, d_date_sk#88]

(107) Scan parquet spark_catalog.default.web_sales
Output [3]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#93)]
ReadSchema: struct<ws_quantity:int,ws_list_price:decimal(7,2)>

(108) ColumnarToRow [codegen id : 6]
Input [3]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]

(109) ReusedExchange [Reuses operator id: 26]
Output [1]: [d_date_sk#94]

(110) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_sold_date_sk#93]
Right keys [1]: [d_date_sk#94]
Join type: Inner
Join condition: None

(111) Project [codegen id : 6]
Output [2]: [ws_quantity#91 AS quantity#95, ws_list_price#92 AS list_price#96]
Input [4]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93, d_date_sk#94]

(112) Union

(113) HashAggregate [codegen id : 7]
Input [2]: [quantity#83, list_price#84]
Keys: []
Functions [1]: [partial_avg((cast(quantity#83 as decimal(10,0)) * list_price#84))]
Aggregate Attributes [2]: [sum#97, count#98]
Results [2]: [sum#99, count#100]

(114) Exchange
Input [2]: [sum#99, count#100]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]

(115) HashAggregate [codegen id : 8]
Input [2]: [sum#99, count#100]
Keys: []
Functions [1]: [avg((cast(quantity#83 as decimal(10,0)) * list_price#84))]
Aggregate Attributes [1]: [avg((cast(quantity#83 as decimal(10,0)) * list_price#84))#101]
Results [1]: [avg((cast(quantity#83 as decimal(10,0)) * list_price#84))#101 AS average_sales#102]

Subquery:2 Hosting operator id = 66 Hosting Expression = Subquery scalar-subquery#41, [id=#42]
* Project (119)
+- * Filter (118)
   +- * ColumnarToRow (117)
      +- Scan parquet spark_catalog.default.date_dim (116)


(116) Scan parquet spark_catalog.default.date_dim
Output [4]: [d_week_seq#103, d_year#104, d_moy#105, d_dom#106]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)]
ReadSchema: struct<d_week_seq:int,d_year:int,d_moy:int,d_dom:int>

(117) ColumnarToRow [codegen id : 1]
Input [4]: [d_week_seq#103, d_year#104, d_moy#105, d_dom#106]

(118) Filter [codegen id : 1]
Input [4]: [d_week_seq#103, d_year#104, d_moy#105, d_dom#106]
Condition : (((((isnotnull(d_year#104) AND isnotnull(d_moy#105)) AND isnotnull(d_dom#106)) AND (d_year#104 = 2000)) AND (d_moy#105 = 12)) AND (d_dom#106 = 11))

(119) Project [codegen id : 1]
Output [1]: [d_week_seq#103]
Input [4]: [d_week_seq#103, d_year#104, d_moy#105, d_dom#106]

Subquery:3 Hosting operator id = 93 Hosting Expression = ReusedSubquery Subquery scalar-subquery#54, [id=#55]

Subquery:4 Hosting operator id = 85 Hosting Expression = Subquery scalar-subquery#66, [id=#67]
* Project (123)
+- * Filter (122)
   +- * ColumnarToRow (121)
      +- Scan parquet spark_catalog.default.date_dim (120)


(120) Scan parquet spark_catalog.default.date_dim
Output [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)]
ReadSchema: struct<d_week_seq:int,d_year:int,d_moy:int,d_dom:int>

(121) ColumnarToRow [codegen id : 1]
Input [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]

(122) Filter [codegen id : 1]
Input [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]
Condition : (((((isnotnull(d_year#108) AND isnotnull(d_moy#109)) AND isnotnull(d_dom#110)) AND (d_year#108 = 1999)) AND (d_moy#109 = 12)) AND (d_dom#110 = 11))

(123) Project [codegen id : 1]
Output [1]: [d_week_seq#107]
Input [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]


