TPC-Havoc Q7_v10
TPC-Havoc benchmark · all TPC-Havoc queries
Representative SQL
Rendered for DataFusion with default parameters.
SELECT CASE WHEN supp_nation = 'FRANCE' THEN 'FRANCE' WHEN supp_nation = 'GERMANY' THEN 'GERMANY' ELSE supp_nation END AS supp_nation, CASE WHEN cust_nation = 'FRANCE' THEN 'FRANCE' WHEN cust_nation = 'GERMANY' THEN 'GERMANY' ELSE cust_nation END AS cust_nation, l_year, SUM(CASE WHEN volume > 0 THEN volume ELSE 0 END) AS revenueFROM ( SELECT CASE WHEN n1.n_name IN ('FRANCE', 'GERMANY') THEN n1.n_name ELSE 'OTHER' END AS supp_nation, CASE WHEN n2.n_name IN ('FRANCE', 'GERMANY') THEN n2.n_name ELSE 'OTHER' END AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, CASE WHEN l_discount BETWEEN 0.05 AND 0.07 THEN l_extendedprice * ( 1 - l_discount ) WHEN l_discount < 0.05 THEN l_extendedprice * ( 1 - l_discount ) WHEN l_discount > 0.07 THEN l_extendedprice * ( 1 - l_discount ) ELSE l_extendedprice * ( 1 - l_discount ) END AS volume FROM supplier, lineitem, orders, customer, nation AS n1, nation AS n2 WHERE s_suppkey = l_suppkey AND o_orderkey = l_orderkey AND c_custkey = o_custkey AND s_nationkey = n1.n_nationkey AND c_nationkey = n2.n_nationkey AND CASE WHEN ( n1.n_name = 'FRANCE' AND n2.n_name = 'GERMANY' ) THEN 1 WHEN ( n1.n_name = 'GERMANY' AND n2.n_name = 'FRANCE' ) THEN 1 ELSE 0 END = 1 AND CASE WHEN l_shipdate >= CAST('1995-01-01' AS DATE) THEN 1 ELSE 0 END = 1 AND CASE WHEN l_shipdate <= CAST('1996-12-31' AS DATE) THEN 1 ELSE 0 END = 1) AS shippingGROUP BY supp_nation, cust_nation, l_yearORDER BY supp_nation, cust_nation, l_yearRepresentative 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['7_v10'])Source
Query text: benchbox/core/tpchavoc/variant_sets/q07.py