== Physical Plan ==
* ColumnarToRow (46)
+- CometTakeOrderedAndProject (45)
   +- CometUnion (44)
      :- CometHashAggregate (23)
      :  +- CometHashAggregate (22)
      :     +- CometHashAggregate (21)
      :        +- CometExchange (20)
      :           +- CometHashAggregate (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)
      :- CometHashAggregate (28)
      :  +- CometExchange (27)
      :     +- CometHashAggregate (26)
      :        +- CometHashAggregate (25)
      :           +- ReusedExchange (24)
      :- CometHashAggregate (33)
      :  +- CometExchange (32)
      :     +- CometHashAggregate (31)
      :        +- CometHashAggregate (30)
      :           +- ReusedExchange (29)
      :- CometHashAggregate (38)
      :  +- CometExchange (37)
      :     +- CometHashAggregate (36)
      :        +- CometHashAggregate (35)
      :           +- ReusedExchange (34)
      +- CometHashAggregate (43)
         +- CometExchange (42)
            +- CometHashAggregate (41)
               +- CometHashAggregate (40)
                  +- ReusedExchange (39)


(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 >= 1212)) AND (d_month_seq#6 <= 1223)) 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_brand#8, i_class#9, i_category#10, i_product_name#11], [inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11]

(19) CometHashAggregate
Input [5]: [inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11]
Keys [4]: [i_product_name#11, i_brand#8, i_class#9, i_category#10]
Functions [1]: [partial_avg(inv_quantity_on_hand#3)]

(20) CometExchange
Input [6]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, sum#13, count#14]
Arguments: hashpartitioning(i_product_name#11, i_brand#8, i_class#9, i_category#10, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(21) CometHashAggregate
Input [6]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, sum#13, count#14]
Keys [4]: [i_product_name#11, i_brand#8, i_class#9, i_category#10]
Functions [1]: [avg(inv_quantity_on_hand#3)]

(22) CometHashAggregate
Input [5]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#15]
Keys [4]: [i_product_name#11, i_brand#8, i_class#9, i_category#10]
Functions [1]: [partial_avg(qoh#15)]

(23) CometHashAggregate
Input [6]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, sum#16, count#17]
Keys [4]: [i_product_name#11, i_brand#8, i_class#9, i_category#10]
Functions [1]: [avg(qoh#15)]

(24) ReusedExchange [Reuses operator id: 20]
Output [6]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, sum#22, count#23]

(25) CometHashAggregate
Input [6]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, sum#22, count#23]
Keys [4]: [i_product_name#18, i_brand#19, i_class#20, i_category#21]
Functions [1]: [avg(inv_quantity_on_hand#24)]

(26) CometHashAggregate
Input [4]: [i_product_name#18, i_brand#19, i_class#20, qoh#25]
Keys [3]: [i_product_name#18, i_brand#19, i_class#20]
Functions [1]: [partial_avg(qoh#25)]

(27) CometExchange
Input [5]: [i_product_name#18, i_brand#19, i_class#20, sum#26, count#27]
Arguments: hashpartitioning(i_product_name#18, i_brand#19, i_class#20, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]

(28) CometHashAggregate
Input [5]: [i_product_name#18, i_brand#19, i_class#20, sum#26, count#27]
Keys [3]: [i_product_name#18, i_brand#19, i_class#20]
Functions [1]: [avg(qoh#25)]

(29) ReusedExchange [Reuses operator id: 20]
Output [6]: [i_product_name#28, i_brand#29, i_class#30, i_category#31, sum#32, count#33]

(30) CometHashAggregate
Input [6]: [i_product_name#28, i_brand#29, i_class#30, i_category#31, sum#32, count#33]
Keys [4]: [i_product_name#28, i_brand#29, i_class#30, i_category#31]
Functions [1]: [avg(inv_quantity_on_hand#34)]

(31) CometHashAggregate
Input [3]: [i_product_name#28, i_brand#29, qoh#35]
Keys [2]: [i_product_name#28, i_brand#29]
Functions [1]: [partial_avg(qoh#35)]

(32) CometExchange
Input [4]: [i_product_name#28, i_brand#29, sum#36, count#37]
Arguments: hashpartitioning(i_product_name#28, i_brand#29, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=3]

(33) CometHashAggregate
Input [4]: [i_product_name#28, i_brand#29, sum#36, count#37]
Keys [2]: [i_product_name#28, i_brand#29]
Functions [1]: [avg(qoh#35)]

(34) ReusedExchange [Reuses operator id: 20]
Output [6]: [i_product_name#38, i_brand#39, i_class#40, i_category#41, sum#42, count#43]

(35) CometHashAggregate
Input [6]: [i_product_name#38, i_brand#39, i_class#40, i_category#41, sum#42, count#43]
Keys [4]: [i_product_name#38, i_brand#39, i_class#40, i_category#41]
Functions [1]: [avg(inv_quantity_on_hand#44)]

(36) CometHashAggregate
Input [2]: [i_product_name#38, qoh#45]
Keys [1]: [i_product_name#38]
Functions [1]: [partial_avg(qoh#45)]

(37) CometExchange
Input [3]: [i_product_name#38, sum#46, count#47]
Arguments: hashpartitioning(i_product_name#38, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=4]

(38) CometHashAggregate
Input [3]: [i_product_name#38, sum#46, count#47]
Keys [1]: [i_product_name#38]
Functions [1]: [avg(qoh#45)]

(39) ReusedExchange [Reuses operator id: 20]
Output [6]: [i_product_name#48, i_brand#49, i_class#50, i_category#51, sum#52, count#53]

(40) CometHashAggregate
Input [6]: [i_product_name#48, i_brand#49, i_class#50, i_category#51, sum#52, count#53]
Keys [4]: [i_product_name#48, i_brand#49, i_class#50, i_category#51]
Functions [1]: [avg(inv_quantity_on_hand#54)]

(41) CometHashAggregate
Input [1]: [qoh#55]
Keys: []
Functions [1]: [partial_avg(qoh#55)]

(42) CometExchange
Input [2]: [sum#56, count#57]
Arguments: SinglePartition, ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=5]

(43) CometHashAggregate
Input [2]: [sum#56, count#57]
Keys: []
Functions [1]: [avg(qoh#55)]

(44) CometUnion
Child 0 Input [5]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#58]
Child 1 Input [5]: [i_product_name#18, i_brand#19, i_class#20, i_category#59, qoh#60]
Child 2 Input [5]: [i_product_name#28, i_brand#29, i_class#61, i_category#62, qoh#63]
Child 3 Input [5]: [i_product_name#38, i_brand#64, i_class#65, i_category#66, qoh#67]
Child 4 Input [5]: [i_product_name#68, i_brand#69, i_class#70, i_category#71, qoh#72]

(45) CometTakeOrderedAndProject
Input [5]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#58]
Arguments: TakeOrderedAndProject(limit=100, orderBy=[qoh#58 ASC NULLS FIRST,i_product_name#11 ASC NULLS FIRST,i_brand#8 ASC NULLS FIRST,i_class#9 ASC NULLS FIRST,i_category#10 ASC NULLS FIRST], output=[i_product_name#11,i_brand#8,i_class#9,i_category#10,qoh#58]), [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#58], 100, [qoh#58 ASC NULLS FIRST, i_product_name#11 ASC NULLS FIRST, i_brand#8 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#58]

(46) ColumnarToRow [codegen id : 1]
Input [5]: [i_product_name#11, i_brand#8, i_class#9, i_category#10, qoh#58]

