== Physical Plan ==
TakeOrderedAndProject (41)
+- * HashAggregate (40)
   +- Exchange (39)
      +- * HashAggregate (38)
         +- * Project (37)
            +- * SortMergeJoin Inner (36)
               :- * Sort (21)
               :  +- Exchange (20)
               :     +- * Project (19)
               :        +- * BroadcastHashJoin Inner BuildRight (18)
               :           :- * 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)
               :           +- BroadcastExchange (17)
               :              +- * Filter (16)
               :                 +- * ColumnarToRow (15)
               :                    +- Scan parquet spark_catalog.default.store (14)
               +- * Sort (35)
                  +- Exchange (34)
                     +- * Project (33)
                        +- * SortMergeJoin Inner (32)
                           :- * Sort (26)
                           :  +- Exchange (25)
                           :     +- * Filter (24)
                           :        +- * ColumnarToRow (23)
                           :           +- Scan parquet spark_catalog.default.customer (22)
                           +- * Sort (31)
                              +- Exchange (30)
                                 +- * Filter (29)
                                    +- * ColumnarToRow (28)
                                       +- Scan parquet spark_catalog.default.customer_address (27)


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

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

(3) Filter [codegen id : 4]
Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5]
Condition : ((isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_store_sk#3))

(4) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manufact_id:int,i_manufact:string,i_manager_id:int>

(5) ColumnarToRow [codegen id : 1]
Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12]

(6) Filter [codegen id : 1]
Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12]
Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 8)) AND isnotnull(i_item_sk#7))

(7) Project [codegen id : 1]
Output [5]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12]

(8) BroadcastExchange
Input [5]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]

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

(10) Project [codegen id : 4]
Output [8]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]

(11) ReusedExchange [Reuses operator id: 46]
Output [1]: [d_date_sk#13]

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

(13) Project [codegen id : 4]
Output [7]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Input [9]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, d_date_sk#13]

(14) Scan parquet spark_catalog.default.store
Output [2]: [s_store_sk#14, s_zip#15]
Batched: true
Location [not included in comparison]/{warehouse_dir}/store]
PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)]
ReadSchema: struct<s_store_sk:int,s_zip:string>

(15) ColumnarToRow [codegen id : 3]
Input [2]: [s_store_sk#14, s_zip#15]

(16) Filter [codegen id : 3]
Input [2]: [s_store_sk#14, s_zip#15]
Condition : (isnotnull(s_zip#15) AND isnotnull(s_store_sk#14))

(17) BroadcastExchange
Input [2]: [s_store_sk#14, s_zip#15]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]

(18) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [ss_store_sk#3]
Right keys [1]: [s_store_sk#14]
Join type: Inner
Join condition: None

(19) Project [codegen id : 4]
Output [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#15]
Input [9]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_store_sk#14, s_zip#15]

(20) Exchange
Input [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#15]
Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=3]

(21) Sort [codegen id : 5]
Input [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#15]
Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0

(22) Scan parquet spark_catalog.default.customer
Output [2]: [c_customer_sk#16, c_current_addr_sk#17]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer]
PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>

(23) ColumnarToRow [codegen id : 6]
Input [2]: [c_customer_sk#16, c_current_addr_sk#17]

(24) Filter [codegen id : 6]
Input [2]: [c_customer_sk#16, c_current_addr_sk#17]
Condition : (isnotnull(c_customer_sk#16) AND isnotnull(c_current_addr_sk#17))

(25) Exchange
Input [2]: [c_customer_sk#16, c_current_addr_sk#17]
Arguments: hashpartitioning(c_current_addr_sk#17, 5), ENSURE_REQUIREMENTS, [plan_id=4]

(26) Sort [codegen id : 7]
Input [2]: [c_customer_sk#16, c_current_addr_sk#17]
Arguments: [c_current_addr_sk#17 ASC NULLS FIRST], false, 0

(27) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#18, ca_zip#19]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)]
ReadSchema: struct<ca_address_sk:int,ca_zip:string>

(28) ColumnarToRow [codegen id : 8]
Input [2]: [ca_address_sk#18, ca_zip#19]

(29) Filter [codegen id : 8]
Input [2]: [ca_address_sk#18, ca_zip#19]
Condition : (isnotnull(ca_address_sk#18) AND isnotnull(ca_zip#19))

(30) Exchange
Input [2]: [ca_address_sk#18, ca_zip#19]
Arguments: hashpartitioning(ca_address_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(31) Sort [codegen id : 9]
Input [2]: [ca_address_sk#18, ca_zip#19]
Arguments: [ca_address_sk#18 ASC NULLS FIRST], false, 0

(32) SortMergeJoin [codegen id : 10]
Left keys [1]: [c_current_addr_sk#17]
Right keys [1]: [ca_address_sk#18]
Join type: Inner
Join condition: None

(33) Project [codegen id : 10]
Output [2]: [c_customer_sk#16, ca_zip#19]
Input [4]: [c_customer_sk#16, c_current_addr_sk#17, ca_address_sk#18, ca_zip#19]

(34) Exchange
Input [2]: [c_customer_sk#16, ca_zip#19]
Arguments: hashpartitioning(c_customer_sk#16, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(35) Sort [codegen id : 11]
Input [2]: [c_customer_sk#16, ca_zip#19]
Arguments: [c_customer_sk#16 ASC NULLS FIRST], false, 0

(36) SortMergeJoin [codegen id : 12]
Left keys [1]: [ss_customer_sk#2]
Right keys [1]: [c_customer_sk#16]
Join type: Inner
Join condition: NOT (substr(ca_zip#19, 1, 5) = substr(s_zip#15, 1, 5))

(37) Project [codegen id : 12]
Output [5]: [ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Input [9]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#15, c_customer_sk#16, ca_zip#19]

(38) HashAggregate [codegen id : 12]
Input [5]: [ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11]
Keys [4]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11]
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#4))]
Aggregate Attributes [1]: [sum#20]
Results [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#21]

(39) Exchange
Input [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#21]
Arguments: hashpartitioning(i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(40) HashAggregate [codegen id : 13]
Input [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#21]
Keys [4]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11]
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#22]
Results [5]: [i_brand_id#8 AS brand_id#23, i_brand#9 AS brand#24, i_manufact_id#10, i_manufact#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#22,17,2) AS ext_price#25]

(41) TakeOrderedAndProject
Input [5]: [brand_id#23, brand#24, i_manufact_id#10, i_manufact#11, ext_price#25]
Arguments: 100, [ext_price#25 DESC NULLS LAST, brand#24 ASC NULLS FIRST, brand_id#23 ASC NULLS FIRST, i_manufact_id#10 ASC NULLS FIRST, i_manufact#11 ASC NULLS FIRST], [brand_id#23, brand#24, i_manufact_id#10, i_manufact#11, ext_price#25]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6
BroadcastExchange (46)
+- * Project (45)
   +- * Filter (44)
      +- * ColumnarToRow (43)
         +- Scan parquet spark_catalog.default.date_dim (42)


(42) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#13, d_year#26, d_moy#27]
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,1998), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

(43) ColumnarToRow [codegen id : 1]
Input [3]: [d_date_sk#13, d_year#26, d_moy#27]

(44) Filter [codegen id : 1]
Input [3]: [d_date_sk#13, d_year#26, d_moy#27]
Condition : ((((isnotnull(d_moy#27) AND isnotnull(d_year#26)) AND (d_moy#27 = 11)) AND (d_year#26 = 1998)) AND isnotnull(d_date_sk#13))

(45) Project [codegen id : 1]
Output [1]: [d_date_sk#13]
Input [3]: [d_date_sk#13, d_year#26, d_moy#27]

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


