TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return]
  WholeStageCodegen (11)
    Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return]
      BroadcastHashJoin [c_current_addr_sk,ca_address_sk]
        Project [ctr_total_return,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name]
          BroadcastHashJoin [ctr_customer_sk,c_customer_sk]
            Project [ctr_customer_sk,ctr_total_return]
              BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)]
                Filter [ctr_total_return]
                  HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_customer_sk,ctr_state,ctr_total_return,sum]
                    InputAdapter
                      Exchange [cr_returning_customer_sk,ca_state] #1
                        WholeStageCodegen (3)
                          HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum]
                            Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state]
                              BroadcastHashJoin [cr_returning_addr_sk,ca_address_sk]
                                Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax]
                                  BroadcastHashJoin [cr_returned_date_sk,d_date_sk]
                                    Filter [cr_returning_addr_sk,cr_returning_customer_sk]
                                      ColumnarToRow
                                        InputAdapter
                                          Scan parquet spark_catalog.default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk]
                                            SubqueryBroadcast [d_date_sk] #1
                                              BroadcastExchange #2
                                                WholeStageCodegen (1)
                                                  Project [d_date_sk]
                                                    Filter [d_year,d_date_sk]
                                                      ColumnarToRow
                                                        InputAdapter
                                                          Scan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
                                    InputAdapter
                                      ReusedExchange [d_date_sk] #2
                                InputAdapter
                                  BroadcastExchange #3
                                    WholeStageCodegen (2)
                                      Filter [ca_address_sk,ca_state]
                                        ColumnarToRow
                                          InputAdapter
                                            Scan parquet spark_catalog.default.customer_address [ca_address_sk,ca_state]
                InputAdapter
                  BroadcastExchange #4
                    WholeStageCodegen (8)
                      Filter [(avg(ctr_total_return) * 1.2)]
                        HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),sum,count]
                          InputAdapter
                            Exchange [ctr_state] #5
                              WholeStageCodegen (7)
                                HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count]
                                  HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_state,ctr_total_return,sum]
                                    InputAdapter
                                      Exchange [cr_returning_customer_sk,ca_state] #6
                                        WholeStageCodegen (6)
                                          HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum]
                                            Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state]
                                              BroadcastHashJoin [cr_returning_addr_sk,ca_address_sk]
                                                Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax]
                                                  BroadcastHashJoin [cr_returned_date_sk,d_date_sk]
                                                    Filter [cr_returning_addr_sk]
                                                      ColumnarToRow
                                                        InputAdapter
                                                          Scan parquet spark_catalog.default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk]
                                                            ReusedSubquery [d_date_sk] #1
                                                    InputAdapter
                                                      ReusedExchange [d_date_sk] #2
                                                InputAdapter
                                                  ReusedExchange [ca_address_sk,ca_state] #3
            InputAdapter
              BroadcastExchange #7
                WholeStageCodegen (9)
                  Filter [c_customer_sk,c_current_addr_sk]
                    ColumnarToRow
                      InputAdapter
                        Scan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name]
        InputAdapter
          BroadcastExchange #8
            WholeStageCodegen (10)
              Filter [ca_state,ca_address_sk]
                ColumnarToRow
                  InputAdapter
                    Scan parquet spark_catalog.default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type]
