WholeStageCodegen (14)
  Filter [paid]
    Subquery #2
      WholeStageCodegen (20)
        HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count]
          InputAdapter
            Exchange #11
              WholeStageCodegen (19)
                HashAggregate [netpaid] [sum,count,sum,count]
                  HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
                    InputAdapter
                      Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #12
                        WholeStageCodegen (18)
                          HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum]
                            Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
                              SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip]
                                InputAdapter
                                  WholeStageCodegen (15)
                                    Sort [c_birth_country,s_zip]
                                      InputAdapter
                                        Exchange [c_birth_country,s_zip] #13
                                          WholeStageCodegen (14)
                                            Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
                                              SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
                                                InputAdapter
                                                  WholeStageCodegen (11)
                                                    Sort [ss_ticket_number,ss_item_sk]
                                                      InputAdapter
                                                        Exchange [ss_ticket_number,ss_item_sk] #14
                                                          WholeStageCodegen (10)
                                                            Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
                                                              SortMergeJoin [ss_customer_sk,c_customer_sk]
                                                                InputAdapter
                                                                  WholeStageCodegen (7)
                                                                    Sort [ss_customer_sk]
                                                                      InputAdapter
                                                                        Exchange [ss_customer_sk] #15
                                                                          WholeStageCodegen (6)
                                                                            Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id]
                                                                              SortMergeJoin [ss_item_sk,i_item_sk]
                                                                                InputAdapter
                                                                                  WholeStageCodegen (3)
                                                                                    Sort [ss_item_sk]
                                                                                      InputAdapter
                                                                                        Exchange [ss_item_sk] #16
                                                                                          WholeStageCodegen (2)
                                                                                            Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip]
                                                                                              BroadcastHashJoin [ss_store_sk,s_store_sk]
                                                                                                Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid]
                                                                                                  Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk]
                                                                                                    ColumnarToRow
                                                                                                      InputAdapter
                                                                                                        Scan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk]
                                                                                                InputAdapter
                                                                                                  BroadcastExchange #17
                                                                                                    WholeStageCodegen (1)
                                                                                                      Project [s_store_sk,s_store_name,s_state,s_zip]
                                                                                                        Filter [s_market_id,s_store_sk,s_zip]
                                                                                                          ColumnarToRow
                                                                                                            InputAdapter
                                                                                                              Scan parquet spark_catalog.default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip]
                                                                                InputAdapter
                                                                                  WholeStageCodegen (5)
                                                                                    Sort [i_item_sk]
                                                                                      InputAdapter
                                                                                        Exchange [i_item_sk] #18
                                                                                          WholeStageCodegen (4)
                                                                                            Filter [i_item_sk]
                                                                                              ColumnarToRow
                                                                                                InputAdapter
                                                                                                  Scan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
                                                                InputAdapter
                                                                  WholeStageCodegen (9)
                                                                    Sort [c_customer_sk]
                                                                      InputAdapter
                                                                        ReusedExchange [c_customer_sk,c_first_name,c_last_name,c_birth_country] #7
                                                InputAdapter
                                                  WholeStageCodegen (13)
                                                    Sort [sr_ticket_number,sr_item_sk]
                                                      InputAdapter
                                                        ReusedExchange [sr_item_sk,sr_ticket_number] #8
                                InputAdapter
                                  WholeStageCodegen (17)
                                    Sort [ca_country,ca_zip]
                                      InputAdapter
                                        Exchange [ca_country,ca_zip] #19
                                          WholeStageCodegen (16)
                                            Filter [ca_country,ca_zip]
                                              ColumnarToRow
                                                InputAdapter
                                                  Scan parquet spark_catalog.default.customer_address [ca_state,ca_zip,ca_country]
    HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum,isEmpty]
      InputAdapter
        Exchange [c_last_name,c_first_name,s_store_name] #1
          WholeStageCodegen (13)
            HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty]
              HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
                InputAdapter
                  Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #2
                    WholeStageCodegen (12)
                      HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum]
                        Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
                          BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country]
                            Project [ss_store_sk,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
                              SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
                                InputAdapter
                                  WholeStageCodegen (7)
                                    Sort [ss_ticket_number,ss_item_sk]
                                      InputAdapter
                                        Exchange [ss_ticket_number,ss_item_sk] #3
                                          WholeStageCodegen (6)
                                            Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
                                              SortMergeJoin [ss_customer_sk,c_customer_sk]
                                                InputAdapter
                                                  WholeStageCodegen (3)
                                                    Sort [ss_customer_sk]
                                                      InputAdapter
                                                        Exchange [ss_customer_sk] #4
                                                          WholeStageCodegen (2)
                                                            Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id]
                                                              BroadcastHashJoin [ss_item_sk,i_item_sk]
                                                                Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid]
                                                                  Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk]
                                                                    Subquery #1
                                                                      ObjectHashAggregate [buf] [bloom_filter_agg(xxhash64(s_store_sk, 42), 40, 1250, 0, 0),bloomFilter,buf]
                                                                        Exchange #5
                                                                          ObjectHashAggregate [s_store_sk] [buf,buf]
                                                                            WholeStageCodegen (1)
                                                                              Project [s_store_sk]
                                                                                Filter [s_market_id,s_store_sk,s_zip]
                                                                                  ColumnarToRow
                                                                                    InputAdapter
                                                                                      Scan parquet spark_catalog.default.store [s_store_sk,s_market_id,s_zip]
                                                                    ColumnarToRow
                                                                      InputAdapter
                                                                        Scan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk]
                                                                InputAdapter
                                                                  BroadcastExchange #6
                                                                    WholeStageCodegen (1)
                                                                      Filter [i_color,i_item_sk]
                                                                        ColumnarToRow
                                                                          InputAdapter
                                                                            Scan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
                                                InputAdapter
                                                  WholeStageCodegen (5)
                                                    Sort [c_customer_sk]
                                                      InputAdapter
                                                        Exchange [c_customer_sk] #7
                                                          WholeStageCodegen (4)
                                                            Filter [c_customer_sk,c_birth_country]
                                                              ColumnarToRow
                                                                InputAdapter
                                                                  Scan parquet spark_catalog.default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country]
                                InputAdapter
                                  WholeStageCodegen (9)
                                    Sort [sr_ticket_number,sr_item_sk]
                                      InputAdapter
                                        Exchange [sr_ticket_number,sr_item_sk] #8
                                          WholeStageCodegen (8)
                                            Project [sr_item_sk,sr_ticket_number]
                                              Filter [sr_ticket_number,sr_item_sk]
                                                ColumnarToRow
                                                  InputAdapter
                                                    Scan parquet spark_catalog.default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk]
                            InputAdapter
                              BroadcastExchange #9
                                WholeStageCodegen (11)
                                  Project [s_store_sk,s_store_name,s_state,ca_state,ca_country]
                                    BroadcastHashJoin [s_zip,ca_zip]
                                      InputAdapter
                                        BroadcastExchange #10
                                          WholeStageCodegen (10)
                                            Project [s_store_sk,s_store_name,s_state,s_zip]
                                              Filter [s_market_id,s_store_sk,s_zip]
                                                ColumnarToRow
                                                  InputAdapter
                                                    Scan parquet spark_catalog.default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip]
                                      Filter [ca_country,ca_zip]
                                        ColumnarToRow
                                          InputAdapter
                                            Scan parquet spark_catalog.default.customer_address [ca_state,ca_zip,ca_country]
