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


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

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

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

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

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

(6) Filter [codegen id : 1]
Input [3]: [d_date_sk#5, d_year#6, d_qoy#7]
Condition : isnotnull(d_date_sk#5)

(7) BroadcastExchange
Input [3]: [d_date_sk#5, d_year#6, d_qoy#7]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8]

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

(9) Project [codegen id : 3]
Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, d_year#6, d_qoy#7]
Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#5, d_year#6, d_qoy#7]

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

(11) ColumnarToRow [codegen id : 2]
Input [2]: [i_item_sk#9, i_category#10]

(12) Filter [codegen id : 2]
Input [2]: [i_item_sk#9, i_category#10]
Condition : isnotnull(i_item_sk#9)

(13) BroadcastExchange
Input [2]: [i_item_sk#9, i_category#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11]

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

(15) Project [codegen id : 3]
Output [6]: [store AS channel#12, ss_store_sk#2 AS col_name#13, d_year#6, d_qoy#7, i_category#10, ss_ext_sales_price#3 AS ext_sales_price#14]
Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, d_year#6, d_qoy#7, i_item_sk#9, i_category#10]

(16) Scan parquet default.web_sales
Output [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(ws_sold_date_sk#18)]
PushedFilters: [IsNull(ws_ship_customer_sk), IsNotNull(ws_item_sk)]
ReadSchema: struct<ws_item_sk:int,ws_ship_customer_sk:int,ws_ext_sales_price:decimal(7,2)>

(17) ColumnarToRow [codegen id : 4]
Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18]

(18) Filter [codegen id : 4]
Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18]
Condition : (isnull(ws_ship_customer_sk#16) AND isnotnull(ws_item_sk#15))

(19) BroadcastExchange
Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18]
Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19]

(20) Scan parquet default.date_dim
Output [3]: [d_date_sk#20, d_year#21, d_qoy#22]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>

(21) ColumnarToRow
Input [3]: [d_date_sk#20, d_year#21, d_qoy#22]

(22) Filter
Input [3]: [d_date_sk#20, d_year#21, d_qoy#22]
Condition : isnotnull(d_date_sk#20)

(23) BroadcastHashJoin [codegen id : 5]
Left keys [1]: [ws_sold_date_sk#18]
Right keys [1]: [d_date_sk#20]
Join condition: None

(24) Project [codegen id : 5]
Output [5]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22]
Input [7]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18, d_date_sk#20, d_year#21, d_qoy#22]

(25) BroadcastExchange
Input [5]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23]

(26) Scan parquet default.item
Output [2]: [i_item_sk#24, i_category#25]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_category:string>

(27) ColumnarToRow
Input [2]: [i_item_sk#24, i_category#25]

(28) Filter
Input [2]: [i_item_sk#24, i_category#25]
Condition : isnotnull(i_item_sk#24)

(29) BroadcastHashJoin [codegen id : 6]
Left keys [1]: [ws_item_sk#15]
Right keys [1]: [i_item_sk#24]
Join condition: None

(30) Project [codegen id : 6]
Output [6]: [web AS channel#26, ws_ship_customer_sk#16 AS col_name#27, d_year#21, d_qoy#22, i_category#25, ws_ext_sales_price#17 AS ext_sales_price#28]
Input [7]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22, i_item_sk#24, i_category#25]

(31) Scan parquet default.catalog_sales
Output [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(cs_sold_date_sk#32)]
PushedFilters: [IsNull(cs_ship_addr_sk), IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_ship_addr_sk:int,cs_item_sk:int,cs_ext_sales_price:decimal(7,2)>

(32) ColumnarToRow [codegen id : 9]
Input [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32]

(33) Filter [codegen id : 9]
Input [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32]
Condition : (isnull(cs_ship_addr_sk#29) AND isnotnull(cs_item_sk#30))

(34) ReusedExchange [Reuses operator id: 7]
Output [3]: [d_date_sk#33, d_year#34, d_qoy#35]

(35) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_sold_date_sk#32]
Right keys [1]: [d_date_sk#33]
Join condition: None

(36) Project [codegen id : 9]
Output [5]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, d_year#34, d_qoy#35]
Input [7]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32, d_date_sk#33, d_year#34, d_qoy#35]

(37) ReusedExchange [Reuses operator id: 13]
Output [2]: [i_item_sk#36, i_category#37]

(38) BroadcastHashJoin [codegen id : 9]
Left keys [1]: [cs_item_sk#30]
Right keys [1]: [i_item_sk#36]
Join condition: None

(39) Project [codegen id : 9]
Output [6]: [catalog AS channel#38, cs_ship_addr_sk#29 AS col_name#39, d_year#34, d_qoy#35, i_category#37, cs_ext_sales_price#31 AS ext_sales_price#40]
Input [7]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, d_year#34, d_qoy#35, i_item_sk#36, i_category#37]

(40) Union

(41) HashAggregate [codegen id : 10]
Input [6]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, ext_sales_price#14]
Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10]
Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))]
Aggregate Attributes [2]: [count#41, sum#42]
Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44]

(42) Exchange
Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44]
Arguments: hashpartitioning(channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, 5), ENSURE_REQUIREMENTS, [id=#45]

(43) HashAggregate [codegen id : 11]
Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44]
Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10]
Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))]
Aggregate Attributes [2]: [count(1)#46, sum(UnscaledValue(ext_sales_price#14))#47]
Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count(1)#46 AS sales_cnt#48, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#47,17,2) AS sales_amt#49]

(44) TakeOrderedAndProject
Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#48, sales_amt#49]
Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_qoy#7 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#48, sales_amt#49]

