TPC-DS-OBT Q6
TPC-DS-OBT benchmark · all TPC-DS-OBT queries
Representative SQL
Rendered for DataFusion with default parameters.
WITH cat_avg AS ( SELECT item_i_category AS cat, AVG(item_i_current_price) AS avg_price FROM ( SELECT DISTINCT item_i_item_sk, item_i_category, item_i_current_price FROM tpcds_sales_returns_obt WHERE NOT item_i_item_sk IS NULL ) AS items GROUP BY item_i_category)SELECT obt.bill_cur_addr_ca_state AS state, COUNT(*) AS cntFROM tpcds_sales_returns_obt AS obtJOIN cat_avg ON obt.item_i_category = cat_avg.catWHERE obt.channel = 'store' AND NOT obt.bill_cur_addr_ca_address_sk IS NULL AND obt.sold_date_d_month_seq = ( SELECT DISTINCT sold_date_d_month_seq FROM tpcds_sales_returns_obt WHERE sold_date_d_year = 2000 AND sold_date_d_moy = 2 ) AND obt.item_i_current_price > 1.2 * cat_avg.avg_priceGROUP BY obt.bill_cur_addr_ca_stateHAVING COUNT(*) >= 10ORDER BY cnt, stateLIMIT 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['6'])Source
Query text: benchbox/core/tpcds_obt/queries.py