== Physical Plan ==
TakeOrderedAndProject (17)
+- * HashAggregate (16)
   +- Exchange (15)
      +- * HashAggregate (14)
         +- * Project (13)
            +- * BroadcastHashJoin Inner BuildRight (12)
               :- * Project (10)
               :  +- * BroadcastHashJoin Inner BuildRight (9)
               :     :- * Filter (3)
               :     :  +- * ColumnarToRow (2)
               :     :     +- Scan parquet spark_catalog.default.store_sales (1)
               :     +- BroadcastExchange (8)
               :        +- * Project (7)
               :           +- * Filter (6)
               :              +- * ColumnarToRow (5)
               :                 +- Scan parquet spark_catalog.default.item (4)
               +- ReusedExchange (11)


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

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

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

(4) Scan parquet spark_catalog.default.item
Output [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8]
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_category_id:int,i_category:string,i_manager_id:int>

(5) ColumnarToRow [codegen id : 1]
Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8]

(6) Filter [codegen id : 1]
Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8]
Condition : ((isnotnull(i_manager_id#8) AND (i_manager_id#8 = 1)) AND isnotnull(i_item_sk#5))

(7) Project [codegen id : 1]
Output [3]: [i_item_sk#5, i_category_id#6, i_category#7]
Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8]

(8) BroadcastExchange
Input [3]: [i_item_sk#5, i_category_id#6, i_category#7]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]

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

(10) Project [codegen id : 3]
Output [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_category_id#6, i_category#7]
Input [6]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_category_id#6, i_category#7]

(11) ReusedExchange [Reuses operator id: 22]
Output [2]: [d_date_sk#9, d_year#10]

(12) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [ss_sold_date_sk#3]
Right keys [1]: [d_date_sk#9]
Join type: Inner
Join condition: None

(13) Project [codegen id : 3]
Output [4]: [d_year#10, ss_ext_sales_price#2, i_category_id#6, i_category#7]
Input [6]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_category_id#6, i_category#7, d_date_sk#9, d_year#10]

(14) HashAggregate [codegen id : 3]
Input [4]: [d_year#10, ss_ext_sales_price#2, i_category_id#6, i_category#7]
Keys [3]: [d_year#10, i_category_id#6, i_category#7]
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))]
Aggregate Attributes [1]: [sum#11]
Results [4]: [d_year#10, i_category_id#6, i_category#7, sum#12]

(15) Exchange
Input [4]: [d_year#10, i_category_id#6, i_category#7, sum#12]
Arguments: hashpartitioning(d_year#10, i_category_id#6, i_category#7, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(16) HashAggregate [codegen id : 4]
Input [4]: [d_year#10, i_category_id#6, i_category#7, sum#12]
Keys [3]: [d_year#10, i_category_id#6, i_category#7]
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#13]
Results [4]: [d_year#10, i_category_id#6, i_category#7, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#13,17,2) AS sum(ss_ext_sales_price)#14]

(17) TakeOrderedAndProject
Input [4]: [d_year#10, i_category_id#6, i_category#7, sum(ss_ext_sales_price)#14]
Arguments: 100, [sum(ss_ext_sales_price)#14 DESC NULLS LAST, d_year#10 ASC NULLS FIRST, i_category_id#6 ASC NULLS FIRST, i_category#7 ASC NULLS FIRST], [d_year#10, i_category_id#6, i_category#7, sum(ss_ext_sales_price)#14]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4
BroadcastExchange (22)
+- * Project (21)
   +- * Filter (20)
      +- * ColumnarToRow (19)
         +- Scan parquet spark_catalog.default.date_dim (18)


(18) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#9, d_year#10, d_moy#15]
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,2000), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(19) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#10, d_moy#15]

(20) Filter [codegen id : 1]
Input [3]: [d_date_sk#9, d_year#10, d_moy#15]
Condition : ((((isnotnull(d_moy#15) AND isnotnull(d_year#10)) AND (d_moy#15 = 11)) AND (d_year#10 = 2000)) AND isnotnull(d_date_sk#9))

(21) Project [codegen id : 1]
Output [2]: [d_date_sk#9, d_year#10]
Input [3]: [d_date_sk#9, d_year#10, d_moy#15]

(22) BroadcastExchange
Input [2]: [d_date_sk#9, d_year#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]


