== Physical Plan ==
VeloxColumnarToRow (42)
+- TakeOrderedAndProjectExecTransformer (41)
   +- ^ ProjectExecTransformer (39)
      +- ^ RegularHashAggregateExecTransformer (38)
         +- ^ InputIteratorTransformer (37)
            +- ColumnarExchange (35)
               +- VeloxResizeBatches (34)
                  +- ^ ProjectExecTransformer (32)
                     +- ^ FlushableHashAggregateExecTransformer (31)
                        +- ^ ExpandExecTransformer (30)
                           +- ^ ProjectExecTransformer (29)
                              +- ^ VeloxBroadcastNestedLoopJoinExecTransformer Inner BuildRight (28)
                                 :- ^ ProjectExecTransformer (22)
                                 :  +- ^ ShuffledHashJoinExecTransformer Inner BuildRight (21)
                                 :     :- ^ InputIteratorTransformer (12)
                                 :     :  +- ColumnarExchange (10)
                                 :     :     +- VeloxResizeBatches (9)
                                 :     :        +- ^ ProjectExecTransformer (7)
                                 :     :           +- ^ BroadcastHashJoinExecTransformer Inner BuildRight (6)
                                 :     :              :- ^ FilterExecTransformer (2)
                                 :     :              :  +- ^ FileSourceScanExecTransformer parquet spark_catalog.default.inventory (1)
                                 :     :              +- ^ InputIteratorTransformer (5)
                                 :     :                 +- ReusedExchange (3)
                                 :     +- ^ InputIteratorTransformer (20)
                                 :        +- ColumnarExchange (18)
                                 :           +- VeloxResizeBatches (17)
                                 :              +- ^ ProjectExecTransformer (15)
                                 :                 +- ^ FilterExecTransformer (14)
                                 :                    +- ^ FileSourceScanExecTransformer parquet spark_catalog.default.item (13)
                                 +- ^ InputIteratorTransformer (27)
                                    +- ColumnarBroadcastExchange (25)
                                       +- ^ FileSourceScanExecTransformer parquet spark_catalog.default.warehouse (23)


(1) FileSourceScanExecTransformer parquet spark_catalog.default.inventory
Output [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]
Batched: true
Location: InMemoryFileIndex []
PartitionFilters: [isnotnull(inv_date_sk#3), dynamicpruningexpression(inv_date_sk#3 IN dynamicpruning#4)]
PushedFilters: [IsNotNull(inv_item_sk)]
ReadSchema: struct<inv_item_sk:int,inv_quantity_on_hand:int>

(2) FilterExecTransformer
Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]
Arguments: isnotnull(inv_item_sk#1)

(3) ReusedExchange [Reuses operator id: 47]
Output [1]: [d_date_sk#5]

(4) InputAdapter
Input [1]: [d_date_sk#5]

(5) InputIteratorTransformer
Input [1]: [d_date_sk#5]

(6) BroadcastHashJoinExecTransformer
Left keys [1]: [inv_date_sk#3]
Right keys [1]: [d_date_sk#5]
Join type: Inner
Join condition: None

(7) ProjectExecTransformer
Output [3]: [hash(inv_item_sk#1, 42) AS hash_partition_key#6, inv_item_sk#1, inv_quantity_on_hand#2]
Input [4]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3, d_date_sk#5]

(8) WholeStageCodegenTransformer (3)
Input [3]: [hash_partition_key#6, inv_item_sk#1, inv_quantity_on_hand#2]
Arguments: false

(9) VeloxResizeBatches
Input [3]: [hash_partition_key#6, inv_item_sk#1, inv_quantity_on_hand#2]
Arguments: 1024, 2147483647, 10485760

(10) ColumnarExchange
Input [3]: [hash_partition_key#6, inv_item_sk#1, inv_quantity_on_hand#2]
Arguments: hashpartitioning(inv_item_sk#1, 1), ENSURE_REQUIREMENTS, [inv_item_sk#1, inv_quantity_on_hand#2], [plan_id=1], [shuffle_writer_type=hash]

(11) InputAdapter
Input [2]: [inv_item_sk#1, inv_quantity_on_hand#2]

(12) InputIteratorTransformer
Input [2]: [inv_item_sk#1, inv_quantity_on_hand#2]

(13) FileSourceScanExecTransformer parquet spark_catalog.default.item
Output [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Batched: true
Location: InMemoryFileIndex [{warehouse_dir}/item]
PushedFilters: [IsNotNull(i_item_sk)]
ReadSchema: struct<i_item_sk:int,i_brand:string,i_class:string,i_category:string,i_product_name:string>

(14) FilterExecTransformer
Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Arguments: isnotnull(i_item_sk#7)

(15) ProjectExecTransformer
Output [6]: [hash(i_item_sk#7, 42) AS hash_partition_key#12, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(16) WholeStageCodegenTransformer (4)
Input [6]: [hash_partition_key#12, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Arguments: false

(17) VeloxResizeBatches
Input [6]: [hash_partition_key#12, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Arguments: 1024, 2147483647, 10485760

(18) ColumnarExchange
Input [6]: [hash_partition_key#12, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Arguments: hashpartitioning(i_item_sk#7, 1), ENSURE_REQUIREMENTS, [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11], [plan_id=2], [shuffle_writer_type=hash]

(19) InputAdapter
Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(20) InputIteratorTransformer
Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(21) ShuffledHashJoinExecTransformer
Left keys [1]: [inv_item_sk#1]
Right keys [1]: [i_item_sk#7]
Join type: Inner
Join condition: None

(22) ProjectExecTransformer
Output [5]: [inv_quantity_on_hand#2, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Input [7]: [inv_item_sk#1, inv_quantity_on_hand#2, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(23) FileSourceScanExecTransformer parquet spark_catalog.default.warehouse
Output: []
Batched: true
Location: InMemoryFileIndex [{warehouse_dir}/warehouse]
ReadSchema: struct<>

(24) WholeStageCodegenTransformer (5)
Input: []
Arguments: false

(25) ColumnarBroadcastExchange
Input: []
Arguments: IdentityBroadcastMode, [plan_id=3]

(26) InputAdapter
Input: []

(27) InputIteratorTransformer
Input: []

(28) VeloxBroadcastNestedLoopJoinExecTransformer
Join type: Inner
Join condition: None

(29) ProjectExecTransformer
Output [5]: [inv_quantity_on_hand#2, i_product_name#11, i_brand#8, i_class#9, i_category#10]
Input [5]: [inv_quantity_on_hand#2, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(30) ExpandExecTransformer
Input [5]: [inv_quantity_on_hand#2, i_product_name#11, i_brand#8, i_class#9, i_category#10]
Arguments: [[inv_quantity_on_hand#2, i_product_name#11, i_brand#8, i_class#9, i_category#10, 0], [inv_quantity_on_hand#2, i_product_name#11, i_brand#8, i_class#9, null, 1], [inv_quantity_on_hand#2, i_product_name#11, i_brand#8, null, null, 3], [inv_quantity_on_hand#2, i_product_name#11, null, null, null, 7], [inv_quantity_on_hand#2, null, null, null, null, 15]], [inv_quantity_on_hand#2, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]

(31) FlushableHashAggregateExecTransformer
Input [6]: [inv_quantity_on_hand#2, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
Keys [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
Functions [1]: [partial_avg(inv_quantity_on_hand#2)]
Aggregate Attributes [2]: [sum#18, count#19]
Results [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]

(32) ProjectExecTransformer
Output [8]: [hash(i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, 42) AS hash_partition_key#22, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]

(33) WholeStageCodegenTransformer (6)
Input [8]: [hash_partition_key#22, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
Arguments: false

(34) VeloxResizeBatches
Input [8]: [hash_partition_key#22, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
Arguments: 1024, 2147483647, 10485760

(35) ColumnarExchange
Input [8]: [hash_partition_key#22, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
Arguments: hashpartitioning(i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, 1), ENSURE_REQUIREMENTS, [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21], [plan_id=4], [shuffle_writer_type=hash]

(36) InputAdapter
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]

(37) InputIteratorTransformer
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]

(38) RegularHashAggregateExecTransformer
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
Keys [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
Functions [1]: [avg(inv_quantity_on_hand#2)]
Aggregate Attributes [1]: [avg(inv_quantity_on_hand#2)#23]
Results [6]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, avg(inv_quantity_on_hand#2)#23]

(39) ProjectExecTransformer
Output [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, avg(inv_quantity_on_hand#2)#23 AS qoh#24]
Input [6]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, avg(inv_quantity_on_hand#2)#23]

(40) WholeStageCodegenTransformer (7)
Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#24]
Arguments: false

(41) TakeOrderedAndProjectExecTransformer
Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#24]
Arguments: 100, [qoh#24 ASC NULLS FIRST, i_product_name#13 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, i_class#15 ASC NULLS FIRST, i_category#16 ASC NULLS FIRST], [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#24], 0

(42) VeloxColumnarToRow
Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#24]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#3 IN dynamicpruning#4
ColumnarBroadcastExchange (47)
+- ^ ProjectExecTransformer (45)
   +- ^ FilterExecTransformer (44)
      +- ^ FileSourceScanExecTransformer parquet spark_catalog.default.date_dim (43)


(43) FileSourceScanExecTransformer parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#5, d_month_seq#25]
Batched: true
Location: InMemoryFileIndex [{warehouse_dir}/date_dim]
PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)]
ReadSchema: struct<d_date_sk:int,d_month_seq:int>

(44) FilterExecTransformer
Input [2]: [d_date_sk#5, d_month_seq#25]
Arguments: (((isnotnull(d_month_seq#25) AND (d_month_seq#25 >= 1200)) AND (d_month_seq#25 <= 1211)) AND isnotnull(d_date_sk#5))

(45) ProjectExecTransformer
Output [1]: [d_date_sk#5]
Input [2]: [d_date_sk#5, d_month_seq#25]

(46) WholeStageCodegenTransformer (1)
Input [1]: [d_date_sk#5]
Arguments: false

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


