Skip to content

TPC-DS-OBT Q35

TPC-DS-OBT benchmark · all TPC-DS-OBT queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
bill_addr_ca_state,
bill_cdemo_cd_gender,
bill_cdemo_cd_marital_status,
bill_cdemo_cd_dep_count,
COUNT(*) AS cnt1,
SUM(bill_cdemo_cd_dep_count) AS aggone1,
SUM(bill_cdemo_cd_dep_count) AS aggtwo1,
SUM(bill_cdemo_cd_dep_count) AS aggthree1,
bill_cdemo_cd_dep_employed_count,
COUNT(*) AS cnt2,
SUM(bill_cdemo_cd_dep_employed_count) AS aggone2,
SUM(bill_cdemo_cd_dep_employed_count) AS aggtwo2,
SUM(bill_cdemo_cd_dep_employed_count) AS aggthree2,
bill_cdemo_cd_dep_college_count,
COUNT(*) AS cnt3,
SUM(bill_cdemo_cd_dep_college_count) AS aggone3,
SUM(bill_cdemo_cd_dep_college_count) AS aggtwo3,
SUM(bill_cdemo_cd_dep_college_count) AS aggthree3
FROM tpcds_sales_returns_obt AS obt
WHERE
(
ship_customer_c_current_addr_sk = bill_addr_ca_address_sk
AND bill_cdemo_cd_demo_sk = ship_customer_c_current_cdemo_sk
AND EXISTS(
SELECT
*
FROM tpcds_sales_returns_obt AS obt
WHERE
(
obt.ship_customer_c_customer_sk = obt.ship_customer_sk
AND obt.sold_date_sk = obt.sold_date_d_date_sk
AND obt.sold_date_d_year = 1999
AND obt.sold_date_d_qoy < 4
)
AND channel = 'store'
)
AND (
EXISTS(
SELECT
*
FROM tpcds_sales_returns_obt AS obt
WHERE
(
obt.ship_customer_c_customer_sk = obt.bill_customer_sk
AND obt.sold_date_sk = obt.sold_date_d_date_sk
AND obt.sold_date_d_year = 1999
AND obt.sold_date_d_qoy < 4
)
AND channel = 'web'
)
OR EXISTS(
SELECT
*
FROM tpcds_sales_returns_obt AS obt
WHERE
(
obt.ship_customer_c_customer_sk = obt.ship_customer_sk
AND obt.sold_date_sk = obt.sold_date_d_date_sk
AND obt.sold_date_d_year = 1999
AND obt.sold_date_d_qoy < 4
)
AND channel = 'catalog'
)
)
)
AND channel IN ('catalog', 'store', 'web')
GROUP BY
bill_addr_ca_state,
bill_cdemo_cd_gender,
bill_cdemo_cd_marital_status,
bill_cdemo_cd_dep_count,
bill_cdemo_cd_dep_employed_count,
bill_cdemo_cd_dep_college_count
ORDER BY
bill_addr_ca_state,
bill_cdemo_cd_gender,
bill_cdemo_cd_marital_status,
bill_cdemo_cd_dep_count,
bill_cdemo_cd_dep_employed_count,
bill_cdemo_cd_dep_college_count
LIMIT 100

Representative 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 factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['35'])

Source

Query text: benchbox/core/tpcds_obt/queries.py