Skip to content

TPC-Havoc Q17_v6

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
SUM(lineitem_data.l_extendedprice) / 7.0 AS avg_yearly
FROM (
SELECT
l.l_extendedprice,
l.l_quantity,
l.l_partkey
FROM lineitem AS l, part AS p, (
SELECT
l_partkey AS pk,
0.2 * AVG(l_quantity) AS threshold
FROM lineitem
GROUP BY
l_partkey
) AS avg_data
WHERE
p.p_partkey = l.l_partkey
AND p.p_brand = 'Brand#23'
AND p.p_container = 'MED BOX'
AND avg_data.pk = l.l_partkey
AND l.l_quantity < avg_data.threshold
) AS lineitem_data

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_v6'])

Source

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