WholeStageCodegen (36)
  HashAggregate [sum,isEmpty] [sum(sales),sum(sales),sum,isEmpty]
    InputAdapter
      Exchange #1
        WholeStageCodegen (35)
          HashAggregate [sales] [sum,isEmpty,sum,isEmpty]
            InputAdapter
              Union
                WholeStageCodegen (17)
                  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 (10)
                              Sort [cs_bill_customer_sk]
                                InputAdapter
                                  Exchange [cs_bill_customer_sk] #2
                                    WholeStageCodegen (9)
                                      Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
                                        SortMergeJoin [cs_item_sk,item_sk]
                                          InputAdapter
                                            WholeStageCodegen (2)
                                              Sort [cs_item_sk]
                                                InputAdapter
                                                  Exchange [cs_item_sk] #3
                                                    WholeStageCodegen (1)
                                                      ColumnarToRow
                                                        InputAdapter
                                                          Scan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_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]
                                          InputAdapter
                                            WholeStageCodegen (8)
                                              Sort [item_sk]
                                                Project [item_sk]
                                                  Filter [cnt]
                                                    HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,cnt,count]
                                                      HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count]
                                                        Project [d_date,i_item_sk,i_item_desc]
                                                          SortMergeJoin [ss_item_sk,i_item_sk]
                                                            InputAdapter
                                                              WholeStageCodegen (5)
                                                                Sort [ss_item_sk]
                                                                  InputAdapter
                                                                    Exchange [ss_item_sk] #5
                                                                      WholeStageCodegen (4)
                                                                        Project [ss_item_sk,d_date]
                                                                          BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
                                                                            Filter [ss_item_sk]
                                                                              ColumnarToRow
                                                                                InputAdapter
                                                                                  Scan parquet spark_catalog.default.store_sales [ss_item_sk,ss_sold_date_sk]
                                                                                    SubqueryBroadcast [d_date_sk] #2
                                                                                      BroadcastExchange #6
                                                                                        WholeStageCodegen (1)
                                                                                          Project [d_date_sk,d_date]
                                                                                            Filter [d_year,d_date_sk]
                                                                                              ColumnarToRow
                                                                                                InputAdapter
                                                                                                  Scan parquet spark_catalog.default.date_dim [d_date_sk,d_date,d_year]
                                                                            InputAdapter
                                                                              ReusedExchange [d_date_sk,d_date] #6
                                                            InputAdapter
                                                              WholeStageCodegen (7)
                                                                Sort [i_item_sk]
                                                                  InputAdapter
                                                                    Exchange [i_item_sk] #7
                                                                      WholeStageCodegen (6)
                                                                        Filter [i_item_sk]
                                                                          ColumnarToRow
                                                                            InputAdapter
                                                                              Scan parquet spark_catalog.default.item [i_item_sk,i_item_desc]
                          InputAdapter
                            WholeStageCodegen (15)
                              Sort [c_customer_sk]
                                Project [c_customer_sk]
                                  Filter [ssales]
                                    Subquery #3
                                      WholeStageCodegen (7)
                                        HashAggregate [max] [max(csales),tpcds_cmax,max]
                                          InputAdapter
                                            Exchange #10
                                              WholeStageCodegen (6)
                                                HashAggregate [csales] [max,max]
                                                  HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),csales,sum,isEmpty]
                                                    HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
                                                      Project [ss_quantity,ss_sales_price,c_customer_sk]
                                                        SortMergeJoin [ss_customer_sk,c_customer_sk]
                                                          InputAdapter
                                                            WholeStageCodegen (3)
                                                              Sort [ss_customer_sk]
                                                                InputAdapter
                                                                  Exchange [ss_customer_sk] #11
                                                                    WholeStageCodegen (2)
                                                                      Project [ss_customer_sk,ss_quantity,ss_sales_price]
                                                                        BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
                                                                          Filter [ss_customer_sk]
                                                                            ColumnarToRow
                                                                              InputAdapter
                                                                                Scan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                                                                  SubqueryBroadcast [d_date_sk] #4
                                                                                    BroadcastExchange #12
                                                                                      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] #12
                                                          InputAdapter
                                                            WholeStageCodegen (5)
                                                              Sort [c_customer_sk]
                                                                InputAdapter
                                                                  ReusedExchange [c_customer_sk] #9
                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
                                      HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
                                        Project [ss_quantity,ss_sales_price,c_customer_sk]
                                          SortMergeJoin [ss_customer_sk,c_customer_sk]
                                            InputAdapter
                                              WholeStageCodegen (12)
                                                Sort [ss_customer_sk]
                                                  InputAdapter
                                                    Exchange [ss_customer_sk] #8
                                                      WholeStageCodegen (11)
                                                        Project [ss_customer_sk,ss_quantity,ss_sales_price]
                                                          Filter [ss_customer_sk]
                                                            ColumnarToRow
                                                              InputAdapter
                                                                Scan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
                                            InputAdapter
                                              WholeStageCodegen (14)
                                                Sort [c_customer_sk]
                                                  InputAdapter
                                                    Exchange [c_customer_sk] #9
                                                      WholeStageCodegen (13)
                                                        Filter [c_customer_sk]
                                                          ColumnarToRow
                                                            InputAdapter
                                                              Scan parquet spark_catalog.default.customer [c_customer_sk]
                      InputAdapter
                        ReusedExchange [d_date_sk] #4
                WholeStageCodegen (34)
                  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 (27)
                              Sort [ws_bill_customer_sk]
                                InputAdapter
                                  Exchange [ws_bill_customer_sk] #13
                                    WholeStageCodegen (26)
                                      Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                        SortMergeJoin [ws_item_sk,item_sk]
                                          InputAdapter
                                            WholeStageCodegen (19)
                                              Sort [ws_item_sk]
                                                InputAdapter
                                                  Exchange [ws_item_sk] #14
                                                    WholeStageCodegen (18)
                                                      ColumnarToRow
                                                        InputAdapter
                                                          Scan parquet spark_catalog.default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                                            ReusedSubquery [d_date_sk] #1
                                          InputAdapter
                                            WholeStageCodegen (25)
                                              Sort [item_sk]
                                                Project [item_sk]
                                                  Filter [cnt]
                                                    HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,cnt,count]
                                                      HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count]
                                                        Project [d_date,i_item_sk,i_item_desc]
                                                          SortMergeJoin [ss_item_sk,i_item_sk]
                                                            InputAdapter
                                                              WholeStageCodegen (22)
                                                                Sort [ss_item_sk]
                                                                  InputAdapter
                                                                    ReusedExchange [ss_item_sk,d_date] #5
                                                            InputAdapter
                                                              WholeStageCodegen (24)
                                                                Sort [i_item_sk]
                                                                  InputAdapter
                                                                    ReusedExchange [i_item_sk,i_item_desc] #7
                          InputAdapter
                            WholeStageCodegen (32)
                              Sort [c_customer_sk]
                                Project [c_customer_sk]
                                  Filter [ssales]
                                    ReusedSubquery [tpcds_cmax] #3
                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
                                      HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
                                        Project [ss_quantity,ss_sales_price,c_customer_sk]
                                          SortMergeJoin [ss_customer_sk,c_customer_sk]
                                            InputAdapter
                                              WholeStageCodegen (29)
                                                Sort [ss_customer_sk]
                                                  InputAdapter
                                                    ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8
                                            InputAdapter
                                              WholeStageCodegen (31)
                                                Sort [c_customer_sk]
                                                  InputAdapter
                                                    ReusedExchange [c_customer_sk] #9
                      InputAdapter
                        ReusedExchange [d_date_sk] #4
