WholeStageCodegen (1)
  ColumnarToRow
    InputAdapter
      CometTakeOrderedAndProject [c_last_name,c_first_name,sales]
        CometUnion [c_last_name,c_first_name,sales]
          CometHashAggregate [c_last_name,c_first_name,sales,sum,isEmpty,sum((cast(cs_quantity as decimal(10,0)) * cs_list_price))]
            CometExchange [c_last_name,c_first_name] #1
              CometHashAggregate [c_last_name,c_first_name,sum,isEmpty,cs_quantity,cs_list_price]
                CometProject [cs_quantity,cs_list_price,c_first_name,c_last_name]
                  CometBroadcastHashJoin [cs_quantity,cs_list_price,cs_sold_date_sk,c_first_name,c_last_name,d_date_sk]
                    CometProject [cs_quantity,cs_list_price,cs_sold_date_sk,c_first_name,c_last_name]
                      CometBroadcastHashJoin [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk,c_customer_sk,c_first_name,c_last_name]
                        CometSortMergeJoin [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk,c_customer_sk]
                          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]
                                  CometFilter [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
                                    CometScan parquet 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]
                                                        CometScan parquet 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]
                                                            CometScan parquet 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]
                                                      CometScan parquet spark_catalog.default.item [i_item_sk,i_item_desc]
                          CometSort [c_customer_sk]
                            CometProject [c_customer_sk]
                              CometFilter [c_customer_sk,ssales]
                                Subquery #1
                                  WholeStageCodegen (1)
                                    ColumnarToRow
                                      InputAdapter
                                        CometHashAggregate [tpcds_cmax,max,max(csales)]
                                          CometExchange #9
                                            CometHashAggregate [max,csales]
                                              CometHashAggregate [csales,c_customer_sk,sum,isEmpty,sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price))]
                                                CometExchange [c_customer_sk] #10
                                                  CometHashAggregate [c_customer_sk,sum,isEmpty,ss_quantity,ss_sales_price]
                                                    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]
                                                              CometScan parquet 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]
                                                              CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
                                CometHashAggregate [c_customer_sk,ssales,sum,isEmpty,sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price))]
                                  CometExchange [c_customer_sk] #7
                                    CometHashAggregate [c_customer_sk,sum,isEmpty,ss_quantity,ss_sales_price]
                                      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]
                                              CometScan parquet 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]
                                              CometScan parquet spark_catalog.default.customer [c_customer_sk]
                        CometBroadcastExchange [c_customer_sk,c_first_name,c_last_name] #12
                          CometSortMergeJoin [c_customer_sk,c_first_name,c_last_name,c_customer_sk]
                            CometSort [c_customer_sk,c_first_name,c_last_name]
                              CometExchange [c_customer_sk] #13
                                CometFilter [c_customer_sk,c_first_name,c_last_name]
                                  CometScan parquet spark_catalog.default.customer [c_customer_sk,c_first_name,c_last_name]
                            CometSort [c_customer_sk]
                              CometProject [c_customer_sk]
                                CometFilter [c_customer_sk,ssales]
                                  ReusedSubquery [tpcds_cmax] #1
                                  CometHashAggregate [c_customer_sk,ssales,sum,isEmpty,sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price))]
                                    ReusedExchange [c_customer_sk,sum,isEmpty] #7
                    CometBroadcastExchange [d_date_sk] #14
                      CometProject [d_date_sk]
                        CometFilter [d_date_sk,d_year,d_moy]
                          CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
          CometHashAggregate [c_last_name,c_first_name,sales,sum,isEmpty,sum((cast(ws_quantity as decimal(10,0)) * ws_list_price))]
            CometExchange [c_last_name,c_first_name] #15
              CometHashAggregate [c_last_name,c_first_name,sum,isEmpty,ws_quantity,ws_list_price]
                CometProject [ws_quantity,ws_list_price,c_first_name,c_last_name]
                  CometBroadcastHashJoin [ws_quantity,ws_list_price,ws_sold_date_sk,c_first_name,c_last_name,d_date_sk]
                    CometProject [ws_quantity,ws_list_price,ws_sold_date_sk,c_first_name,c_last_name]
                      CometBroadcastHashJoin [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk,c_customer_sk,c_first_name,c_last_name]
                        CometSortMergeJoin [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk,c_customer_sk]
                          CometSort [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                            CometExchange [ws_bill_customer_sk] #16
                              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]
                                  CometFilter [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
                                    CometScan parquet 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
                          CometSort [c_customer_sk]
                            CometProject [c_customer_sk]
                              CometFilter [c_customer_sk,ssales]
                                ReusedSubquery [tpcds_cmax] #1
                                CometHashAggregate [c_customer_sk,ssales,sum,isEmpty,sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price))]
                                  ReusedExchange [c_customer_sk,sum,isEmpty] #7
                        ReusedExchange [c_customer_sk,c_first_name,c_last_name] #12
                    ReusedExchange [d_date_sk] #14
