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


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

(2) ColumnarToRow [codegen id : 6]
Input [3]: [d_date_sk#1, d_year#2, d_moy#3]

(3) Filter [codegen id : 6]
Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1998)) AND isnotnull(d_date_sk#1))

(4) Project [codegen id : 6]
Output [1]: [d_date_sk#1]
Input [3]: [d_date_sk#1, d_year#2, d_moy#3]

(5) Scan parquet spark_catalog.default.store_sales
Output [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(true)]
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)>

(6) ColumnarToRow [codegen id : 1]
Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]

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

(8) BroadcastExchange
Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
Arguments: HashedRelationBroadcastMode(List(cast(input[4, int, true] as bigint)),false), [plan_id=1]

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

(10) Project [codegen id : 6]
Output [4]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7]
Input [6]: [d_date_sk#1, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]

(11) Scan parquet spark_catalog.default.item
Output [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
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>

(12) ColumnarToRow [codegen id : 2]
Input [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]

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

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

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

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

(17) Project [codegen id : 6]
Output [7]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
Input [9]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]

(18) Scan parquet spark_catalog.default.customer
Output [2]: [c_customer_sk#15, c_current_addr_sk#16]
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>

(19) ColumnarToRow [codegen id : 3]
Input [2]: [c_customer_sk#15, c_current_addr_sk#16]

(20) Filter [codegen id : 3]
Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_current_addr_sk#16))

(21) BroadcastExchange
Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]

(22) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_customer_sk#5]
Right keys [1]: [c_customer_sk#15]
Join type: Inner
Join condition: None

(23) Project [codegen id : 6]
Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_current_addr_sk#16]
Input [9]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_customer_sk#15, c_current_addr_sk#16]

(24) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#17, ca_zip#18]
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>

(25) ColumnarToRow [codegen id : 4]
Input [2]: [ca_address_sk#17, ca_zip#18]

(26) Filter [codegen id : 4]
Input [2]: [ca_address_sk#17, ca_zip#18]
Condition : (isnotnull(ca_address_sk#17) AND isnotnull(ca_zip#18))

(27) BroadcastExchange
Input [2]: [ca_address_sk#17, ca_zip#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

(28) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [c_current_addr_sk#16]
Right keys [1]: [ca_address_sk#17]
Join type: Inner
Join condition: None

(29) Project [codegen id : 6]
Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, ca_zip#18]
Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_current_addr_sk#16, ca_address_sk#17, ca_zip#18]

(30) Scan parquet spark_catalog.default.store
Output [2]: [s_store_sk#19, s_zip#20]
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>

(31) ColumnarToRow [codegen id : 5]
Input [2]: [s_store_sk#19, s_zip#20]

(32) Filter [codegen id : 5]
Input [2]: [s_store_sk#19, s_zip#20]
Condition : (isnotnull(s_zip#20) AND isnotnull(s_store_sk#19))

(33) BroadcastExchange
Input [2]: [s_store_sk#19, s_zip#20]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]

(34) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ss_store_sk#6]
Right keys [1]: [s_store_sk#19]
Join type: Inner
Join condition: NOT (substr(ca_zip#18, 1, 5) = substr(s_zip#20, 1, 5))

(35) Project [codegen id : 6]
Output [5]: [ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, ca_zip#18, s_store_sk#19, s_zip#20]

(36) HashAggregate [codegen id : 6]
Input [5]: [ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
Keys [4]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13]
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))]
Aggregate Attributes [1]: [sum#21]
Results [5]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, sum#22]

(37) Exchange
Input [5]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, sum#22]
Arguments: hashpartitioning(i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, 5), ENSURE_REQUIREMENTS, [plan_id=6]

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

(39) TakeOrderedAndProject
Input [5]: [brand_id#24, brand#25, i_manufact_id#12, i_manufact#13, ext_price#26]
Arguments: 100, [ext_price#26 DESC NULLS LAST, brand#25 ASC NULLS FIRST, brand_id#24 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST, i_manufact#13 ASC NULLS FIRST], [brand_id#24, brand#25, i_manufact_id#12, i_manufact#13, ext_price#26]

