TakeOrderedAndProject [rnk,best_performing,worst_performing]
  WholeStageCodegen (11)
    Project [rnk,i_product_name,i_product_name]
      BroadcastHashJoin [item_sk,i_item_sk]
        Project [rnk,item_sk,i_product_name]
          BroadcastHashJoin [item_sk,i_item_sk]
            Project [item_sk,rnk,item_sk]
              SortMergeJoin [rnk,rnk]
                InputAdapter
                  WholeStageCodegen (4)
                    Sort [rnk]
                      Project [item_sk,rnk]
                        Filter [rnk,item_sk]
                          InputAdapter
                            Window [rank_col]
                              WindowGroupLimit [rank_col]
                                WholeStageCodegen (3)
                                  Sort [rank_col]
                                    InputAdapter
                                      Exchange #1
                                        WindowGroupLimit [rank_col]
                                          WholeStageCodegen (2)
                                            Sort [rank_col]
                                              Filter [rank_col]
                                                Subquery #1
                                                  WholeStageCodegen (2)
                                                    HashAggregate [ss_store_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),rank_col,sum,count]
                                                      InputAdapter
                                                        Exchange [ss_store_sk] #3
                                                          WholeStageCodegen (1)
                                                            HashAggregate [ss_store_sk,ss_net_profit] [sum,count,sum,count]
                                                              Project [ss_store_sk,ss_net_profit]
                                                                Filter [ss_store_sk,ss_addr_sk]
                                                                  ColumnarToRow
                                                                    InputAdapter
                                                                      Scan parquet spark_catalog.default.store_sales [ss_addr_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk]
                                                HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,sum,count]
                                                  InputAdapter
                                                    Exchange [ss_item_sk] #2
                                                      WholeStageCodegen (1)
                                                        HashAggregate [ss_item_sk,ss_net_profit] [sum,count,sum,count]
                                                          Project [ss_item_sk,ss_net_profit]
                                                            Filter [ss_store_sk]
                                                              ColumnarToRow
                                                                InputAdapter
                                                                  Scan parquet spark_catalog.default.store_sales [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk]
                InputAdapter
                  WholeStageCodegen (8)
                    Sort [rnk]
                      Project [item_sk,rnk]
                        Filter [rnk,item_sk]
                          InputAdapter
                            Window [rank_col]
                              WindowGroupLimit [rank_col]
                                WholeStageCodegen (7)
                                  Sort [rank_col]
                                    InputAdapter
                                      Exchange #4
                                        WindowGroupLimit [rank_col]
                                          WholeStageCodegen (6)
                                            Sort [rank_col]
                                              Filter [rank_col]
                                                ReusedSubquery [rank_col] #1
                                                HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,sum,count]
                                                  InputAdapter
                                                    ReusedExchange [ss_item_sk,sum,count] #2
            InputAdapter
              BroadcastExchange #5
                WholeStageCodegen (9)
                  Filter [i_item_sk]
                    ColumnarToRow
                      InputAdapter
                        Scan parquet spark_catalog.default.item [i_item_sk,i_product_name]
        InputAdapter
          ReusedExchange [i_item_sk,i_product_name] #5
