Skip to content

TPC-DS-OBT Q90

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

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
CAST(amc AS DECIMAL(15, 4)) / CAST(pmc AS DECIMAL(15, 4)) AS am_pm_ratio
FROM (
SELECT
COUNT(*) AS amc
FROM tpcds_sales_returns_obt AS obt
WHERE
(
obt.sold_time_sk = sold_time_t_time_sk
AND obt.ship_hdemo_sk = bill_hdemo_hd_demo_sk
AND obt.web_page_sk = web_page_wp_web_page_sk
AND sold_time_t_hour BETWEEN 6 AND 6 + 1
AND bill_hdemo_hd_dep_count = 0
AND web_page_wp_char_count BETWEEN 5000 AND 5200
)
AND channel = 'web'
) AS am_count, (
SELECT
COUNT(*) AS pmc
FROM tpcds_sales_returns_obt AS obt
WHERE
(
obt.sold_time_sk = sold_time_t_time_sk
AND obt.ship_hdemo_sk = bill_hdemo_hd_demo_sk
AND obt.web_page_sk = web_page_wp_web_page_sk
AND sold_time_t_hour BETWEEN 13 AND 13 + 1
AND bill_hdemo_hd_dep_count = 0
AND web_page_wp_char_count BETWEEN 5000 AND 5200
)
AND channel = 'web'
) AS pt
ORDER BY
am_pm_ratio
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['90'])

Source

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