Skip to content

TPC-Havoc Q5_v3

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
n.n_name,
SUM(l.l_extendedprice * (
1 - l.l_discount
)) AS revenue
FROM region AS r
INNER JOIN nation AS n
ON r.r_regionkey = n.n_regionkey
INNER JOIN supplier AS s
ON n.n_nationkey = s.s_nationkey
INNER JOIN customer AS c
ON s.s_nationkey = c.c_nationkey
INNER JOIN orders AS o
ON c.c_custkey = o.o_custkey
INNER JOIN lineitem AS l
ON o.o_orderkey = l.l_orderkey AND s.s_suppkey = l.l_suppkey
WHERE
r.r_name = 'ASIA'
AND o.o_orderdate >= CAST('1994-01-01' AS DATE)
AND o.o_orderdate < CAST('1994-01-01' AS DATE) + INTERVAL '1 YEAR'
GROUP BY
n.n_name
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_v3'])

Source

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