TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_county]
  WholeStageCodegen (11)
    Project [total_sum,s_state,s_county,lochierarchy,rank_within_parent]
      InputAdapter
        Window [_w0,_w1,_w2]
          WholeStageCodegen (10)
            Sort [_w1,_w2,_w0]
              InputAdapter
                Exchange [_w1,_w2] #1
                  WholeStageCodegen (9)
                    HashAggregate [s_state,s_county,spark_grouping_id,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,lochierarchy,_w0,_w1,_w2,sum]
                      InputAdapter
                        Exchange [s_state,s_county,spark_grouping_id] #2
                          WholeStageCodegen (8)
                            HashAggregate [s_state,s_county,spark_grouping_id,ss_net_profit] [sum,sum]
                              Expand [ss_net_profit,s_state,s_county]
                                Project [ss_net_profit,s_state,s_county]
                                  BroadcastHashJoin [ss_store_sk,s_store_sk]
                                    Project [ss_store_sk,ss_net_profit]
                                      BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
                                        Filter [ss_store_sk]
                                          ColumnarToRow
                                            InputAdapter
                                              Scan parquet spark_catalog.default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk]
                                                SubqueryBroadcast [d_date_sk] #1
                                                  BroadcastExchange #3
                                                    WholeStageCodegen (1)
                                                      Project [d_date_sk]
                                                        Filter [d_month_seq,d_date_sk]
                                                          ColumnarToRow
                                                            InputAdapter
                                                              Scan parquet spark_catalog.default.date_dim [d_date_sk,d_month_seq]
                                        InputAdapter
                                          ReusedExchange [d_date_sk] #3
                                    InputAdapter
                                      BroadcastExchange #4
                                        WholeStageCodegen (7)
                                          BroadcastHashJoin [s_state,s_state]
                                            Filter [s_store_sk]
                                              ColumnarToRow
                                                InputAdapter
                                                  Scan parquet spark_catalog.default.store [s_store_sk,s_county,s_state]
                                            InputAdapter
                                              BroadcastExchange #5
                                                WholeStageCodegen (6)
                                                  Project [s_state]
                                                    Filter [ranking]
                                                      InputAdapter
                                                        Window [_w0,s_state]
                                                          WindowGroupLimit [s_state,_w0]
                                                            WholeStageCodegen (5)
                                                              Sort [s_state,_w0]
                                                                HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),_w0,sum]
                                                                  InputAdapter
                                                                    Exchange [s_state] #6
                                                                      WholeStageCodegen (4)
                                                                        HashAggregate [s_state,ss_net_profit] [sum,sum]
                                                                          Project [ss_net_profit,s_state]
                                                                            BroadcastHashJoin [ss_store_sk,s_store_sk]
                                                                              Project [ss_store_sk,ss_net_profit]
                                                                                BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
                                                                                  Filter [ss_store_sk]
                                                                                    ColumnarToRow
                                                                                      InputAdapter
                                                                                        Scan parquet spark_catalog.default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk]
                                                                                          ReusedSubquery [d_date_sk] #1
                                                                                  InputAdapter
                                                                                    ReusedExchange [d_date_sk] #3
                                                                              InputAdapter
                                                                                BroadcastExchange #7
                                                                                  WholeStageCodegen (3)
                                                                                    Filter [s_store_sk]
                                                                                      ColumnarToRow
                                                                                        InputAdapter
                                                                                          Scan parquet spark_catalog.default.store [s_store_sk,s_state]
