TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio]
  WholeStageCodegen (22)
    HashAggregate [channel,item,return_ratio,return_rank,currency_rank]
      HashAggregate [channel,item,return_ratio,return_rank,currency_rank]
        InputAdapter
          Union
            WholeStageCodegen (7)
              Project [item,return_ratio,return_rank,currency_rank]
                Filter [return_rank,currency_rank]
                  InputAdapter
                    Window [currency_ratio]
                      WholeStageCodegen (6)
                        Sort [currency_ratio]
                          InputAdapter
                            Window [return_ratio]
                              WholeStageCodegen (5)
                                Sort [return_ratio]
                                  InputAdapter
                                    Exchange #1
                                      WholeStageCodegen (4)
                                        HashAggregate [ws_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(wr_return_quantity, 0)),sum(coalesce(ws_quantity, 0)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ws_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty]
                                          InputAdapter
                                            Exchange [ws_item_sk] #2
                                              WholeStageCodegen (3)
                                                HashAggregate [ws_item_sk,wr_return_quantity,ws_quantity,wr_return_amt,ws_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty]
                                                  Project [ws_item_sk,ws_quantity,ws_net_paid,wr_return_quantity,wr_return_amt]
                                                    BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
                                                      Project [ws_item_sk,ws_quantity,ws_net_paid,ws_sold_date_sk,wr_return_quantity,wr_return_amt]
                                                        BroadcastHashJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk]
                                                          InputAdapter
                                                            BroadcastExchange #3
                                                              WholeStageCodegen (1)
                                                                Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_sold_date_sk]
                                                                  Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk]
                                                                    ColumnarToRow
                                                                      InputAdapter
                                                                        Scan parquet spark_catalog.default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit,ws_sold_date_sk]
                                                                          SubqueryBroadcast [d_date_sk] #1
                                                                            BroadcastExchange #4
                                                                              WholeStageCodegen (1)
                                                                                Project [d_date_sk]
                                                                                  Filter [d_year,d_moy,d_date_sk]
                                                                                    ColumnarToRow
                                                                                      InputAdapter
                                                                                        Scan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
                                                          Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt]
                                                            Filter [wr_return_amt,wr_order_number,wr_item_sk]
                                                              ColumnarToRow
                                                                InputAdapter
                                                                  Scan parquet spark_catalog.default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk]
                                                      InputAdapter
                                                        ReusedExchange [d_date_sk] #4
            WholeStageCodegen (14)
              Project [item,return_ratio,return_rank,currency_rank]
                Filter [return_rank,currency_rank]
                  InputAdapter
                    Window [currency_ratio]
                      WholeStageCodegen (13)
                        Sort [currency_ratio]
                          InputAdapter
                            Window [return_ratio]
                              WholeStageCodegen (12)
                                Sort [return_ratio]
                                  InputAdapter
                                    Exchange #5
                                      WholeStageCodegen (11)
                                        HashAggregate [cs_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(cr_return_quantity, 0)),sum(coalesce(cs_quantity, 0)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(coalesce(cast(cs_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty]
                                          InputAdapter
                                            Exchange [cs_item_sk] #6
                                              WholeStageCodegen (10)
                                                HashAggregate [cs_item_sk,cr_return_quantity,cs_quantity,cr_return_amount,cs_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty]
                                                  Project [cs_item_sk,cs_quantity,cs_net_paid,cr_return_quantity,cr_return_amount]
                                                    BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
                                                      Project [cs_item_sk,cs_quantity,cs_net_paid,cs_sold_date_sk,cr_return_quantity,cr_return_amount]
                                                        BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk]
                                                          InputAdapter
                                                            BroadcastExchange #7
                                                              WholeStageCodegen (8)
                                                                Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_sold_date_sk]
                                                                  Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk]
                                                                    ColumnarToRow
                                                                      InputAdapter
                                                                        Scan parquet spark_catalog.default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit,cs_sold_date_sk]
                                                                          ReusedSubquery [d_date_sk] #1
                                                          Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount]
                                                            Filter [cr_return_amount,cr_order_number,cr_item_sk]
                                                              ColumnarToRow
                                                                InputAdapter
                                                                  Scan parquet spark_catalog.default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk]
                                                      InputAdapter
                                                        ReusedExchange [d_date_sk] #4
            WholeStageCodegen (21)
              Project [item,return_ratio,return_rank,currency_rank]
                Filter [return_rank,currency_rank]
                  InputAdapter
                    Window [currency_ratio]
                      WholeStageCodegen (20)
                        Sort [currency_ratio]
                          InputAdapter
                            Window [return_ratio]
                              WholeStageCodegen (19)
                                Sort [return_ratio]
                                  InputAdapter
                                    Exchange #8
                                      WholeStageCodegen (18)
                                        HashAggregate [ss_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(sr_return_quantity, 0)),sum(coalesce(ss_quantity, 0)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ss_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty]
                                          InputAdapter
                                            Exchange [ss_item_sk] #9
                                              WholeStageCodegen (17)
                                                HashAggregate [ss_item_sk,sr_return_quantity,ss_quantity,sr_return_amt,ss_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty]
                                                  Project [ss_item_sk,ss_quantity,ss_net_paid,sr_return_quantity,sr_return_amt]
                                                    BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
                                                      Project [ss_item_sk,ss_quantity,ss_net_paid,ss_sold_date_sk,sr_return_quantity,sr_return_amt]
                                                        BroadcastHashJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
                                                          InputAdapter
                                                            BroadcastExchange #10
                                                              WholeStageCodegen (15)
                                                                Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_sold_date_sk]
                                                                  Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk]
                                                                    ColumnarToRow
                                                                      InputAdapter
                                                                        Scan parquet spark_catalog.default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit,ss_sold_date_sk]
                                                                          ReusedSubquery [d_date_sk] #1
                                                          Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt]
                                                            Filter [sr_return_amt,sr_ticket_number,sr_item_sk]
                                                              ColumnarToRow
                                                                InputAdapter
                                                                  Scan parquet spark_catalog.default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk]
                                                      InputAdapter
                                                        ReusedExchange [d_date_sk] #4
