Skip to content

TPC-Havoc Q17_v5

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH part_thresholds AS (
SELECT
l_partkey,
0.2 * AVG(l_quantity) AS avg_threshold
FROM lineitem
GROUP BY
l_partkey
), qualified_parts AS (
SELECT
p_partkey
FROM part
WHERE
p_brand = 'Brand#23' AND p_container = 'MED BOX'
)
SELECT
SUM(l_extendedprice) / 7.0 AS avg_yearly
FROM lineitem AS l
INNER JOIN qualified_parts AS qp
ON l.l_partkey = qp.p_partkey
INNER JOIN part_thresholds AS pt
ON l.l_partkey = pt.l_partkey
WHERE
l.l_quantity < pt.avg_threshold

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['17_v5'])

Source

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