TakeOrderedAndProject [rnk,best_performing,worst_performing]
  WholeStageCodegen (13)
    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 (5)
                    Sort [rnk]
                      InputAdapter
                        Exchange [rnk] #1
                          WholeStageCodegen (4)
                            Project [item_sk,rnk]
                              Filter [rnk,item_sk]
                                InputAdapter
                                  Window [rank_col]
                                    WindowGroupLimit [rank_col]
                                      WholeStageCodegen (3)
                                        Sort [rank_col]
                                          InputAdapter
                                            Exchange #2
                                              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] #4
                                                                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] #3
                                                            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 (10)
                    Sort [rnk]
                      InputAdapter
                        Exchange [rnk] #5
                          WholeStageCodegen (9)
                            Project [item_sk,rnk]
                              Filter [rnk,item_sk]
                                InputAdapter
                                  Window [rank_col]
                                    WindowGroupLimit [rank_col]
                                      WholeStageCodegen (8)
                                        Sort [rank_col]
                                          InputAdapter
                                            Exchange #6
                                              WindowGroupLimit [rank_col]
                                                WholeStageCodegen (7)
                                                  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] #3
            InputAdapter
              BroadcastExchange #7
                WholeStageCodegen (11)
                  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] #7
