TPC-DS-OBT Q69
TPC-DS-OBT benchmark · all TPC-DS-OBT queries
Representative SQL
Rendered for DataFusion with default parameters.
WITH c AS ( SELECT DISTINCT bill_customer_c_customer_sk AS c_customer_sk, bill_cur_cdemo_cd_gender AS cd_gender, bill_cur_cdemo_cd_marital_status AS cd_marital_status, bill_cur_cdemo_cd_education_status AS cd_education_status, bill_cur_cdemo_cd_purchase_estimate AS cd_purchase_estimate, bill_cur_cdemo_cd_credit_rating AS cd_credit_rating FROM tpcds_sales_returns_obt WHERE channel = 'store' AND NOT bill_customer_c_customer_sk IS NULL AND sold_date_d_year = 1999 AND sold_date_d_moy BETWEEN 1 AND 1 + 2 AND bill_cur_addr_ca_state IN ('CO', 'IL', 'MN') AND NOT bill_cur_cdemo_cd_demo_sk IS NULL)SELECT cd_gender, cd_marital_status, cd_education_status, COUNT(*) AS cnt1, cd_purchase_estimate, COUNT(*) AS cnt2, cd_credit_rating, COUNT(*) AS cnt3FROM cWHERE NOT EXISTS( SELECT 1 FROM tpcds_sales_returns_obt AS w WHERE w.channel = 'web' AND w.bill_customer_sk = c.c_customer_sk AND w.sold_date_d_year = 1999 AND w.sold_date_d_moy BETWEEN 1 AND 1 + 2 ) AND NOT EXISTS( SELECT 1 FROM tpcds_sales_returns_obt AS k WHERE k.channel = 'catalog' AND k.ship_customer_sk = c.c_customer_sk AND k.sold_date_d_year = 1999 AND k.sold_date_d_moy BETWEEN 1 AND 1 + 2 )GROUP BY cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_ratingORDER BY cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_ratingLIMIT 100Representative DataFrame
No DataFrame implementation is registered for this query.
Get the exact query for your run
The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:
from benchbox import TPCDSOBT
bench = TPCDSOBT(scale_factor=1.0) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['69'])Source
Query text: benchbox/core/tpcds_obt/queries.py