diff --git a/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_out.json b/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_out.json new file mode 100644 index 0000000000000..c6dfc0b27538b --- /dev/null +++ b/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_out.json @@ -0,0 +1,167 @@ +[ + { + "Name": "TestTPCDSQ64", + "Cases": [ + { + "SQL": "explain format='plan_tree' with cs_ui as (select cs_item_sk,sum(cs_ext_list_price) as sale,sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) as refund from catalog_sales,catalog_returns where cs_item_sk = cr_item_sk and cs_order_number = cr_order_number group by cs_item_sk having sum(cs_ext_list_price)>2*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)), cross_sales as (select i_product_name product_name,i_item_sk item_sk,s_store_name store_name,s_zip store_zip,ad1.ca_street_number b_street_number,ad1.ca_street_name b_street_name,ad1.ca_city b_city,ad1.ca_zip b_zip,ad2.ca_street_number c_street_number,ad2.ca_street_name c_street_name,ad2.ca_city c_city,ad2.ca_zip c_zip,d1.d_year as syear,d2.d_year as fsyear,d3.d_year s2year,count(*) cnt,sum(ss_wholesale_cost) s1,sum(ss_list_price) s2,sum(ss_coupon_amt) s3 FROM store_sales,store_returns,cs_ui,date_dim d1,date_dim d2,date_dim d3,store,customer,customer_demographics cd1,customer_demographics cd2,promotion,household_demographics hd1,household_demographics hd2,customer_address ad1,customer_address ad2,income_band ib1,income_band ib2,item WHERE ss_store_sk = s_store_sk AND ss_sold_date_sk = d1.d_date_sk AND ss_customer_sk = c_customer_sk AND ss_cdemo_sk= cd1.cd_demo_sk AND ss_hdemo_sk = hd1.hd_demo_sk AND ss_addr_sk = ad1.ca_address_sk and ss_item_sk = i_item_sk and ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number and ss_item_sk = cs_ui.cs_item_sk and c_current_cdemo_sk = cd2.cd_demo_sk AND c_current_hdemo_sk = hd2.hd_demo_sk AND c_current_addr_sk = ad2.ca_address_sk and c_first_sales_date_sk = d2.d_date_sk and c_first_shipto_date_sk = d3.d_date_sk and ss_promo_sk = p_promo_sk and hd1.hd_income_band_sk = ib1.ib_income_band_sk and hd2.hd_income_band_sk = ib2.ib_income_band_sk and cd1.cd_marital_status <> cd2.cd_marital_status and i_color in ('maroon','burnished','dim','steel','navajo','chocolate') and i_current_price between 35 and 35 + 10 and i_current_price between 35 + 1 and 35 + 15 group by i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year) select cs1.product_name,cs1.store_name,cs1.store_zip,cs1.b_street_number,cs1.b_street_name,cs1.b_city,cs1.b_zip,cs1.c_street_number,cs1.c_street_name,cs1.c_city,cs1.c_zip,cs1.syear,cs1.cnt,cs1.s1 as s11,cs1.s2 as s21,cs1.s3 as s31,cs2.s1 as s12,cs2.s2 as s22,cs2.s3 as s32,cs2.syear,cs2.cnt from cross_sales cs1,cross_sales cs2 where cs1.item_sk=cs2.item_sk and cs1.syear = 2000 and cs2.syear = 2000 + 1 and cs2.cnt <= cs1.cnt and cs1.store_name = cs2.store_name and cs1.store_zip = cs2.store_zip order by cs1.product_name,cs1.store_name,cs2.cnt,cs1.s1,cs2.s1;", + "Result": [ + "Sort root tpcds.item.i_product_name, tpcds.store.s_store_name, Column, Column, Column", + "└─Projection root tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, Column, Column, Column, Column, Column, Column, Column, tpcds.date_dim.d_year, Column", + " └─HashJoin root inner join, equal:[eq(tpcds.item.i_item_sk, tpcds.item.i_item_sk) eq(tpcds.store.s_store_name, tpcds.store.s_store_name) eq(tpcds.store.s_zip, tpcds.store.s_zip)], other cond:le(Column, Column)", + " ├─Selection(Build) root eq(tpcds.date_dim.d_year, 2001), not(isnull(Column)), not(isnull(tpcds.item.i_item_sk)), not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " │ └─CTEFullScan root CTE:cross_sales AS cs2 data:CTE_1", + " └─Selection(Probe) root eq(tpcds.date_dim.d_year, 2000), not(isnull(Column)), not(isnull(tpcds.item.i_item_sk)), not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " └─CTEFullScan root CTE:cross_sales AS cs1 data:CTE_1", + "CTE_1 root Non-Recursive CTE", + "└─TableReader(Seed Part) root MppVersion: 3, data:ExchangeSender", + " └─ExchangeSender mpp[tiflash] ExchangeType: PassThrough", + " └─Projection mpp[tiflash] tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, Column, Column, Column, Column", + " └─Projection mpp[tiflash] Column, Column, Column, Column, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.item.i_item_sk, tpcds.item.i_product_name", + " └─HashAgg mpp[tiflash] group by:tpcds.customer_address.ca_city, tpcds.customer_address.ca_city, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.store.s_store_name)->tpcds.store.s_store_name, funcs:firstrow(tpcds.store.s_zip)->tpcds.store.s_zip, funcs:firstrow(tpcds.customer_address.ca_street_number)->tpcds.customer_address.ca_street_number, funcs:firstrow(tpcds.customer_address.ca_street_name)->tpcds.customer_address.ca_street_name, funcs:firstrow(tpcds.customer_address.ca_city)->tpcds.customer_address.ca_city, funcs:firstrow(tpcds.customer_address.ca_zip)->tpcds.customer_address.ca_zip, funcs:firstrow(tpcds.customer_address.ca_street_number)->tpcds.customer_address.ca_street_number, funcs:firstrow(tpcds.customer_address.ca_street_name)->tpcds.customer_address.ca_street_name, funcs:firstrow(tpcds.customer_address.ca_city)->tpcds.customer_address.ca_city, funcs:firstrow(tpcds.customer_address.ca_zip)->tpcds.customer_address.ca_zip, funcs:firstrow(tpcds.item.i_item_sk)->tpcds.item.i_item_sk, funcs:firstrow(tpcds.item.i_product_name)->tpcds.item.i_product_name", + " └─ExchangeReceiver mpp[tiflash] ", + " └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.item.i_product_name, collate: utf8mb4_bin], [name: tpcds.item.i_item_sk, collate: binary], [name: tpcds.store.s_store_name, collate: utf8mb4_bin], [name: tpcds.store.s_zip, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_number, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_name, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_city, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_zip, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_number, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_name, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_city, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_zip, collate: utf8mb4_bin], [name: tpcds.date_dim.d_year, collate: binary], [name: tpcds.date_dim.d_year, collate: binary], [name: tpcds.date_dim.d_year, collate: binary]", + " └─HashAgg mpp[tiflash] group by:tpcds.customer_address.ca_city, tpcds.customer_address.ca_city, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, funcs:count(1)->Column, funcs:sum(tpcds.store_sales.ss_wholesale_cost)->Column, funcs:sum(tpcds.store_sales.ss_list_price)->Column, funcs:sum(tpcds.store_sales.ss_coupon_amt)->Column", + " └─Projection mpp[tiflash] tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.item.i_item_sk, tpcds.item.i_product_name", + " └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip", + " └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.catalog_sales.cs_item_sk)]", + " ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary]", + " │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.income_band.ib_income_band_sk", + " │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.household_demographics.hd_income_band_sk, tpcds.income_band.ib_income_band_sk)]", + " │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_income_band_sk, collate: binary]", + " │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.income_band.ib_income_band_sk", + " │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.household_demographics.hd_income_band_sk, tpcds.income_band.ib_income_band_sk)]", + " │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_income_band_sk, collate: binary]", + " │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_address_sk", + " │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_addr_sk, tpcds.customer_address.ca_address_sk)]", + " │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_addr_sk, collate: binary]", + " │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_address_sk", + " │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_addr_sk, tpcds.customer_address.ca_address_sk)]", + " │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_addr_sk, collate: binary]", + " │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.promotion.p_promo_sk", + " │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_promo_sk, tpcds.promotion.p_promo_sk)]", + " │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_promo_sk, collate: binary]", + " │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_date_sk", + " │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_first_shipto_date_sk, tpcds.date_dim.d_date_sk)]", + " │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_first_shipto_date_sk, collate: binary]", + " │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_date_sk", + " │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_first_sales_date_sk, tpcds.date_dim.d_date_sk)]", + " │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_first_sales_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.store_returns.sr_item_sk, tpcds.store_returns.sr_ticket_number", + " │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.store_returns.sr_item_sk) eq(tpcds.store_sales.ss_ticket_number, tpcds.store_returns.sr_ticket_number)]", + " │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary], [name: tpcds.store_sales.ss_ticket_number, collate: binary]", + " │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_demo_sk", + " │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_hdemo_sk, tpcds.household_demographics.hd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_hdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_hdemo_sk, tpcds.household_demographics.hd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_hdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_demographics.cd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_cdemo_sk, tpcds.customer_demographics.cd_demo_sk)], other cond:ne(tpcds.customer_demographics.cd_marital_status, tpcds.customer_demographics.cd_marital_status)", + " │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_cdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_demographics.cd_marital_status, tpcds.customer_demographics.cd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_cdemo_sk, tpcds.customer_demographics.cd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_cdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.store.s_store_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_store_sk, tpcds.store.s_store_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_store_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.customer.c_customer_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_customer_sk, tpcds.customer.c_customer_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_customer_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_customer_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.item.i_item_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.item.i_item_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] ge(tpcds.item.i_current_price, 35), ge(tpcds.item.i_current_price, 36), le(tpcds.item.i_current_price, 45), le(tpcds.item.i_current_price, 50)", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:item pushed down filter:in(tpcds.item.i_color, \"maroon\", \"burnished\", \"dim\", \"steel\", \"navajo\", \"chocolate\"), keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_customer_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.store_sales.ss_sold_date_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.date_dim.d_date_sk, tpcds.store_sales.ss_sold_date_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d1 pushed down filter:or(eq(tpcds.date_dim.d_year, 2000), eq(tpcds.date_dim.d_year, 2001)), keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_sold_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.store_sales.ss_addr_sk)), not(isnull(tpcds.store_sales.ss_cdemo_sk)), not(isnull(tpcds.store_sales.ss_customer_sk)), not(isnull(tpcds.store_sales.ss_hdemo_sk)), not(isnull(tpcds.store_sales.ss_promo_sk)), not(isnull(tpcds.store_sales.ss_sold_date_sk)), not(isnull(tpcds.store_sales.ss_store_sk))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store_sales keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_customer_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer.c_current_addr_sk)), not(isnull(tpcds.customer.c_current_cdemo_sk)), not(isnull(tpcds.customer.c_current_hdemo_sk)), not(isnull(tpcds.customer.c_first_sales_date_sk)), not(isnull(tpcds.customer.c_first_shipto_date_sk))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:customer keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store.s_store_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_demographics.cd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer_demographics.cd_marital_status))", + " │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:cd1 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_demographics.cd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer_demographics.cd_marital_status))", + " │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:cd2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.household_demographics.hd_income_band_sk))", + " │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:hd1 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.household_demographics.hd_income_band_sk))", + " │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:hd2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_returns.sr_item_sk, collate: binary], [name: tpcds.store_returns.sr_ticket_number, collate: binary]", + " │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store_returns keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d3 keep order:false, stats:pseudo", + " │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.promotion.p_promo_sk, collate: binary]", + " │ │ │ │ │ └─TableFullScan mpp[tiflash] table:promotion keep order:false, stats:pseudo", + " │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_address.ca_address_sk, collate: binary]", + " │ │ │ │ └─TableFullScan mpp[tiflash] table:ad1 keep order:false, stats:pseudo", + " │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_address.ca_address_sk, collate: binary]", + " │ │ │ └─TableFullScan mpp[tiflash] table:ad2 keep order:false, stats:pseudo", + " │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.income_band.ib_income_band_sk, collate: binary]", + " │ │ └─TableFullScan mpp[tiflash] table:ib1 keep order:false, stats:pseudo", + " │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.income_band.ib_income_band_sk, collate: binary]", + " │ └─TableFullScan mpp[tiflash] table:ib2 keep order:false, stats:pseudo", + " └─Selection(Probe) mpp[tiflash] gt(Column, mul(2, Column))", + " └─Projection mpp[tiflash] Column, Column, tpcds.catalog_sales.cs_item_sk", + " └─HashAgg mpp[tiflash] group by:Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:firstrow(Column)->tpcds.catalog_sales.cs_item_sk", + " └─Projection mpp[tiflash] tpcds.catalog_sales.cs_ext_list_price->Column, plus(plus(tpcds.catalog_returns.cr_refunded_cash, tpcds.catalog_returns.cr_reversed_charge), tpcds.catalog_returns.cr_store_credit)->Column, tpcds.catalog_sales.cs_item_sk->Column", + " └─Projection mpp[tiflash] tpcds.catalog_sales.cs_item_sk, tpcds.catalog_sales.cs_ext_list_price, tpcds.catalog_returns.cr_refunded_cash, tpcds.catalog_returns.cr_reversed_charge, tpcds.catalog_returns.cr_store_credit, tpcds.catalog_returns.cr_item_sk", + " └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.catalog_sales.cs_item_sk, tpcds.catalog_returns.cr_item_sk) eq(tpcds.catalog_sales.cs_order_number, tpcds.catalog_returns.cr_order_number)]", + " ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.catalog_sales.cs_item_sk, collate: binary]", + " │ └─TableFullScan mpp[tiflash] table:catalog_sales keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) mpp[tiflash] ", + " └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.catalog_returns.cr_item_sk, collate: binary]", + " └─TableFullScan mpp[tiflash] table:catalog_returns keep order:false, stats:pseudo" + ] + } + ] + } +] diff --git a/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_xut.json b/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_xut.json new file mode 100644 index 0000000000000..c6dfc0b27538b --- /dev/null +++ b/pkg/planner/core/casetest/tpcds/testdata/tpcds_suite_xut.json @@ -0,0 +1,167 @@ +[ + { + "Name": "TestTPCDSQ64", + "Cases": [ + { + "SQL": "explain format='plan_tree' with cs_ui as (select cs_item_sk,sum(cs_ext_list_price) as sale,sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) as refund from catalog_sales,catalog_returns where cs_item_sk = cr_item_sk and cs_order_number = cr_order_number group by cs_item_sk having sum(cs_ext_list_price)>2*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)), cross_sales as (select i_product_name product_name,i_item_sk item_sk,s_store_name store_name,s_zip store_zip,ad1.ca_street_number b_street_number,ad1.ca_street_name b_street_name,ad1.ca_city b_city,ad1.ca_zip b_zip,ad2.ca_street_number c_street_number,ad2.ca_street_name c_street_name,ad2.ca_city c_city,ad2.ca_zip c_zip,d1.d_year as syear,d2.d_year as fsyear,d3.d_year s2year,count(*) cnt,sum(ss_wholesale_cost) s1,sum(ss_list_price) s2,sum(ss_coupon_amt) s3 FROM store_sales,store_returns,cs_ui,date_dim d1,date_dim d2,date_dim d3,store,customer,customer_demographics cd1,customer_demographics cd2,promotion,household_demographics hd1,household_demographics hd2,customer_address ad1,customer_address ad2,income_band ib1,income_band ib2,item WHERE ss_store_sk = s_store_sk AND ss_sold_date_sk = d1.d_date_sk AND ss_customer_sk = c_customer_sk AND ss_cdemo_sk= cd1.cd_demo_sk AND ss_hdemo_sk = hd1.hd_demo_sk AND ss_addr_sk = ad1.ca_address_sk and ss_item_sk = i_item_sk and ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number and ss_item_sk = cs_ui.cs_item_sk and c_current_cdemo_sk = cd2.cd_demo_sk AND c_current_hdemo_sk = hd2.hd_demo_sk AND c_current_addr_sk = ad2.ca_address_sk and c_first_sales_date_sk = d2.d_date_sk and c_first_shipto_date_sk = d3.d_date_sk and ss_promo_sk = p_promo_sk and hd1.hd_income_band_sk = ib1.ib_income_band_sk and hd2.hd_income_band_sk = ib2.ib_income_band_sk and cd1.cd_marital_status <> cd2.cd_marital_status and i_color in ('maroon','burnished','dim','steel','navajo','chocolate') and i_current_price between 35 and 35 + 10 and i_current_price between 35 + 1 and 35 + 15 group by i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year) select cs1.product_name,cs1.store_name,cs1.store_zip,cs1.b_street_number,cs1.b_street_name,cs1.b_city,cs1.b_zip,cs1.c_street_number,cs1.c_street_name,cs1.c_city,cs1.c_zip,cs1.syear,cs1.cnt,cs1.s1 as s11,cs1.s2 as s21,cs1.s3 as s31,cs2.s1 as s12,cs2.s2 as s22,cs2.s3 as s32,cs2.syear,cs2.cnt from cross_sales cs1,cross_sales cs2 where cs1.item_sk=cs2.item_sk and cs1.syear = 2000 and cs2.syear = 2000 + 1 and cs2.cnt <= cs1.cnt and cs1.store_name = cs2.store_name and cs1.store_zip = cs2.store_zip order by cs1.product_name,cs1.store_name,cs2.cnt,cs1.s1,cs2.s1;", + "Result": [ + "Sort root tpcds.item.i_product_name, tpcds.store.s_store_name, Column, Column, Column", + "└─Projection root tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, Column, Column, Column, Column, Column, Column, Column, tpcds.date_dim.d_year, Column", + " └─HashJoin root inner join, equal:[eq(tpcds.item.i_item_sk, tpcds.item.i_item_sk) eq(tpcds.store.s_store_name, tpcds.store.s_store_name) eq(tpcds.store.s_zip, tpcds.store.s_zip)], other cond:le(Column, Column)", + " ├─Selection(Build) root eq(tpcds.date_dim.d_year, 2001), not(isnull(Column)), not(isnull(tpcds.item.i_item_sk)), not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " │ └─CTEFullScan root CTE:cross_sales AS cs2 data:CTE_1", + " └─Selection(Probe) root eq(tpcds.date_dim.d_year, 2000), not(isnull(Column)), not(isnull(tpcds.item.i_item_sk)), not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " └─CTEFullScan root CTE:cross_sales AS cs1 data:CTE_1", + "CTE_1 root Non-Recursive CTE", + "└─TableReader(Seed Part) root MppVersion: 3, data:ExchangeSender", + " └─ExchangeSender mpp[tiflash] ExchangeType: PassThrough", + " └─Projection mpp[tiflash] tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, Column, Column, Column, Column", + " └─Projection mpp[tiflash] Column, Column, Column, Column, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.item.i_item_sk, tpcds.item.i_product_name", + " └─HashAgg mpp[tiflash] group by:tpcds.customer_address.ca_city, tpcds.customer_address.ca_city, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.date_dim.d_year)->tpcds.date_dim.d_year, funcs:firstrow(tpcds.store.s_store_name)->tpcds.store.s_store_name, funcs:firstrow(tpcds.store.s_zip)->tpcds.store.s_zip, funcs:firstrow(tpcds.customer_address.ca_street_number)->tpcds.customer_address.ca_street_number, funcs:firstrow(tpcds.customer_address.ca_street_name)->tpcds.customer_address.ca_street_name, funcs:firstrow(tpcds.customer_address.ca_city)->tpcds.customer_address.ca_city, funcs:firstrow(tpcds.customer_address.ca_zip)->tpcds.customer_address.ca_zip, funcs:firstrow(tpcds.customer_address.ca_street_number)->tpcds.customer_address.ca_street_number, funcs:firstrow(tpcds.customer_address.ca_street_name)->tpcds.customer_address.ca_street_name, funcs:firstrow(tpcds.customer_address.ca_city)->tpcds.customer_address.ca_city, funcs:firstrow(tpcds.customer_address.ca_zip)->tpcds.customer_address.ca_zip, funcs:firstrow(tpcds.item.i_item_sk)->tpcds.item.i_item_sk, funcs:firstrow(tpcds.item.i_product_name)->tpcds.item.i_product_name", + " └─ExchangeReceiver mpp[tiflash] ", + " └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.item.i_product_name, collate: utf8mb4_bin], [name: tpcds.item.i_item_sk, collate: binary], [name: tpcds.store.s_store_name, collate: utf8mb4_bin], [name: tpcds.store.s_zip, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_number, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_name, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_city, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_zip, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_number, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_street_name, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_city, collate: utf8mb4_bin], [name: tpcds.customer_address.ca_zip, collate: utf8mb4_bin], [name: tpcds.date_dim.d_year, collate: binary], [name: tpcds.date_dim.d_year, collate: binary], [name: tpcds.date_dim.d_year, collate: binary]", + " └─HashAgg mpp[tiflash] group by:tpcds.customer_address.ca_city, tpcds.customer_address.ca_city, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.store.s_store_name, tpcds.store.s_zip, funcs:count(1)->Column, funcs:sum(tpcds.store_sales.ss_wholesale_cost)->Column, funcs:sum(tpcds.store_sales.ss_list_price)->Column, funcs:sum(tpcds.store_sales.ss_coupon_amt)->Column", + " └─Projection mpp[tiflash] tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.item.i_item_sk, tpcds.item.i_product_name", + " └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip", + " └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.catalog_sales.cs_item_sk)]", + " ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary]", + " │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.income_band.ib_income_band_sk", + " │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.household_demographics.hd_income_band_sk, tpcds.income_band.ib_income_band_sk)]", + " │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_income_band_sk, collate: binary]", + " │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.income_band.ib_income_band_sk", + " │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.household_demographics.hd_income_band_sk, tpcds.income_band.ib_income_band_sk)]", + " │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_income_band_sk, collate: binary]", + " │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_address_sk", + " │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_addr_sk, tpcds.customer_address.ca_address_sk)]", + " │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_addr_sk, collate: binary]", + " │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.customer_address.ca_street_number, tpcds.customer_address.ca_street_name, tpcds.customer_address.ca_city, tpcds.customer_address.ca_zip, tpcds.customer_address.ca_address_sk", + " │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_addr_sk, tpcds.customer_address.ca_address_sk)]", + " │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_addr_sk, collate: binary]", + " │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.promotion.p_promo_sk", + " │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_promo_sk, tpcds.promotion.p_promo_sk)]", + " │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_promo_sk, collate: binary]", + " │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_year, tpcds.date_dim.d_date_sk", + " │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_first_shipto_date_sk, tpcds.date_dim.d_date_sk)]", + " │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_first_shipto_date_sk, collate: binary]", + " │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.date_dim.d_year, tpcds.date_dim.d_date_sk", + " │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_first_sales_date_sk, tpcds.date_dim.d_date_sk)]", + " │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_first_sales_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.store_returns.sr_item_sk, tpcds.store_returns.sr_ticket_number", + " │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.store_returns.sr_item_sk) eq(tpcds.store_sales.ss_ticket_number, tpcds.store_returns.sr_ticket_number)]", + " │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary], [name: tpcds.store_sales.ss_ticket_number, collate: binary]", + " │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_demo_sk", + " │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_hdemo_sk, tpcds.household_demographics.hd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_hdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.household_demographics.hd_income_band_sk, tpcds.household_demographics.hd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_hdemo_sk, tpcds.household_demographics.hd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_hdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_demographics.cd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.customer.c_current_cdemo_sk, tpcds.customer_demographics.cd_demo_sk)], other cond:ne(tpcds.customer_demographics.cd_marital_status, tpcds.customer_demographics.cd_marital_status)", + " │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_current_cdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.customer_demographics.cd_marital_status, tpcds.customer_demographics.cd_demo_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_cdemo_sk, tpcds.customer_demographics.cd_demo_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_cdemo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.store.s_store_name, tpcds.store.s_zip, tpcds.store.s_store_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_store_sk, tpcds.store.s_store_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_store_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk, tpcds.customer.c_current_cdemo_sk, tpcds.customer.c_current_hdemo_sk, tpcds.customer.c_current_addr_sk, tpcds.customer.c_first_shipto_date_sk, tpcds.customer.c_first_sales_date_sk, tpcds.customer.c_customer_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_customer_sk, tpcds.customer.c_customer_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_customer_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_customer_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.store_sales.ss_item_sk, tpcds.item.i_item_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.item.i_item_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.item.i_item_sk, tpcds.item.i_product_name, tpcds.item.i_item_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] ge(tpcds.item.i_current_price, 35), ge(tpcds.item.i_current_price, 36), le(tpcds.item.i_current_price, 45), le(tpcds.item.i_current_price, 50)", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:item pushed down filter:in(tpcds.item.i_color, \"maroon\", \"burnished\", \"dim\", \"steel\", \"navajo\", \"chocolate\"), keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_item_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Projection mpp[tiflash] tpcds.date_dim.d_year, tpcds.store_sales.ss_item_sk, tpcds.store_sales.ss_customer_sk, tpcds.store_sales.ss_cdemo_sk, tpcds.store_sales.ss_hdemo_sk, tpcds.store_sales.ss_addr_sk, tpcds.store_sales.ss_store_sk, tpcds.store_sales.ss_promo_sk, tpcds.store_sales.ss_ticket_number, tpcds.store_sales.ss_wholesale_cost, tpcds.store_sales.ss_list_price, tpcds.store_sales.ss_coupon_amt, tpcds.store_sales.ss_sold_date_sk", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.date_dim.d_date_sk, tpcds.store_sales.ss_sold_date_sk)]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d1 pushed down filter:or(eq(tpcds.date_dim.d_year, 2000), eq(tpcds.date_dim.d_year, 2001)), keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_sales.ss_sold_date_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.store_sales.ss_addr_sk)), not(isnull(tpcds.store_sales.ss_cdemo_sk)), not(isnull(tpcds.store_sales.ss_customer_sk)), not(isnull(tpcds.store_sales.ss_hdemo_sk)), not(isnull(tpcds.store_sales.ss_promo_sk)), not(isnull(tpcds.store_sales.ss_sold_date_sk)), not(isnull(tpcds.store_sales.ss_store_sk))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store_sales keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer.c_customer_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer.c_current_addr_sk)), not(isnull(tpcds.customer.c_current_cdemo_sk)), not(isnull(tpcds.customer.c_current_hdemo_sk)), not(isnull(tpcds.customer.c_first_sales_date_sk)), not(isnull(tpcds.customer.c_first_shipto_date_sk))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:customer keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store.s_store_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.store.s_store_name)), not(isnull(tpcds.store.s_zip))", + " │ │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_demographics.cd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer_demographics.cd_marital_status))", + " │ │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:cd1 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_demographics.cd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.customer_demographics.cd_marital_status))", + " │ │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:cd2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.household_demographics.hd_income_band_sk))", + " │ │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:hd1 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.household_demographics.hd_demo_sk, collate: binary]", + " │ │ │ │ │ │ │ │ │ └─Selection mpp[tiflash] not(isnull(tpcds.household_demographics.hd_income_band_sk))", + " │ │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:hd2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.store_returns.sr_item_sk, collate: binary], [name: tpcds.store_returns.sr_ticket_number, collate: binary]", + " │ │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:store_returns keep order:false, stats:pseudo", + " │ │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d2 keep order:false, stats:pseudo", + " │ │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.date_dim.d_date_sk, collate: binary]", + " │ │ │ │ │ │ └─TableFullScan mpp[tiflash] table:d3 keep order:false, stats:pseudo", + " │ │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.promotion.p_promo_sk, collate: binary]", + " │ │ │ │ │ └─TableFullScan mpp[tiflash] table:promotion keep order:false, stats:pseudo", + " │ │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_address.ca_address_sk, collate: binary]", + " │ │ │ │ └─TableFullScan mpp[tiflash] table:ad1 keep order:false, stats:pseudo", + " │ │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.customer_address.ca_address_sk, collate: binary]", + " │ │ │ └─TableFullScan mpp[tiflash] table:ad2 keep order:false, stats:pseudo", + " │ │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.income_band.ib_income_band_sk, collate: binary]", + " │ │ └─TableFullScan mpp[tiflash] table:ib1 keep order:false, stats:pseudo", + " │ └─ExchangeReceiver(Probe) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.income_band.ib_income_band_sk, collate: binary]", + " │ └─TableFullScan mpp[tiflash] table:ib2 keep order:false, stats:pseudo", + " └─Selection(Probe) mpp[tiflash] gt(Column, mul(2, Column))", + " └─Projection mpp[tiflash] Column, Column, tpcds.catalog_sales.cs_item_sk", + " └─HashAgg mpp[tiflash] group by:Column, funcs:sum(Column)->Column, funcs:sum(Column)->Column, funcs:firstrow(Column)->tpcds.catalog_sales.cs_item_sk", + " └─Projection mpp[tiflash] tpcds.catalog_sales.cs_ext_list_price->Column, plus(plus(tpcds.catalog_returns.cr_refunded_cash, tpcds.catalog_returns.cr_reversed_charge), tpcds.catalog_returns.cr_store_credit)->Column, tpcds.catalog_sales.cs_item_sk->Column", + " └─Projection mpp[tiflash] tpcds.catalog_sales.cs_item_sk, tpcds.catalog_sales.cs_ext_list_price, tpcds.catalog_returns.cr_refunded_cash, tpcds.catalog_returns.cr_reversed_charge, tpcds.catalog_returns.cr_store_credit, tpcds.catalog_returns.cr_item_sk", + " └─HashJoin mpp[tiflash] inner join, equal:[eq(tpcds.catalog_sales.cs_item_sk, tpcds.catalog_returns.cr_item_sk) eq(tpcds.catalog_sales.cs_order_number, tpcds.catalog_returns.cr_order_number)]", + " ├─ExchangeReceiver(Build) mpp[tiflash] ", + " │ └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.catalog_sales.cs_item_sk, collate: binary]", + " │ └─TableFullScan mpp[tiflash] table:catalog_sales keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) mpp[tiflash] ", + " └─ExchangeSender mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: tpcds.catalog_returns.cr_item_sk, collate: binary]", + " └─TableFullScan mpp[tiflash] table:catalog_returns keep order:false, stats:pseudo" + ] + } + ] + } +]