TPC-Havoc Q9_v10
TPC-Havoc benchmark · all TPC-Havoc queries
Representative SQL
Rendered for DataFusion with default parameters.
SELECT nation, o_year, SUM(amount) AS sum_profitFROM ( SELECT CASE WHEN n_name IS NOT NULL THEN n_name ELSE 'UNKNOWN' END AS nation, CASE WHEN EXTRACT(YEAR FROM o_orderdate) BETWEEN 1990 AND 2000 THEN EXTRACT(YEAR FROM o_orderdate) ELSE NULL END AS o_year, CASE WHEN l_discount BETWEEN 0.05 AND 0.07 THEN l_extendedprice * ( 1 - l_discount ) - ps_supplycost * l_quantity WHEN l_discount < 0.05 THEN l_extendedprice * ( 1 - l_discount ) - ps_supplycost * l_quantity WHEN l_discount > 0.07 THEN l_extendedprice * ( 1 - l_discount ) - ps_supplycost * l_quantity ELSE l_extendedprice * ( 1 - l_discount ) - ps_supplycost * l_quantity END AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_suppkey = l_suppkey AND ps_suppkey = l_suppkey AND ps_partkey = l_partkey AND p_partkey = l_partkey AND o_orderkey = l_orderkey AND s_nationkey = n_nationkey AND CASE WHEN p_name LIKE '%green%' THEN 1 ELSE 0 END = 1) AS profitWHERE o_year IS NOT NULLGROUP BY nation, o_yearORDER BY nation, o_year DESCRepresentative 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 factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['9_v10'])Source
Query text: benchbox/core/tpchavoc/variant_sets/q09.py