TPC-DS-OBT Q76
TPC-DS-OBT benchmark · all TPC-DS-OBT queries
Representative SQL
Rendered for DataFusion with default parameters.
SELECT channel, col_name, sold_date_d_year, sold_date_d_qoy, item_i_category, COUNT(*) AS sales_cnt, SUM(ext_sales_price) AS sales_amtFROM ( SELECT 'store' AS channel, 'ship_customer_sk' AS col_name, obt.sold_date_d_year, obt.sold_date_d_qoy, obt.item_i_category, obt.ext_sales_price AS ext_sales_price FROM tpcds_sales_returns_obt AS obt WHERE ( ship_customer_sk IS NULL AND obt.sold_date_sk = obt.sold_date_d_date_sk AND obt.item_sk = obt.item_i_item_sk ) AND channel = 'store' UNION ALL SELECT 'web' AS channel, 'bill_customer_sk' AS col_name, obt.sold_date_d_year, obt.sold_date_d_qoy, obt.item_i_category, obt.ext_sales_price AS ext_sales_price FROM tpcds_sales_returns_obt AS obt WHERE ( bill_customer_sk IS NULL AND obt.sold_date_sk = obt.sold_date_d_date_sk AND obt.item_sk = obt.item_i_item_sk ) AND channel = 'web' UNION ALL SELECT 'catalog' AS channel, 'bill_customer_sk' AS col_name, obt.sold_date_d_year, obt.sold_date_d_qoy, obt.item_i_category, obt.ext_sales_price AS ext_sales_price FROM tpcds_sales_returns_obt AS obt WHERE ( bill_customer_sk IS NULL AND obt.sold_date_sk = obt.sold_date_d_date_sk AND obt.item_sk = obt.item_i_item_sk ) AND channel = 'catalog') AS fooGROUP BY channel, col_name, sold_date_d_year, sold_date_d_qoy, item_i_categoryORDER BY channel, col_name, sold_date_d_year, sold_date_d_qoy, item_i_categoryLIMIT 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['76'])Source
Query text: benchbox/core/tpcds_obt/queries.py