Skip to content

TPC-Havoc Q17_v10

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
SUM(
CASE
WHEN l_quantity < (
SELECT
0.2 * AVG(l_quantity)
FROM lineitem
WHERE
l_partkey = p_partkey
)
THEN l_extendedprice
ELSE 0
END
) / 7.0 AS avg_yearly
FROM lineitem, part
WHERE
p_partkey = l_partkey
AND CASE WHEN p_brand = 'Brand#23' THEN 1 ELSE 0 END = 1
AND CASE WHEN p_container = 'MED BOX' THEN 1 ELSE 0 END = 1

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

Source

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