== Physical Plan ==
TakeOrderedAndProject (22)
+- * Project (21)
   +- Window (20)
      +- * ColumnarToRow (19)
         +- CometSort (18)
            +- CometExchange (17)
               +- CometHashAggregate (16)
                  +- CometExchange (15)
                     +- CometHashAggregate (14)
                        +- CometProject (13)
                           +- CometBroadcastHashJoin (12)
                              :- CometProject (7)
                              :  +- CometBroadcastHashJoin (6)
                              :     :- CometFilter (2)
                              :     :  +- CometNativeScan: `spark_catalog`.`default`.`web_sales` (1)
                              :     +- CometBroadcastExchange (5)
                              :        +- CometFilter (4)
                              :           +- CometNativeScan: `spark_catalog`.`default`.`item` (3)
                              +- CometBroadcastExchange (11)
                                 +- CometProject (10)
                                    +- CometFilter (9)
                                       +- CometNativeScan: `spark_catalog`.`default`.`date_dim` (8)


(1) CometNativeScan: `spark_catalog`.`default`.`web_sales`
Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
Arguments: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]

(2) CometFilter
Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
Condition : isnotnull(ws_item_sk#1)

(3) CometNativeScan: `spark_catalog`.`default`.`item`
Output [6]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Arguments: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]

(4) CometFilter
Input [6]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Condition : (i_category#9 IN (Sports                                            ,Books                                             ,Home                                              ) AND isnotnull(i_item_sk#4))

(5) CometBroadcastExchange
Input [6]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Arguments: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]

(6) CometBroadcastHashJoin
Left output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
Right output [6]: [i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Arguments: [ws_item_sk#1], [i_item_sk#4], Inner, BuildRight

(7) CometProject
Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#4, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Arguments: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9], [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]

(8) CometNativeScan: `spark_catalog`.`default`.`date_dim`
Output [2]: [d_date_sk#10, d_date#11]
Arguments: [d_date_sk#10, d_date#11]

(9) CometFilter
Input [2]: [d_date_sk#10, d_date#11]
Condition : (((isnotnull(d_date#11) AND (d_date#11 >= 1999-02-22)) AND (d_date#11 <= 1999-03-24)) AND isnotnull(d_date_sk#10))

(10) CometProject
Input [2]: [d_date_sk#10, d_date#11]
Arguments: [d_date_sk#10], [d_date_sk#10]

(11) CometBroadcastExchange
Input [1]: [d_date_sk#10]
Arguments: [d_date_sk#10]

(12) CometBroadcastHashJoin
Left output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Right output [1]: [d_date_sk#10]
Arguments: [ws_sold_date_sk#3], [d_date_sk#10], Inner, BuildRight

(13) CometProject
Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9, d_date_sk#10]
Arguments: [ws_ext_sales_price#2, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9], [ws_ext_sales_price#2, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]

(14) CometHashAggregate
Input [6]: [ws_ext_sales_price#2, i_item_id#5, i_item_desc#6, i_current_price#7, i_class#8, i_category#9]
Keys [5]: [i_item_id#5, i_item_desc#6, i_category#9, i_class#8, i_current_price#7]
Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))]

(15) CometExchange
Input [6]: [i_item_id#5, i_item_desc#6, i_category#9, i_class#8, i_current_price#7, sum#12]
Arguments: hashpartitioning(i_item_id#5, i_item_desc#6, i_category#9, i_class#8, i_current_price#7, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]

(16) CometHashAggregate
Input [6]: [i_item_id#5, i_item_desc#6, i_category#9, i_class#8, i_current_price#7, sum#12]
Keys [5]: [i_item_id#5, i_item_desc#6, i_category#9, i_class#8, i_current_price#7]
Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))]

(17) CometExchange
Input [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5]
Arguments: hashpartitioning(i_class#8, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]

(18) CometSort
Input [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5]
Arguments: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5], [i_class#8 ASC NULLS FIRST]

(19) ColumnarToRow [codegen id : 1]
Input [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5]

(20) Window
Input [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5]
Arguments: [sum(_w0#14) windowspecdefinition(i_class#8, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#15], [i_class#8]

(21) Project [codegen id : 2]
Output [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, ((_w0#14 * 100) / _we0#15) AS revenueratio#16, i_item_id#5]
Input [8]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, _w0#14, i_item_id#5, _we0#15]

(22) TakeOrderedAndProject
Input [7]: [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, revenueratio#16, i_item_id#5]
Arguments: 100, [i_category#9 ASC NULLS FIRST, i_class#8 ASC NULLS FIRST, i_item_id#5 ASC NULLS FIRST, i_item_desc#6 ASC NULLS FIRST, revenueratio#16 ASC NULLS FIRST], [i_item_desc#6, i_category#9, i_class#8, i_current_price#7, itemrevenue#13, revenueratio#16]

