TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,rk]
  WholeStageCodegen (29)
    Filter [rk]
      InputAdapter
        Window [sumsales,i_category]
          WindowGroupLimit [i_category,sumsales]
            WholeStageCodegen (28)
              CometColumnarToRow
                InputAdapter
                  CometSort [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales]
                    CometColumnarExchange [i_category] #1
                      WindowGroupLimit [i_category,sumsales]
                        WholeStageCodegen (27)
                          Sort [i_category,sumsales]
                            InputAdapter
                              Union
                                WholeStageCodegen (2)
                                  HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] #2
                                          WholeStageCodegen (1)
                                            HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,ss_sales_price,ss_quantity] [sum,isEmpty,sum,isEmpty]
                                              CometColumnarToRow
                                                InputAdapter
                                                  CometProject [ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id,i_brand,i_class,i_category,i_product_name]
                                                    CometBroadcastHashJoin [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id,i_item_sk,i_brand,i_class,i_category,i_product_name]
                                                      CometProject [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id]
                                                        CometBroadcastHashJoin [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_sk,s_store_id]
                                                          CometProject [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy]
                                                            CometBroadcastHashJoin [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk,d_date_sk,d_year,d_moy,d_qoy]
                                                              CometFilter [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                                CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                                  SubqueryBroadcast [d_date_sk] #1
                                                                    BroadcastExchange #3
                                                                      WholeStageCodegen (1)
                                                                        CometColumnarToRow
                                                                          InputAdapter
                                                                            CometProject [d_date_sk,d_year,d_moy,d_qoy]
                                                                              CometFilter [d_date_sk,d_month_seq,d_year,d_moy,d_qoy]
                                                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy]
                                                              CometBroadcastExchange [d_date_sk,d_year,d_moy,d_qoy] #4
                                                                CometProject [d_date_sk,d_year,d_moy,d_qoy]
                                                                  CometFilter [d_date_sk,d_month_seq,d_year,d_moy,d_qoy]
                                                                    CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy]
                                                          CometBroadcastExchange [s_store_sk,s_store_id] #5
                                                            CometFilter [s_store_sk,s_store_id]
                                                              CometScan parquet spark_catalog.default.store [s_store_sk,s_store_id]
                                                      CometBroadcastExchange [i_item_sk,i_brand,i_class,i_category,i_product_name] #6
                                                        CometFilter [i_item_sk,i_brand,i_class,i_category,i_product_name]
                                                          CometScan parquet spark_catalog.default.item [i_item_sk,i_brand,i_class,i_category,i_product_name]
                                WholeStageCodegen (5)
                                  HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sum,isEmpty] [sum(sumsales),s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy] #7
                                          WholeStageCodegen (4)
                                            HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (8)
                                  HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sum,isEmpty] [sum(sumsales),d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy] #8
                                          WholeStageCodegen (7)
                                            HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (11)
                                  HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sum,isEmpty] [sum(sumsales),d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand,i_product_name,d_year] #9
                                          WholeStageCodegen (10)
                                            HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (14)
                                  HashAggregate [i_category,i_class,i_brand,i_product_name,sum,isEmpty] [sum(sumsales),d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand,i_product_name] #10
                                          WholeStageCodegen (13)
                                            HashAggregate [i_category,i_class,i_brand,i_product_name,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (17)
                                  HashAggregate [i_category,i_class,i_brand,sum,isEmpty] [sum(sumsales),i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class,i_brand] #11
                                          WholeStageCodegen (16)
                                            HashAggregate [i_category,i_class,i_brand,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (20)
                                  HashAggregate [i_category,i_class,sum,isEmpty] [sum(sumsales),i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category,i_class] #12
                                          WholeStageCodegen (19)
                                            HashAggregate [i_category,i_class,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (23)
                                  HashAggregate [i_category,sum,isEmpty] [sum(sumsales),i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange [i_category] #13
                                          WholeStageCodegen (22)
                                            HashAggregate [i_category,sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
                                WholeStageCodegen (26)
                                  HashAggregate [sum,isEmpty] [sum(sumsales),i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty]
                                    CometColumnarToRow
                                      InputAdapter
                                        CometColumnarExchange #14
                                          WholeStageCodegen (25)
                                            HashAggregate [sumsales] [sum,isEmpty,sum,isEmpty]
                                              HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce((ss_sales_price * cast(ss_quantity as decimal(10,0))), 0.00)),sumsales,sum,isEmpty]
                                                CometColumnarToRow
                                                  InputAdapter
                                                    ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #2
