== Physical Plan ==
* Sort (38)
+- Exchange (37)
   +- * HashAggregate (36)
      +- Exchange (35)
         +- * HashAggregate (34)
            +- * Project (33)
               +- * BroadcastHashJoin Inner BuildRight (32)
                  :- * Project (26)
                  :  +- * BroadcastHashJoin Inner BuildLeft (25)
                  :     :- BroadcastExchange (5)
                  :     :  +- * Project (4)
                  :     :     +- * Filter (3)
                  :     :        +- * ColumnarToRow (2)
                  :     :           +- Scan parquet default.item (1)
                  :     +- Union (24)
                  :        :- * Project (11)
                  :        :  +- * BroadcastHashJoin Inner BuildRight (10)
                  :        :     :- * Filter (8)
                  :        :     :  +- * ColumnarToRow (7)
                  :        :     :     +- Scan parquet default.web_sales (6)
                  :        :     +- ReusedExchange (9)
                  :        :- * Project (17)
                  :        :  +- * BroadcastHashJoin Inner BuildRight (16)
                  :        :     :- * Filter (14)
                  :        :     :  +- * ColumnarToRow (13)
                  :        :     :     +- Scan parquet default.catalog_sales (12)
                  :        :     +- ReusedExchange (15)
                  :        +- * Project (23)
                  :           +- * BroadcastHashJoin Inner BuildRight (22)
                  :              :- * Filter (20)
                  :              :  +- * ColumnarToRow (19)
                  :              :     +- Scan parquet default.store_sales (18)
                  :              +- ReusedExchange (21)
                  +- BroadcastExchange (31)
                     +- * Project (30)
                        +- * Filter (29)
                           +- * ColumnarToRow (28)
                              +- Scan parquet default.time_dim (27)


(1) Scan parquet default.item
Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manager_id:int>

(2) ColumnarToRow [codegen id : 1]
Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4]

(3) Filter [codegen id : 1]
Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4]
Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1))

(4) Project [codegen id : 1]
Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3]
Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4]

(5) BroadcastExchange
Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5]

(6) Scan parquet default.web_sales
Output [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#9), dynamicpruningexpression(ws_sold_date_sk#9 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_time_sk)]
ReadSchema: struct<ws_sold_time_sk:int,ws_item_sk:int,ws_ext_sales_price:decimal(7,2)>

(7) ColumnarToRow [codegen id : 3]
Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9]

(8) Filter [codegen id : 3]
Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9]
Condition : (isnotnull(ws_item_sk#7) AND isnotnull(ws_sold_time_sk#6))

(9) ReusedExchange [Reuses operator id: 43]
Output [1]: [d_date_sk#11]

(10) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ws_sold_date_sk#9]
Right keys [1]: [d_date_sk#11]
Join condition: None

(11) Project [codegen id : 3]
Output [3]: [ws_ext_sales_price#8 AS ext_price#12, ws_item_sk#7 AS sold_item_sk#13, ws_sold_time_sk#6 AS time_sk#14]
Input [5]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9, d_date_sk#11]

(12) Scan parquet default.catalog_sales
Output [4]: [cs_sold_time_sk#15, cs_item_sk#16, cs_ext_sales_price#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#10)]
PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_time_sk)]
ReadSchema: struct<cs_sold_time_sk:int,cs_item_sk:int,cs_ext_sales_price:decimal(7,2)>

(13) ColumnarToRow [codegen id : 5]
Input [4]: [cs_sold_time_sk#15, cs_item_sk#16, cs_ext_sales_price#17, cs_sold_date_sk#18]

(14) Filter [codegen id : 5]
Input [4]: [cs_sold_time_sk#15, cs_item_sk#16, cs_ext_sales_price#17, cs_sold_date_sk#18]
Condition : (isnotnull(cs_item_sk#16) AND isnotnull(cs_sold_time_sk#15))

(15) ReusedExchange [Reuses operator id: 43]
Output [1]: [d_date_sk#19]

(16) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [cs_sold_date_sk#18]
Right keys [1]: [d_date_sk#19]
Join condition: None

(17) Project [codegen id : 5]
Output [3]: [cs_ext_sales_price#17 AS ext_price#20, cs_item_sk#16 AS sold_item_sk#21, cs_sold_time_sk#15 AS time_sk#22]
Input [5]: [cs_sold_time_sk#15, cs_item_sk#16, cs_ext_sales_price#17, cs_sold_date_sk#18, d_date_sk#19]

(18) Scan parquet default.store_sales
Output [4]: [ss_sold_time_sk#23, ss_item_sk#24, ss_ext_sales_price#25, ss_sold_date_sk#26]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#26), dynamicpruningexpression(ss_sold_date_sk#26 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_time_sk)]
ReadSchema: struct<ss_sold_time_sk:int,ss_item_sk:int,ss_ext_sales_price:decimal(7,2)>

(19) ColumnarToRow [codegen id : 7]
Input [4]: [ss_sold_time_sk#23, ss_item_sk#24, ss_ext_sales_price#25, ss_sold_date_sk#26]

(20) Filter [codegen id : 7]
Input [4]: [ss_sold_time_sk#23, ss_item_sk#24, ss_ext_sales_price#25, ss_sold_date_sk#26]
Condition : (isnotnull(ss_item_sk#24) AND isnotnull(ss_sold_time_sk#23))

(21) ReusedExchange [Reuses operator id: 43]
Output [1]: [d_date_sk#27]

(22) BroadcastHashJoin [codegen id : 7]
Left keys [1]: [ss_sold_date_sk#26]
Right keys [1]: [d_date_sk#27]
Join condition: None

(23) Project [codegen id : 7]
Output [3]: [ss_ext_sales_price#25 AS ext_price#28, ss_item_sk#24 AS sold_item_sk#29, ss_sold_time_sk#23 AS time_sk#30]
Input [5]: [ss_sold_time_sk#23, ss_item_sk#24, ss_ext_sales_price#25, ss_sold_date_sk#26, d_date_sk#27]

(24) Union

(25) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [i_item_sk#1]
Right keys [1]: [sold_item_sk#13]
Join condition: None

(26) Project [codegen id : 9]
Output [4]: [i_brand_id#2, i_brand#3, ext_price#12, time_sk#14]
Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#12, sold_item_sk#13, time_sk#14]

(27) Scan parquet default.time_dim
Output [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34]
Batched: true
Location [not included in comparison]/{warehouse_dir}/time_dim]
PushedFilters: [Or(EqualTo(t_meal_time,breakfast           ),EqualTo(t_meal_time,dinner              )), IsNotNull(t_time_sk)]
ReadSchema: struct<t_time_sk:int,t_hour:int,t_minute:int,t_meal_time:string>

(28) ColumnarToRow [codegen id : 8]
Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34]

(29) Filter [codegen id : 8]
Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34]
Condition : (((t_meal_time#34 = breakfast           ) OR (t_meal_time#34 = dinner              )) AND isnotnull(t_time_sk#31))

(30) Project [codegen id : 8]
Output [3]: [t_time_sk#31, t_hour#32, t_minute#33]
Input [4]: [t_time_sk#31, t_hour#32, t_minute#33, t_meal_time#34]

(31) BroadcastExchange
Input [3]: [t_time_sk#31, t_hour#32, t_minute#33]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35]

(32) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [time_sk#14]
Right keys [1]: [t_time_sk#31]
Join condition: None

(33) Project [codegen id : 9]
Output [5]: [i_brand_id#2, i_brand#3, ext_price#12, t_hour#32, t_minute#33]
Input [7]: [i_brand_id#2, i_brand#3, ext_price#12, time_sk#14, t_time_sk#31, t_hour#32, t_minute#33]

(34) HashAggregate [codegen id : 9]
Input [5]: [i_brand_id#2, i_brand#3, ext_price#12, t_hour#32, t_minute#33]
Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33]
Functions [1]: [partial_sum(UnscaledValue(ext_price#12))]
Aggregate Attributes [1]: [sum#36]
Results [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37]

(35) Exchange
Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37]
Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, 5), ENSURE_REQUIREMENTS, [id=#38]

(36) HashAggregate [codegen id : 10]
Input [5]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33, sum#37]
Keys [4]: [i_brand#3, i_brand_id#2, t_hour#32, t_minute#33]
Functions [1]: [sum(UnscaledValue(ext_price#12))]
Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#12))#39]
Results [5]: [i_brand_id#2 AS brand_id#40, i_brand#3 AS brand#41, t_hour#32, t_minute#33, MakeDecimal(sum(UnscaledValue(ext_price#12))#39,17,2) AS ext_price#42]

(37) Exchange
Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42]
Arguments: rangepartitioning(ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#43]

(38) Sort [codegen id : 11]
Input [5]: [brand_id#40, brand#41, t_hour#32, t_minute#33, ext_price#42]
Arguments: [ext_price#42 DESC NULLS LAST, brand_id#40 ASC NULLS FIRST], true, 0

===== Subqueries =====

Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#9 IN dynamicpruning#10
BroadcastExchange (43)
+- * Project (42)
   +- * Filter (41)
      +- * ColumnarToRow (40)
         +- Scan parquet default.date_dim (39)


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

(40) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#11, d_year#44, d_moy#45]

(41) Filter [codegen id : 1]
Input [3]: [d_date_sk#11, d_year#44, d_moy#45]
Condition : ((((isnotnull(d_moy#45) AND isnotnull(d_year#44)) AND (d_moy#45 = 11)) AND (d_year#44 = 1999)) AND isnotnull(d_date_sk#11))

(42) Project [codegen id : 1]
Output [1]: [d_date_sk#11]
Input [3]: [d_date_sk#11, d_year#44, d_moy#45]

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

Subquery:2 Hosting operator id = 12 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#10

Subquery:3 Hosting operator id = 18 Hosting Expression = ss_sold_date_sk#26 IN dynamicpruning#10


