== Physical Plan ==
TakeOrderedAndProject (84)
+- * BroadcastHashJoin Inner BuildRight (83)
   :- * Filter (66)
   :  +- * HashAggregate (65)
   :     +- Exchange (64)
   :        +- * HashAggregate (63)
   :           +- * Project (62)
   :              +- * BroadcastHashJoin Inner BuildRight (61)
   :                 :- * Project (59)
   :                 :  +- * BroadcastHashJoin Inner BuildRight (58)
   :                 :     :- * BroadcastHashJoin LeftSemi BuildRight (51)
   :                 :     :  :- * Filter (3)
   :                 :     :  :  +- * ColumnarToRow (2)
   :                 :     :  :     +- Scan parquet spark_catalog.default.store_sales (1)
   :                 :     :  +- BroadcastExchange (50)
   :                 :     :     +- * Project (49)
   :                 :     :        +- * BroadcastHashJoin Inner BuildRight (48)
   :                 :     :           :- * Filter (6)
   :                 :     :           :  +- * ColumnarToRow (5)
   :                 :     :           :     +- Scan parquet spark_catalog.default.item (4)
   :                 :     :           +- BroadcastExchange (47)
   :                 :     :              +- * BroadcastHashJoin LeftSemi BuildRight (46)
   :                 :     :                 :- * HashAggregate (35)
   :                 :     :                 :  +- Exchange (34)
   :                 :     :                 :     +- * HashAggregate (33)
   :                 :     :                 :        +- * Project (32)
   :                 :     :                 :           +- * BroadcastHashJoin Inner BuildRight (31)
   :                 :     :                 :              :- * Project (29)
   :                 :     :                 :              :  +- * BroadcastHashJoin Inner BuildRight (28)
   :                 :     :                 :              :     :- * Filter (9)
   :                 :     :                 :              :     :  +- * ColumnarToRow (8)
   :                 :     :                 :              :     :     +- Scan parquet spark_catalog.default.store_sales (7)
   :                 :     :                 :              :     +- BroadcastExchange (27)
   :                 :     :                 :              :        +- * BroadcastHashJoin LeftSemi BuildRight (26)
   :                 :     :                 :              :           :- * Filter (12)
   :                 :     :                 :              :           :  +- * ColumnarToRow (11)
   :                 :     :                 :              :           :     +- Scan parquet spark_catalog.default.item (10)
   :                 :     :                 :              :           +- BroadcastExchange (25)
   :                 :     :                 :              :              +- * Project (24)
   :                 :     :                 :              :                 +- * BroadcastHashJoin Inner BuildRight (23)
   :                 :     :                 :              :                    :- * 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)
   :                 :     :                 :              :                    +- ReusedExchange (22)
   :                 :     :                 :              +- ReusedExchange (30)
   :                 :     :                 +- BroadcastExchange (45)
   :                 :     :                    +- * Project (44)
   :                 :     :                       +- * BroadcastHashJoin Inner BuildRight (43)
   :                 :     :                          :- * Project (41)
   :                 :     :                          :  +- * BroadcastHashJoin Inner BuildRight (40)
   :                 :     :                          :     :- * Filter (38)
   :                 :     :                          :     :  +- * ColumnarToRow (37)
   :                 :     :                          :     :     +- Scan parquet spark_catalog.default.web_sales (36)
   :                 :     :                          :     +- ReusedExchange (39)
   :                 :     :                          +- ReusedExchange (42)
   :                 :     +- BroadcastExchange (57)
   :                 :        +- * BroadcastHashJoin LeftSemi BuildRight (56)
   :                 :           :- * Filter (54)
   :                 :           :  +- * ColumnarToRow (53)
   :                 :           :     +- Scan parquet spark_catalog.default.item (52)
   :                 :           +- ReusedExchange (55)
   :                 +- ReusedExchange (60)
   +- BroadcastExchange (82)
      +- * Filter (81)
         +- * HashAggregate (80)
            +- Exchange (79)
               +- * HashAggregate (78)
                  +- * Project (77)
                     +- * BroadcastHashJoin Inner BuildRight (76)
                        :- * Project (74)
                        :  +- * BroadcastHashJoin Inner BuildRight (73)
                        :     :- * BroadcastHashJoin LeftSemi BuildRight (71)
                        :     :  :- * Filter (69)
                        :     :  :  +- * ColumnarToRow (68)
                        :     :  :     +- Scan parquet spark_catalog.default.store_sales (67)
                        :     :  +- ReusedExchange (70)
                        :     +- ReusedExchange (72)
                        +- ReusedExchange (75)


(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), 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 : 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#6, i_brand_id#7, i_class_id#8, i_category_id#9]
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#6, i_brand_id#7, i_class_id#8, i_category_id#9]

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

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

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

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

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

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

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

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

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

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

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

(19) BroadcastExchange
Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22]
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#17]
Right keys [1]: [i_item_sk#19]
Join type: Inner
Join condition: None

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

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

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

(24) Project [codegen id : 3]
Output [3]: [i_brand_id#20, i_class_id#21, i_category_id#22]
Input [5]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22, d_date_sk#23]

(25) BroadcastExchange
Input [3]: [i_brand_id#20, i_class_id#21, i_category_id#22]
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=2]

(26) BroadcastHashJoin [codegen id : 4]
Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)]
Right keys [6]: [coalesce(i_brand_id#20, 0), isnull(i_brand_id#20), coalesce(i_class_id#21, 0), isnull(i_class_id#21), coalesce(i_category_id#22, 0), isnull(i_category_id#22)]
Join type: LeftSemi
Join condition: None

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

(28) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_item_sk#10]
Right keys [1]: [i_item_sk#13]
Join type: Inner
Join condition: None

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

(30) ReusedExchange [Reuses operator id: 117]
Output [1]: [d_date_sk#24]

(31) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_sold_date_sk#11]
Right keys [1]: [d_date_sk#24]
Join type: Inner
Join condition: None

(32) Project [codegen id : 6]
Output [3]: [i_brand_id#14 AS brand_id#25, i_class_id#15 AS class_id#26, i_category_id#16 AS category_id#27]
Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#24]

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

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

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

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

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

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

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

(40) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ws_item_sk#28]
Right keys [1]: [i_item_sk#30]
Join type: Inner
Join condition: None

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

(42) ReusedExchange [Reuses operator id: 117]
Output [1]: [d_date_sk#34]

(43) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [ws_sold_date_sk#29]
Right keys [1]: [d_date_sk#34]
Join type: Inner
Join condition: None

(44) Project [codegen id : 9]
Output [3]: [i_brand_id#31, i_class_id#32, i_category_id#33]
Input [5]: [ws_sold_date_sk#29, i_brand_id#31, i_class_id#32, i_category_id#33, d_date_sk#34]

(45) BroadcastExchange
Input [3]: [i_brand_id#31, i_class_id#32, i_category_id#33]
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=5]

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

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

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

(49) Project [codegen id : 11]
Output [1]: [i_item_sk#6 AS ss_item_sk#35]
Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#25, class_id#26, category_id#27]

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

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

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

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

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

(55) ReusedExchange [Reuses operator id: 50]
Output [1]: [ss_item_sk#35]

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

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

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

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

(60) ReusedExchange [Reuses operator id: 108]
Output [1]: [d_date_sk#40]

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

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

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

(64) Exchange
Input [6]: [i_brand_id#37, i_class_id#38, i_category_id#39, sum#44, isEmpty#45, count#46]
Arguments: hashpartitioning(i_brand_id#37, i_class_id#38, i_category_id#39, 5), ENSURE_REQUIREMENTS, [plan_id=9]

(65) HashAggregate [codegen id : 52]
Input [6]: [i_brand_id#37, i_class_id#38, i_category_id#39, sum#44, isEmpty#45, count#46]
Keys [3]: [i_brand_id#37, i_class_id#38, i_category_id#39]
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))#47, count(1)#48]
Results [6]: [store AS channel#49, i_brand_id#37, i_class_id#38, i_category_id#39, sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#47 AS sales#50, count(1)#48 AS number_sales#51]

(66) Filter [codegen id : 52]
Input [6]: [channel#49, i_brand_id#37, i_class_id#38, i_category_id#39, sales#50, number_sales#51]
Condition : (isnotnull(sales#50) AND (cast(sales#50 as decimal(32,6)) > cast(Subquery scalar-subquery#52, [id=#10] as decimal(32,6))))

(67) Scan parquet spark_catalog.default.store_sales
Output [4]: [ss_item_sk#53, ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#56), dynamicpruningexpression(ss_sold_date_sk#56 IN dynamicpruning#57)]
PushedFilters: [IsNotNull(ss_item_sk)]
ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>

(68) ColumnarToRow [codegen id : 50]
Input [4]: [ss_item_sk#53, ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56]

(69) Filter [codegen id : 50]
Input [4]: [ss_item_sk#53, ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56]
Condition : isnotnull(ss_item_sk#53)

(70) ReusedExchange [Reuses operator id: 50]
Output [1]: [ss_item_sk#58]

(71) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_item_sk#53]
Right keys [1]: [ss_item_sk#58]
Join type: LeftSemi
Join condition: None

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

(73) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_item_sk#53]
Right keys [1]: [i_item_sk#59]
Join type: Inner
Join condition: None

(74) Project [codegen id : 50]
Output [6]: [ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56, i_brand_id#60, i_class_id#61, i_category_id#62]
Input [8]: [ss_item_sk#53, ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56, i_item_sk#59, i_brand_id#60, i_class_id#61, i_category_id#62]

(75) ReusedExchange [Reuses operator id: 122]
Output [1]: [d_date_sk#63]

(76) BroadcastHashJoin [codegen id : 50]
Left keys [1]: [ss_sold_date_sk#56]
Right keys [1]: [d_date_sk#63]
Join type: Inner
Join condition: None

(77) Project [codegen id : 50]
Output [5]: [ss_quantity#54, ss_list_price#55, i_brand_id#60, i_class_id#61, i_category_id#62]
Input [7]: [ss_quantity#54, ss_list_price#55, ss_sold_date_sk#56, i_brand_id#60, i_class_id#61, i_category_id#62, d_date_sk#63]

(78) HashAggregate [codegen id : 50]
Input [5]: [ss_quantity#54, ss_list_price#55, i_brand_id#60, i_class_id#61, i_category_id#62]
Keys [3]: [i_brand_id#60, i_class_id#61, i_category_id#62]
Functions [2]: [partial_sum((cast(ss_quantity#54 as decimal(10,0)) * ss_list_price#55)), partial_count(1)]
Aggregate Attributes [3]: [sum#64, isEmpty#65, count#66]
Results [6]: [i_brand_id#60, i_class_id#61, i_category_id#62, sum#67, isEmpty#68, count#69]

(79) Exchange
Input [6]: [i_brand_id#60, i_class_id#61, i_category_id#62, sum#67, isEmpty#68, count#69]
Arguments: hashpartitioning(i_brand_id#60, i_class_id#61, i_category_id#62, 5), ENSURE_REQUIREMENTS, [plan_id=11]

(80) HashAggregate [codegen id : 51]
Input [6]: [i_brand_id#60, i_class_id#61, i_category_id#62, sum#67, isEmpty#68, count#69]
Keys [3]: [i_brand_id#60, i_class_id#61, i_category_id#62]
Functions [2]: [sum((cast(ss_quantity#54 as decimal(10,0)) * ss_list_price#55)), count(1)]
Aggregate Attributes [2]: [sum((cast(ss_quantity#54 as decimal(10,0)) * ss_list_price#55))#70, count(1)#71]
Results [6]: [store AS channel#72, i_brand_id#60, i_class_id#61, i_category_id#62, sum((cast(ss_quantity#54 as decimal(10,0)) * ss_list_price#55))#70 AS sales#73, count(1)#71 AS number_sales#74]

(81) Filter [codegen id : 51]
Input [6]: [channel#72, i_brand_id#60, i_class_id#61, i_category_id#62, sales#73, number_sales#74]
Condition : (isnotnull(sales#73) AND (cast(sales#73 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#52, [id=#10] as decimal(32,6))))

(82) BroadcastExchange
Input [6]: [channel#72, i_brand_id#60, i_class_id#61, i_category_id#62, sales#73, number_sales#74]
Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [plan_id=12]

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

(84) TakeOrderedAndProject
Input [12]: [channel#49, i_brand_id#37, i_class_id#38, i_category_id#39, sales#50, number_sales#51, channel#72, i_brand_id#60, i_class_id#61, i_category_id#62, sales#73, number_sales#74]
Arguments: 100, [i_brand_id#37 ASC NULLS FIRST, i_class_id#38 ASC NULLS FIRST, i_category_id#39 ASC NULLS FIRST], [channel#49, i_brand_id#37, i_class_id#38, i_category_id#39, sales#50, number_sales#51, channel#72, i_brand_id#60, i_class_id#61, i_category_id#62, sales#73, number_sales#74]

===== Subqueries =====

Subquery:1 Hosting operator id = 66 Hosting Expression = Subquery scalar-subquery#52, [id=#10]
* HashAggregate (103)
+- Exchange (102)
   +- * HashAggregate (101)
      +- Union (100)
         :- * Project (89)
         :  +- * BroadcastHashJoin Inner BuildRight (88)
         :     :- * ColumnarToRow (86)
         :     :  +- Scan parquet spark_catalog.default.store_sales (85)
         :     +- ReusedExchange (87)
         :- * Project (94)
         :  +- * BroadcastHashJoin Inner BuildRight (93)
         :     :- * ColumnarToRow (91)
         :     :  +- Scan parquet spark_catalog.default.catalog_sales (90)
         :     +- ReusedExchange (92)
         +- * Project (99)
            +- * BroadcastHashJoin Inner BuildRight (98)
               :- * ColumnarToRow (96)
               :  +- Scan parquet spark_catalog.default.web_sales (95)
               +- ReusedExchange (97)


(85) Scan parquet spark_catalog.default.store_sales
Output [3]: [ss_quantity#75, ss_list_price#76, ss_sold_date_sk#77]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#77), dynamicpruningexpression(ss_sold_date_sk#77 IN dynamicpruning#12)]
ReadSchema: struct<ss_quantity:int,ss_list_price:decimal(7,2)>

(86) ColumnarToRow [codegen id : 2]
Input [3]: [ss_quantity#75, ss_list_price#76, ss_sold_date_sk#77]

(87) ReusedExchange [Reuses operator id: 117]
Output [1]: [d_date_sk#78]

(88) BroadcastHashJoin [codegen id : 2]
Left keys [1]: [ss_sold_date_sk#77]
Right keys [1]: [d_date_sk#78]
Join type: Inner
Join condition: None

(89) Project [codegen id : 2]
Output [2]: [ss_quantity#75 AS quantity#79, ss_list_price#76 AS list_price#80]
Input [4]: [ss_quantity#75, ss_list_price#76, ss_sold_date_sk#77, d_date_sk#78]

(90) Scan parquet spark_catalog.default.catalog_sales
Output [3]: [cs_quantity#81, cs_list_price#82, cs_sold_date_sk#83]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#83), dynamicpruningexpression(cs_sold_date_sk#83 IN dynamicpruning#12)]
ReadSchema: struct<cs_quantity:int,cs_list_price:decimal(7,2)>

(91) ColumnarToRow [codegen id : 4]
Input [3]: [cs_quantity#81, cs_list_price#82, cs_sold_date_sk#83]

(92) ReusedExchange [Reuses operator id: 117]
Output [1]: [d_date_sk#84]

(93) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [cs_sold_date_sk#83]
Right keys [1]: [d_date_sk#84]
Join type: Inner
Join condition: None

(94) Project [codegen id : 4]
Output [2]: [cs_quantity#81 AS quantity#85, cs_list_price#82 AS list_price#86]
Input [4]: [cs_quantity#81, cs_list_price#82, cs_sold_date_sk#83, d_date_sk#84]

(95) Scan parquet spark_catalog.default.web_sales
Output [3]: [ws_quantity#87, ws_list_price#88, ws_sold_date_sk#89]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#89), dynamicpruningexpression(ws_sold_date_sk#89 IN dynamicpruning#12)]
ReadSchema: struct<ws_quantity:int,ws_list_price:decimal(7,2)>

(96) ColumnarToRow [codegen id : 6]
Input [3]: [ws_quantity#87, ws_list_price#88, ws_sold_date_sk#89]

(97) ReusedExchange [Reuses operator id: 117]
Output [1]: [d_date_sk#90]

(98) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_sold_date_sk#89]
Right keys [1]: [d_date_sk#90]
Join type: Inner
Join condition: None

(99) Project [codegen id : 6]
Output [2]: [ws_quantity#87 AS quantity#91, ws_list_price#88 AS list_price#92]
Input [4]: [ws_quantity#87, ws_list_price#88, ws_sold_date_sk#89, d_date_sk#90]

(100) Union

(101) HashAggregate [codegen id : 7]
Input [2]: [quantity#79, list_price#80]
Keys: []
Functions [1]: [partial_avg((cast(quantity#79 as decimal(10,0)) * list_price#80))]
Aggregate Attributes [2]: [sum#93, count#94]
Results [2]: [sum#95, count#96]

(102) Exchange
Input [2]: [sum#95, count#96]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=13]

(103) HashAggregate [codegen id : 8]
Input [2]: [sum#95, count#96]
Keys: []
Functions [1]: [avg((cast(quantity#79 as decimal(10,0)) * list_price#80))]
Aggregate Attributes [1]: [avg((cast(quantity#79 as decimal(10,0)) * list_price#80))#97]
Results [1]: [avg((cast(quantity#79 as decimal(10,0)) * list_price#80))#97 AS average_sales#98]

Subquery:2 Hosting operator id = 85 Hosting Expression = ss_sold_date_sk#77 IN dynamicpruning#12

Subquery:3 Hosting operator id = 90 Hosting Expression = cs_sold_date_sk#83 IN dynamicpruning#12

Subquery:4 Hosting operator id = 95 Hosting Expression = ws_sold_date_sk#89 IN dynamicpruning#12

Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
BroadcastExchange (108)
+- * Project (107)
   +- * Filter (106)
      +- * ColumnarToRow (105)
         +- Scan parquet spark_catalog.default.date_dim (104)


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

(105) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#40, d_week_seq#99]

(106) Filter [codegen id : 1]
Input [2]: [d_date_sk#40, d_week_seq#99]
Condition : ((isnotnull(d_week_seq#99) AND (d_week_seq#99 = ReusedSubquery Subquery scalar-subquery#100, [id=#14])) AND isnotnull(d_date_sk#40))

(107) Project [codegen id : 1]
Output [1]: [d_date_sk#40]
Input [2]: [d_date_sk#40, d_week_seq#99]

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

Subquery:6 Hosting operator id = 106 Hosting Expression = ReusedSubquery Subquery scalar-subquery#100, [id=#14]

Subquery:7 Hosting operator id = 104 Hosting Expression = Subquery scalar-subquery#100, [id=#14]
* Project (112)
+- * Filter (111)
   +- * ColumnarToRow (110)
      +- Scan parquet spark_catalog.default.date_dim (109)


(109) Scan parquet spark_catalog.default.date_dim
Output [4]: [d_week_seq#101, d_year#102, d_moy#103, d_dom#104]
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,16)]
ReadSchema: struct<d_week_seq:int,d_year:int,d_moy:int,d_dom:int>

(110) ColumnarToRow [codegen id : 1]
Input [4]: [d_week_seq#101, d_year#102, d_moy#103, d_dom#104]

(111) Filter [codegen id : 1]
Input [4]: [d_week_seq#101, d_year#102, d_moy#103, d_dom#104]
Condition : (((((isnotnull(d_year#102) AND isnotnull(d_moy#103)) AND isnotnull(d_dom#104)) AND (d_year#102 = 1999)) AND (d_moy#103 = 12)) AND (d_dom#104 = 16))

(112) Project [codegen id : 1]
Output [1]: [d_week_seq#101]
Input [4]: [d_week_seq#101, d_year#102, d_moy#103, d_dom#104]

Subquery:8 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12
BroadcastExchange (117)
+- * Project (116)
   +- * Filter (115)
      +- * ColumnarToRow (114)
         +- Scan parquet spark_catalog.default.date_dim (113)


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

(114) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#24, d_year#105]

(115) Filter [codegen id : 1]
Input [2]: [d_date_sk#24, d_year#105]
Condition : (((isnotnull(d_year#105) AND (d_year#105 >= 1998)) AND (d_year#105 <= 2000)) AND isnotnull(d_date_sk#24))

(116) Project [codegen id : 1]
Output [1]: [d_date_sk#24]
Input [2]: [d_date_sk#24, d_year#105]

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

Subquery:9 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12

Subquery:10 Hosting operator id = 36 Hosting Expression = ws_sold_date_sk#29 IN dynamicpruning#12

Subquery:11 Hosting operator id = 81 Hosting Expression = ReusedSubquery Subquery scalar-subquery#52, [id=#10]

Subquery:12 Hosting operator id = 67 Hosting Expression = ss_sold_date_sk#56 IN dynamicpruning#57
BroadcastExchange (122)
+- * Project (121)
   +- * Filter (120)
      +- * ColumnarToRow (119)
         +- Scan parquet spark_catalog.default.date_dim (118)


(118) Scan parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#63, d_week_seq#106]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_week_seq), EqualTo(d_week_seq,ScalarSubquery#107), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_week_seq:int>

(119) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#63, d_week_seq#106]

(120) Filter [codegen id : 1]
Input [2]: [d_date_sk#63, d_week_seq#106]
Condition : ((isnotnull(d_week_seq#106) AND (d_week_seq#106 = ReusedSubquery Subquery scalar-subquery#107, [id=#17])) AND isnotnull(d_date_sk#63))

(121) Project [codegen id : 1]
Output [1]: [d_date_sk#63]
Input [2]: [d_date_sk#63, d_week_seq#106]

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

Subquery:13 Hosting operator id = 120 Hosting Expression = ReusedSubquery Subquery scalar-subquery#107, [id=#17]

Subquery:14 Hosting operator id = 118 Hosting Expression = Subquery scalar-subquery#107, [id=#17]
* Project (126)
+- * Filter (125)
   +- * ColumnarToRow (124)
      +- Scan parquet spark_catalog.default.date_dim (123)


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

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

(125) Filter [codegen id : 1]
Input [4]: [d_week_seq#108, d_year#109, d_moy#110, d_dom#111]
Condition : (((((isnotnull(d_year#109) AND isnotnull(d_moy#110)) AND isnotnull(d_dom#111)) AND (d_year#109 = 1998)) AND (d_moy#110 = 12)) AND (d_dom#111 = 16))

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


