TPC-DS-OBT Q95
TPC-DS-OBT benchmark · all TPC-DS-OBT queries
Representative SQL
Rendered for DataFusion with default parameters.
WITH ws_wh AS ( SELECT DISTINCT obt.sale_id AS sale_id, obt.warehouse_sk AS wh1, other_obt.warehouse_sk AS wh2 FROM tpcds_sales_returns_obt AS obt JOIN tpcds_sales_returns_obt AS other_obt ON obt.sale_id = other_obt.sale_id AND obt.warehouse_sk <> other_obt.warehouse_sk WHERE obt.channel = 'web' AND other_obt.channel = 'web')SELECT COUNT(DISTINCT obt.sale_id) AS "order count", SUM(obt.ext_ship_cost) AS "total shipping cost", SUM(obt.net_profit) AS "total net profit"FROM tpcds_sales_returns_obt AS obtWHERE ( obt.ship_date_d_date BETWEEN '1999-5-01' AND ( CAST('1999-5-01' AS DATE) + INTERVAL '60 DAY' ) AND obt.ship_date_sk = obt.ship_date_d_date_sk AND obt.ship_addr_sk = obt.ship_addr_ca_address_sk AND obt.ship_addr_ca_state = 'TX' AND obt.web_site_sk = obt.web_site_web_site_sk AND obt.web_site_web_company_name = 'pri' AND obt.sale_id IN ( SELECT sale_id FROM ws_wh ) AND obt.sale_id IN ( SELECT ret_obt.sale_id FROM tpcds_sales_returns_obt AS ret_obt WHERE ret_obt.has_return = 'Y' AND ret_obt.channel = 'web' ) ) AND channel = 'web'ORDER BY COUNT(DISTINCT obt.sale_id)LIMIT 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['95'])Source
Query text: benchbox/core/tpcds_obt/queries.py