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


(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: 40]
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 [2]: [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) FileSourceScanExecTransformer parquet spark_catalog.default.item
Output [5]: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]
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>

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

(10) WholeStageCodegenTransformer (3)
Input [5]: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]
Arguments: false

(11) ColumnarBroadcastExchange
Input [5]: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]
Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]

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

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

(14) BroadcastHashJoinExecTransformer
Left keys [1]: [inv_item_sk#1]
Right keys [1]: [i_item_sk#6]
Join type: Inner
Join condition: None

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

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

(17) WholeStageCodegenTransformer (4)
Input: []
Arguments: false

(18) ColumnarBroadcastExchange
Input: []
Arguments: IdentityBroadcastMode, [plan_id=2]

(19) InputAdapter
Input: []

(20) InputIteratorTransformer
Input: []

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

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

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

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

(25) ProjectExecTransformer
Output [8]: [hash(i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, 42) AS hash_partition_key#20, i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]
Input [7]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]

(26) WholeStageCodegenTransformer (5)
Input [8]: [hash_partition_key#20, i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]
Arguments: false

(27) VeloxResizeBatches
Input [8]: [hash_partition_key#20, i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]
Arguments: 1024, 2147483647, 10485760

(28) ColumnarExchange
Input [8]: [hash_partition_key#20, i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]
Arguments: hashpartitioning(i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, 1), ENSURE_REQUIREMENTS, [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19], [plan_id=3], [shuffle_writer_type=hash]

(29) InputAdapter
Input [7]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]

(30) InputIteratorTransformer
Input [7]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]

(31) RegularHashAggregateExecTransformer
Input [7]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, sum#18, count#19]
Keys [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15]
Functions [1]: [avg(inv_quantity_on_hand#2)]
Aggregate Attributes [1]: [avg(inv_quantity_on_hand#2)#21]
Results [6]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, avg(inv_quantity_on_hand#2)#21]

(32) ProjectExecTransformer
Output [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, avg(inv_quantity_on_hand#2)#21 AS qoh#22]
Input [6]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, spark_grouping_id#15, avg(inv_quantity_on_hand#2)#21]

(33) WholeStageCodegenTransformer (6)
Input [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, qoh#22]
Arguments: false

(34) TakeOrderedAndProjectExecTransformer
Input [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, qoh#22]
Arguments: 100, [qoh#22 ASC NULLS FIRST, i_product_name#11 ASC NULLS FIRST, i_brand#12 ASC NULLS FIRST, i_class#13 ASC NULLS FIRST, i_category#14 ASC NULLS FIRST], [i_product_name#11, i_brand#12, i_class#13, i_category#14, qoh#22], 0

(35) VeloxColumnarToRow
Input [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, qoh#22]

===== Subqueries =====

Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#3 IN dynamicpruning#4
ColumnarBroadcastExchange (40)
+- ^ ProjectExecTransformer (38)
   +- ^ FilterExecTransformer (37)
      +- ^ FileSourceScanExecTransformer parquet spark_catalog.default.date_dim (36)


(36) FileSourceScanExecTransformer parquet spark_catalog.default.date_dim
Output [2]: [d_date_sk#5, d_month_seq#23]
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>

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

(38) ProjectExecTransformer
Output [1]: [d_date_sk#5]
Input [2]: [d_date_sk#5, d_month_seq#23]

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

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


