== Physical Plan ==
TakeOrderedAndProject (67)
+- * HashAggregate (66)
   +- Exchange (65)
      +- * HashAggregate (64)
         +- Union (63)
            :- * HashAggregate (32)
            :  +- Exchange (31)
            :     +- * HashAggregate (30)
            :        +- * Project (29)
            :           +- * BroadcastHashJoin Inner BuildRight (28)
            :              :- * Project (17)
            :              :  +- * BroadcastHashJoin Inner BuildRight (16)
            :              :     :- * 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.date_dim (4)
            :              :     +- BroadcastExchange (15)
            :              :        +- * Project (14)
            :              :           +- * Filter (13)
            :              :              +- * ColumnarToRow (12)
            :              :                 +- Scan parquet spark_catalog.default.customer_address (11)
            :              +- BroadcastExchange (27)
            :                 +- * BroadcastHashJoin LeftSemi BuildRight (26)
            :                    :- * Filter (20)
            :                    :  +- * ColumnarToRow (19)
            :                    :     +- Scan parquet spark_catalog.default.item (18)
            :                    +- BroadcastExchange (25)
            :                       +- * Project (24)
            :                          +- * Filter (23)
            :                             +- * ColumnarToRow (22)
            :                                +- Scan parquet spark_catalog.default.item (21)
            :- * HashAggregate (47)
            :  +- Exchange (46)
            :     +- * HashAggregate (45)
            :        +- * Project (44)
            :           +- * BroadcastHashJoin Inner BuildRight (43)
            :              :- * Project (41)
            :              :  +- * BroadcastHashJoin Inner BuildRight (40)
            :              :     :- * Project (38)
            :              :     :  +- * BroadcastHashJoin Inner BuildRight (37)
            :              :     :     :- * Filter (35)
            :              :     :     :  +- * ColumnarToRow (34)
            :              :     :     :     +- Scan parquet spark_catalog.default.catalog_sales (33)
            :              :     :     +- ReusedExchange (36)
            :              :     +- ReusedExchange (39)
            :              +- ReusedExchange (42)
            +- * HashAggregate (62)
               +- Exchange (61)
                  +- * HashAggregate (60)
                     +- * Project (59)
                        +- * BroadcastHashJoin Inner BuildRight (58)
                           :- * Project (56)
                           :  +- * BroadcastHashJoin Inner BuildRight (55)
                           :     :- * Project (53)
                           :     :  +- * BroadcastHashJoin Inner BuildRight (52)
                           :     :     :- * Filter (50)
                           :     :     :  +- * ColumnarToRow (49)
                           :     :     :     +- Scan parquet spark_catalog.default.web_sales (48)
                           :     :     +- ReusedExchange (51)
                           :     +- ReusedExchange (54)
                           +- ReusedExchange (57)


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

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

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

(4) Scan parquet spark_catalog.default.date_dim
Output [3]: [d_date_sk#5, d_year#6, d_moy#7]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>

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

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

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

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

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

(10) Project [codegen id : 5]
Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3]
Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#5]

(11) Scan parquet spark_catalog.default.customer_address
Output [2]: [ca_address_sk#8, ca_gmt_offset#9]
Batched: true
Location [not included in comparison]/{warehouse_dir}/customer_address]
PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)]
ReadSchema: struct<ca_address_sk:int,ca_gmt_offset:decimal(5,2)>

(12) ColumnarToRow [codegen id : 2]
Input [2]: [ca_address_sk#8, ca_gmt_offset#9]

(13) Filter [codegen id : 2]
Input [2]: [ca_address_sk#8, ca_gmt_offset#9]
Condition : ((isnotnull(ca_gmt_offset#9) AND (ca_gmt_offset#9 = -5.00)) AND isnotnull(ca_address_sk#8))

(14) Project [codegen id : 2]
Output [1]: [ca_address_sk#8]
Input [2]: [ca_address_sk#8, ca_gmt_offset#9]

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

(16) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [ss_addr_sk#2]
Right keys [1]: [ca_address_sk#8]
Join type: Inner
Join condition: None

(17) Project [codegen id : 5]
Output [2]: [ss_item_sk#1, ss_ext_sales_price#3]
Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#8]

(18) Scan parquet spark_catalog.default.item
Output [2]: [i_item_sk#10, i_item_id#11]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_id:string>

(19) ColumnarToRow [codegen id : 4]
Input [2]: [i_item_sk#10, i_item_id#11]

(20) Filter [codegen id : 4]
Input [2]: [i_item_sk#10, i_item_id#11]
Condition : isnotnull(i_item_sk#10)

(21) Scan parquet spark_catalog.default.item
Output [2]: [i_item_id#12, i_color#13]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [In(i_color, [blanched            ,burnished           ,slate               ])]
ReadSchema: struct<i_item_id:string,i_color:string>

(22) ColumnarToRow [codegen id : 3]
Input [2]: [i_item_id#12, i_color#13]

(23) Filter [codegen id : 3]
Input [2]: [i_item_id#12, i_color#13]
Condition : i_color#13 IN (slate               ,blanched            ,burnished           )

(24) Project [codegen id : 3]
Output [1]: [i_item_id#12]
Input [2]: [i_item_id#12, i_color#13]

(25) BroadcastExchange
Input [1]: [i_item_id#12]
Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=3]

(26) BroadcastHashJoin [codegen id : 4]
Left keys [1]: [i_item_id#11]
Right keys [1]: [i_item_id#12]
Join type: LeftSemi
Join condition: None

(27) BroadcastExchange
Input [2]: [i_item_sk#10, i_item_id#11]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]

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

(29) Project [codegen id : 5]
Output [2]: [ss_ext_sales_price#3, i_item_id#11]
Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#10, i_item_id#11]

(30) HashAggregate [codegen id : 5]
Input [2]: [ss_ext_sales_price#3, i_item_id#11]
Keys [1]: [i_item_id#11]
Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))]
Aggregate Attributes [1]: [sum#14]
Results [2]: [i_item_id#11, sum#15]

(31) Exchange
Input [2]: [i_item_id#11, sum#15]
Arguments: hashpartitioning(i_item_id#11, 5), ENSURE_REQUIREMENTS, [plan_id=5]

(32) HashAggregate [codegen id : 6]
Input [2]: [i_item_id#11, sum#15]
Keys [1]: [i_item_id#11]
Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))]
Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#16]
Results [2]: [i_item_id#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#16,17,2) AS total_sales#17]

(33) Scan parquet spark_catalog.default.catalog_sales
Output [4]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#21)]
PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_bill_addr_sk:int,cs_item_sk:int,cs_ext_sales_price:decimal(7,2)>

(34) ColumnarToRow [codegen id : 11]
Input [4]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21]

(35) Filter [codegen id : 11]
Input [4]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21]
Condition : (isnotnull(cs_bill_addr_sk#18) AND isnotnull(cs_item_sk#19))

(36) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#22]

(37) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_sold_date_sk#21]
Right keys [1]: [d_date_sk#22]
Join type: Inner
Join condition: None

(38) Project [codegen id : 11]
Output [3]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20]
Input [5]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21, d_date_sk#22]

(39) ReusedExchange [Reuses operator id: 15]
Output [1]: [ca_address_sk#23]

(40) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_bill_addr_sk#18]
Right keys [1]: [ca_address_sk#23]
Join type: Inner
Join condition: None

(41) Project [codegen id : 11]
Output [2]: [cs_item_sk#19, cs_ext_sales_price#20]
Input [4]: [cs_bill_addr_sk#18, cs_item_sk#19, cs_ext_sales_price#20, ca_address_sk#23]

(42) ReusedExchange [Reuses operator id: 27]
Output [2]: [i_item_sk#24, i_item_id#25]

(43) BroadcastHashJoin [codegen id : 11]
Left keys [1]: [cs_item_sk#19]
Right keys [1]: [i_item_sk#24]
Join type: Inner
Join condition: None

(44) Project [codegen id : 11]
Output [2]: [cs_ext_sales_price#20, i_item_id#25]
Input [4]: [cs_item_sk#19, cs_ext_sales_price#20, i_item_sk#24, i_item_id#25]

(45) HashAggregate [codegen id : 11]
Input [2]: [cs_ext_sales_price#20, i_item_id#25]
Keys [1]: [i_item_id#25]
Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#20))]
Aggregate Attributes [1]: [sum#26]
Results [2]: [i_item_id#25, sum#27]

(46) Exchange
Input [2]: [i_item_id#25, sum#27]
Arguments: hashpartitioning(i_item_id#25, 5), ENSURE_REQUIREMENTS, [plan_id=6]

(47) HashAggregate [codegen id : 12]
Input [2]: [i_item_id#25, sum#27]
Keys [1]: [i_item_id#25]
Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#20))]
Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#20))#28]
Results [2]: [i_item_id#25, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#20))#28,17,2) AS total_sales#29]

(48) Scan parquet spark_catalog.default.web_sales
Output [4]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32, ws_sold_date_sk#33]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#33)]
PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int,ws_bill_addr_sk:int,ws_ext_sales_price:decimal(7,2)>

(49) ColumnarToRow [codegen id : 17]
Input [4]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32, ws_sold_date_sk#33]

(50) Filter [codegen id : 17]
Input [4]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32, ws_sold_date_sk#33]
Condition : (isnotnull(ws_bill_addr_sk#31) AND isnotnull(ws_item_sk#30))

(51) ReusedExchange [Reuses operator id: 8]
Output [1]: [d_date_sk#34]

(52) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [ws_sold_date_sk#33]
Right keys [1]: [d_date_sk#34]
Join type: Inner
Join condition: None

(53) Project [codegen id : 17]
Output [3]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32]
Input [5]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32, ws_sold_date_sk#33, d_date_sk#34]

(54) ReusedExchange [Reuses operator id: 15]
Output [1]: [ca_address_sk#35]

(55) BroadcastHashJoin [codegen id : 17]
Left keys [1]: [ws_bill_addr_sk#31]
Right keys [1]: [ca_address_sk#35]
Join type: Inner
Join condition: None

(56) Project [codegen id : 17]
Output [2]: [ws_item_sk#30, ws_ext_sales_price#32]
Input [4]: [ws_item_sk#30, ws_bill_addr_sk#31, ws_ext_sales_price#32, ca_address_sk#35]

(57) ReusedExchange [Reuses operator id: 27]
Output [2]: [i_item_sk#36, i_item_id#37]

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

(59) Project [codegen id : 17]
Output [2]: [ws_ext_sales_price#32, i_item_id#37]
Input [4]: [ws_item_sk#30, ws_ext_sales_price#32, i_item_sk#36, i_item_id#37]

(60) HashAggregate [codegen id : 17]
Input [2]: [ws_ext_sales_price#32, i_item_id#37]
Keys [1]: [i_item_id#37]
Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#32))]
Aggregate Attributes [1]: [sum#38]
Results [2]: [i_item_id#37, sum#39]

(61) Exchange
Input [2]: [i_item_id#37, sum#39]
Arguments: hashpartitioning(i_item_id#37, 5), ENSURE_REQUIREMENTS, [plan_id=7]

(62) HashAggregate [codegen id : 18]
Input [2]: [i_item_id#37, sum#39]
Keys [1]: [i_item_id#37]
Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#32))]
Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#32))#40]
Results [2]: [i_item_id#37, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#32))#40,17,2) AS total_sales#41]

(63) Union

(64) HashAggregate [codegen id : 19]
Input [2]: [i_item_id#11, total_sales#17]
Keys [1]: [i_item_id#11]
Functions [1]: [partial_sum(total_sales#17)]
Aggregate Attributes [2]: [sum#42, isEmpty#43]
Results [3]: [i_item_id#11, sum#44, isEmpty#45]

(65) Exchange
Input [3]: [i_item_id#11, sum#44, isEmpty#45]
Arguments: hashpartitioning(i_item_id#11, 5), ENSURE_REQUIREMENTS, [plan_id=8]

(66) HashAggregate [codegen id : 20]
Input [3]: [i_item_id#11, sum#44, isEmpty#45]
Keys [1]: [i_item_id#11]
Functions [1]: [sum(total_sales#17)]
Aggregate Attributes [1]: [sum(total_sales#17)#46]
Results [2]: [i_item_id#11, sum(total_sales#17)#46 AS total_sales#47]

(67) TakeOrderedAndProject
Input [2]: [i_item_id#11, total_sales#47]
Arguments: 100, [total_sales#47 ASC NULLS FIRST], [i_item_id#11, total_sales#47]

