== Physical Plan ==
* ColumnarToRow (24)
+- CometTakeOrderedAndProject (23)
   +- CometHashAggregate (22)
      +- CometExchange (21)
         +- CometHashAggregate (20)
            +- CometExpand (19)
               +- CometProject (18)
                  +- CometBroadcastHashJoin (17)
                     :- 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)
                     +- CometBroadcastExchange (16)
                        +- CometFilter (15)
                           +- CometNativeScan: `spark_catalog`.`default`.`warehouse` (14)


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

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

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

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

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

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

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

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

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

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

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

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

(13) CometProject
Input [8]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Arguments: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11], [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(14) CometNativeScan: `spark_catalog`.`default`.`warehouse`
Output [1]: [w_warehouse_sk#12]
Arguments: [w_warehouse_sk#12]

(15) CometFilter
Input [1]: [w_warehouse_sk#12]
Condition : isnotnull(w_warehouse_sk#12)

(16) CometBroadcastExchange
Input [1]: [w_warehouse_sk#12]
Arguments: [w_warehouse_sk#12]

(17) CometBroadcastHashJoin
Left output [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Right output [1]: [w_warehouse_sk#12]
Arguments: [inv_warehouse_sk#2], [w_warehouse_sk#12], Inner, BuildRight

(18) CometProject
Input [7]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11, w_warehouse_sk#12]
Arguments: [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, i_category#10], [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, i_category#10]

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

(20) CometHashAggregate
Input [6]: [inv_quantity_on_hand#3, 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#3)]

(21) CometExchange
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#18, count#19]
Arguments: hashpartitioning(i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(22) CometHashAggregate
Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#18, count#19]
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#3)]

(23) CometTakeOrderedAndProject
Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#20]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[qoh#20 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], output=[i_product_name#13,i_brand#14,i_class#15,i_category#16,qoh#20]), [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#20], 100, [qoh#20 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#20]

(24) ColumnarToRow [codegen id : 1]
Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#20]

