== Physical Plan ==
TakeOrderedAndProject (24)
+- * HashAggregate (23)
   +- Exchange (22)
      +- * HashAggregate (21)
         +- * Expand (20)
            +- * Project (19)
               +- * BroadcastNestedLoopJoin Inner BuildRight (18)
                  :- * ColumnarToRow (14)
                  :  +- CometProject (13)
                  :     +- CometBroadcastHashJoin (12)
                  :        :- CometProject (8)
                  :        :  +- CometBroadcastHashJoin (7)
                  :        :     :- CometFilter (2)
                  :        :     :  +- CometNativeScan: `spark_catalog`.`default`.`inventory` (1)
                  :        :     +- CometBroadcastExchange (6)
                  :        :        +- CometProject (5)
                  :        :           +- CometFilter (4)
                  :        :              +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (3)
                  :        +- CometBroadcastExchange (11)
                  :           +- CometFilter (10)
                  :              +- CometNativeScan: `spark_catalog`.`default`.`item` (9)
                  +- BroadcastExchange (17)
                     +- * ColumnarToRow (16)
                        +- CometNativeScan: `spark_catalog`.`default`.`warehouse` (15)


(1) CometNativeScan: `spark_catalog`.`default`.`inventory`
Output [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]
Arguments: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]

(2) CometFilter
Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]
Condition : isnotnull(inv_item_sk#1)

(3) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#4, d_month_seq#5]
Arguments: [d_date_sk#4, d_month_seq#5]

(4) CometFilter
Input [2]: [d_date_sk#4, d_month_seq#5]
Condition : (((isnotnull(d_month_seq#5) AND (d_month_seq#5 >= 1200)) AND (d_month_seq#5 <= 1211)) AND isnotnull(d_date_sk#4))

(5) CometProject
Input [2]: [d_date_sk#4, d_month_seq#5]
Arguments: [d_date_sk#4], [d_date_sk#4]

(6) CometBroadcastExchange
Input [1]: [d_date_sk#4]
Arguments: [d_date_sk#4]

(7) CometBroadcastHashJoin
Left output [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3]
Right output [1]: [d_date_sk#4]
Arguments: [inv_date_sk#3], [d_date_sk#4], Inner, BuildRight

(8) CometProject
Input [4]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3, d_date_sk#4]
Arguments: [inv_item_sk#1, inv_quantity_on_hand#2], [inv_item_sk#1, inv_quantity_on_hand#2]

(9) CometNativeScan: `spark_catalog`.`default`.`item`
Output [5]: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]
Arguments: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]

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

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

(12) CometBroadcastHashJoin
Left output [2]: [inv_item_sk#1, inv_quantity_on_hand#2]
Right output [5]: [i_item_sk#6, i_brand#7, i_class#8, i_category#9, i_product_name#10]
Arguments: [inv_item_sk#1], [i_item_sk#6], Inner, BuildRight

(13) CometProject
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]
Arguments: [inv_quantity_on_hand#2, i_brand#7, i_class#8, i_category#9, i_product_name#10], [inv_quantity_on_hand#2, i_brand#7, i_class#8, i_category#9, i_product_name#10]

(14) ColumnarToRow [codegen id : 2]
Input [5]: [inv_quantity_on_hand#2, i_brand#7, i_class#8, i_category#9, i_product_name#10]

(15) CometNativeScan: `spark_catalog`.`default`.`warehouse`
Output: []

(16) ColumnarToRow [codegen id : 1]
Input: []

(17) BroadcastExchange
Input: []
Arguments: IdentityBroadcastMode, [plan_id=1]

(18) BroadcastNestedLoopJoin [codegen id : 2]
Join type: Inner
Join condition: None

(19) Project [codegen id : 2]
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]

(20) Expand [codegen id : 2]
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]

(21) HashAggregate [codegen id : 2]
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]

(22) Exchange
Input [7]: [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, 5), ENSURE_REQUIREMENTS, [plan_id=2]

(23) HashAggregate [codegen id : 3]
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)#20]
Results [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, avg(inv_quantity_on_hand#2)#20 AS qoh#21]

(24) TakeOrderedAndProject
Input [5]: [i_product_name#11, i_brand#12, i_class#13, i_category#14, qoh#21]
Arguments: 100, [qoh#21 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#21]

