Skip to content

TPC-DS-OBT Q79

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

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
c_last_name,
c_first_name,
SUBSTRING(s_city FROM 1 FOR 30),
ss_ticket_number,
amt,
profit
FROM (
SELECT
sale_id AS ss_ticket_number,
bill_customer_c_customer_sk AS cust_sk,
bill_customer_c_last_name AS c_last_name,
bill_customer_c_first_name AS c_first_name,
store_s_city AS s_city,
SUM(coupon_amt) AS amt,
SUM(net_profit) AS profit
FROM tpcds_sales_returns_obt
WHERE
channel = 'store'
AND NOT sold_date_d_date_sk IS NULL
AND NOT store_s_store_sk IS NULL
AND NOT bill_hdemo_hd_demo_sk IS NULL
AND (
bill_hdemo_hd_dep_count = 8 OR bill_hdemo_hd_vehicle_count > 0
)
AND sold_date_d_dow = 1
AND sold_date_d_year IN (1998, 1998 + 1, 1998 + 2)
AND store_s_number_employees BETWEEN 200 AND 295
GROUP BY
sale_id,
bill_customer_sk,
bill_addr_sk,
store_s_city,
bill_customer_c_customer_sk,
bill_customer_c_last_name,
bill_customer_c_first_name
) AS ms
WHERE
NOT cust_sk IS NULL
ORDER BY
c_last_name,
c_first_name,
SUBSTRING(s_city FROM 1 FOR 30),
profit
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['79'])

Source

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