WholeStageCodegen (12)
  HashAggregate [sum,isEmpty] [sum(sales),sum(sales),sum,isEmpty]
    InputAdapter
      Exchange #1
        WholeStageCodegen (11)
          HashAggregate [sales] [sum,isEmpty,sum,isEmpty]
            InputAdapter
              Union
                WholeStageCodegen (5)
                  Project [cs_quantity,cs_list_price]
                    BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
                      Project [cs_quantity,cs_list_price,cs_sold_date_sk]
                        SortMergeJoin [cs_bill_customer_sk,c_customer_sk]
                          InputAdapter
                            WholeStageCodegen (1)
                              ColumnarToRow
                                InputAdapter
                                  CometSort [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
                                    CometExchange [cs_bill_customer_sk] #2
                                      CometProject [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
                                        CometBroadcastHashJoin [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk,item_sk]
                                          CometNativeScan: `spark_catalog`.`default`.`catalog_sales` [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
                                          CometBroadcastExchange [item_sk] #3
                                            CometProject [item_sk]
                                              CometFilter [item_sk,cnt]
                                                CometHashAggregate [item_sk,cnt,_groupingexpression,i_item_sk,d_date,count,count(1)]
                                                  CometExchange [_groupingexpression,i_item_sk,d_date] #4
                                                    CometHashAggregate [_groupingexpression,i_item_sk,d_date,count]
                                                      CometProject [i_item_desc] [d_date,i_item_sk,_groupingexpression]
                                                        CometBroadcastHashJoin [ss_item_sk,d_date,i_item_sk,i_item_desc]
                                                          CometProject [ss_item_sk,d_date]
                                                            CometBroadcastHashJoin [ss_item_sk,ss_sold_date_sk,d_date_sk,d_date]
                                                              CometFilter [ss_item_sk,ss_sold_date_sk]
                                                                CometNativeScan: `spark_catalog`.`default`.`store_sales` [ss_item_sk,ss_sold_date_sk]
                                                              CometBroadcastExchange [d_date_sk,d_date] #5
                                                                CometProject [d_date_sk,d_date]
                                                                  CometFilter [d_date_sk,d_date,d_year]
                                                                    CometNativeScan: `spark_catalog`.`default`.`date_dim` [d_date_sk,d_date,d_year]
                                                          CometBroadcastExchange [i_item_sk,i_item_desc] #6
                                                            CometFilter [i_item_sk,i_item_desc]
                                                              CometNativeScan: `spark_catalog`.`default`.`item` [i_item_sk,i_item_desc]
                          InputAdapter
                            WholeStageCodegen (3)
                              Sort [c_customer_sk]
                                Project [c_customer_sk]
                                  Filter [ssales]
                                    Subquery #1
                                      WholeStageCodegen (3)
                                        HashAggregate [max] [max(csales),tpcds_cmax,max]
                                          InputAdapter
                                            Exchange #9
                                              WholeStageCodegen (2)
                                                HashAggregate [csales] [max,max]
                                                  HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),csales,sum,isEmpty]
                                                    InputAdapter
                                                      Exchange [c_customer_sk] #10
                                                        WholeStageCodegen (1)
                                                          HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
                                                            ColumnarToRow
                                                              InputAdapter
                                                                CometProject [ss_quantity,ss_sales_price,c_customer_sk]
                                                                  CometBroadcastHashJoin [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk,d_date_sk]
                                                                    CometProject [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk]
                                                                      CometBroadcastHashJoin [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk]
                                                                        CometFilter [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                                          CometNativeScan: `spark_catalog`.`default`.`store_sales` [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                                        ReusedExchange [c_customer_sk] #8
                                                                    CometBroadcastExchange [d_date_sk] #11
                                                                      CometProject [d_date_sk]
                                                                        CometFilter [d_date_sk,d_year]
                                                                          CometNativeScan: `spark_catalog`.`default`.`date_dim` [d_date_sk,d_year]
                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
                                      InputAdapter
                                        Exchange [c_customer_sk] #7
                                          WholeStageCodegen (2)
                                            HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
                                              ColumnarToRow
                                                InputAdapter
                                                  CometProject [ss_quantity,ss_sales_price,c_customer_sk]
                                                    CometBroadcastHashJoin [ss_customer_sk,ss_quantity,ss_sales_price,c_customer_sk]
                                                      CometProject [ss_customer_sk,ss_quantity,ss_sales_price]
                                                        CometFilter [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                          CometNativeScan: `spark_catalog`.`default`.`store_sales` [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                      CometBroadcastExchange [c_customer_sk] #8
                                                        CometFilter [c_customer_sk]
                                                          CometNativeScan: `spark_catalog`.`default`.`customer` [c_customer_sk]
                      InputAdapter
                        BroadcastExchange #12
                          WholeStageCodegen (4)
                            ColumnarToRow
                              InputAdapter
                                CometProject [d_date_sk]
                                  CometFilter [d_date_sk,d_year,d_moy]
                                    CometNativeScan: `spark_catalog`.`default`.`date_dim` [d_date_sk,d_year,d_moy]
                WholeStageCodegen (10)
                  Project [ws_quantity,ws_list_price]
                    BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
                      Project [ws_quantity,ws_list_price,ws_sold_date_sk]
                        SortMergeJoin [ws_bill_customer_sk,c_customer_sk]
                          InputAdapter
                            WholeStageCodegen (6)
                              ColumnarToRow
                                InputAdapter
                                  CometSort [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                    CometExchange [ws_bill_customer_sk] #13
                                      CometProject [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                        CometBroadcastHashJoin [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk,item_sk]
                                          CometNativeScan: `spark_catalog`.`default`.`web_sales` [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                          ReusedExchange [item_sk] #3
                          InputAdapter
                            WholeStageCodegen (8)
                              Sort [c_customer_sk]
                                Project [c_customer_sk]
                                  Filter [ssales]
                                    ReusedSubquery [tpcds_cmax] #1
                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
                                      InputAdapter
                                        ReusedExchange [c_customer_sk,sum,isEmpty] #7
                      InputAdapter
                        ReusedExchange [d_date_sk] #12
