Skip to content

TPC-Havoc Q5_v9

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH regional_revenue AS (
SELECT DISTINCT
n_name,
SUM(l_extendedprice * (
1 - l_discount
)) OVER (PARTITION BY n_name) AS revenue
FROM customer, orders, lineitem, supplier, nation, region
WHERE
c_custkey = o_custkey
AND l_orderkey = o_orderkey
AND l_suppkey = s_suppkey
AND c_nationkey = s_nationkey
AND s_nationkey = n_nationkey
AND n_regionkey = r_regionkey
AND r_name = 'ASIA'
AND o_orderdate >= CAST('1994-01-01' AS DATE)
AND o_orderdate < CAST('1994-01-01' AS DATE) + INTERVAL '1 YEAR'
)
SELECT
n_name,
revenue
FROM regional_revenue
ORDER BY
revenue DESC

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 TPCHavoc
bench = TPCHavoc(scale_factor=0.01) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['5_v9'])

Source

Query text: benchbox/core/tpchavoc/variant_sets/q05.py