== Physical Plan ==
TakeOrderedAndProject (28)
+- * HashAggregate (27)
   +- Exchange (26)
      +- * HashAggregate (25)
         +- * Project (24)
            +- * SortMergeJoin Inner (23)
               :- * Sort (16)
               :  +- Exchange (15)
               :     +- * Project (14)
               :        +- * BroadcastHashJoin Inner BuildRight (13)
               :           :- * Project (11)
               :           :  +- * BroadcastHashJoin Inner BuildLeft (10)
               :           :     :- BroadcastExchange (5)
               :           :     :  +- * Project (4)
               :           :     :     +- * Filter (3)
               :           :     :        +- * ColumnarToRow (2)
               :           :     :           +- Scan parquet default.item (1)
               :           :     +- * Project (9)
               :           :        +- * Filter (8)
               :           :           +- * ColumnarToRow (7)
               :           :              +- Scan parquet default.inventory (6)
               :           +- ReusedExchange (12)
               +- * Sort (22)
                  +- Exchange (21)
                     +- * Project (20)
                        +- * Filter (19)
                           +- * ColumnarToRow (18)
                              +- Scan parquet default.catalog_sales (17)


(1) Scan parquet default.item
Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5]
Batched: true
Location [not included in comparison]/{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), LessThanOrEqual(i_current_price,98.00), In(i_manufact_id, [677,694,808,940]), IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_item_id:string,i_item_desc:string,i_current_price:decimal(7,2),i_manufact_id:int>

(2) ColumnarToRow [codegen id : 1]
Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5]

(3) Filter [codegen id : 1]
Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5]
Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 68.00)) AND (i_current_price#4 <= 98.00)) AND i_manufact_id#5 IN (677,940,694,808)) AND isnotnull(i_item_sk#1))

(4) Project [codegen id : 1]
Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4]
Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5]

(5) BroadcastExchange
Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6]

(6) Scan parquet default.inventory
Output [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(inv_date_sk#9), dynamicpruningexpression(inv_date_sk#9 IN dynamicpruning#10)]
PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk)]
ReadSchema: struct<inv_item_sk:int,inv_quantity_on_hand:int>

(7) ColumnarToRow
Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9]

(8) Filter
Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9]
Condition : (((isnotnull(inv_quantity_on_hand#8) AND (inv_quantity_on_hand#8 >= 100)) AND (inv_quantity_on_hand#8 <= 500)) AND isnotnull(inv_item_sk#7))

(9) Project
Output [2]: [inv_item_sk#7, inv_date_sk#9]
Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9]

(10) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [i_item_sk#1]
Right keys [1]: [inv_item_sk#7]
Join condition: None

(11) Project [codegen id : 3]
Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9]
Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_item_sk#7, inv_date_sk#9]

(12) ReusedExchange [Reuses operator id: 33]
Output [1]: [d_date_sk#11]

(13) BroadcastHashJoin [codegen id : 3]
Left keys [1]: [inv_date_sk#9]
Right keys [1]: [d_date_sk#11]
Join condition: None

(14) Project [codegen id : 3]
Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4]
Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9, d_date_sk#11]

(15) Exchange
Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4]
Arguments: hashpartitioning(i_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#12]

(16) Sort [codegen id : 4]
Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4]
Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0

(17) Scan parquet default.catalog_sales
Output [2]: [cs_item_sk#13, cs_sold_date_sk#14]
Batched: true
Location [not included in comparison]/{warehouse_dir}/catalog_sales]
PushedFilters: [IsNotNull(cs_item_sk)]
ReadSchema: struct<cs_item_sk:int>

(18) ColumnarToRow [codegen id : 5]
Input [2]: [cs_item_sk#13, cs_sold_date_sk#14]

(19) Filter [codegen id : 5]
Input [2]: [cs_item_sk#13, cs_sold_date_sk#14]
Condition : isnotnull(cs_item_sk#13)

(20) Project [codegen id : 5]
Output [1]: [cs_item_sk#13]
Input [2]: [cs_item_sk#13, cs_sold_date_sk#14]

(21) Exchange
Input [1]: [cs_item_sk#13]
Arguments: hashpartitioning(cs_item_sk#13, 5), ENSURE_REQUIREMENTS, [id=#15]

(22) Sort [codegen id : 6]
Input [1]: [cs_item_sk#13]
Arguments: [cs_item_sk#13 ASC NULLS FIRST], false, 0

(23) SortMergeJoin [codegen id : 7]
Left keys [1]: [i_item_sk#1]
Right keys [1]: [cs_item_sk#13]
Join condition: None

(24) Project [codegen id : 7]
Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, cs_item_sk#13]

(25) HashAggregate [codegen id : 7]
Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Functions: []
Aggregate Attributes: []
Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]

(26) Exchange
Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), ENSURE_REQUIREMENTS, [id=#16]

(27) HashAggregate [codegen id : 8]
Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Functions: []
Aggregate Attributes: []
Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]

(28) TakeOrderedAndProject
Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4]
Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4]

===== Subqueries =====

Subquery:1 Hosting operator id = 6 Hosting Expression = inv_date_sk#9 IN dynamicpruning#10
BroadcastExchange (33)
+- * Project (32)
   +- * Filter (31)
      +- * ColumnarToRow (30)
         +- Scan parquet default.date_dim (29)


(29) Scan parquet default.date_dim
Output [2]: [d_date_sk#11, d_date#17]
Batched: true
Location [not included in comparison]/{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-01), LessThanOrEqual(d_date,2000-04-01), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_date:date>

(30) ColumnarToRow [codegen id : 1]
Input [2]: [d_date_sk#11, d_date#17]

(31) Filter [codegen id : 1]
Input [2]: [d_date_sk#11, d_date#17]
Condition : (((isnotnull(d_date#17) AND (d_date#17 >= 2000-02-01)) AND (d_date#17 <= 2000-04-01)) AND isnotnull(d_date_sk#11))

(32) Project [codegen id : 1]
Output [1]: [d_date_sk#11]
Input [2]: [d_date_sk#11, d_date#17]

(33) BroadcastExchange
Input [1]: [d_date_sk#11]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]


