Skip to content

TPC-Havoc Q10_v9

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

WITH customer_revenue AS (
SELECT DISTINCT
c_custkey,
c_name,
SUM(l_extendedprice * (
1 - l_discount
)) OVER (PARTITION BY c_custkey) AS revenue,
c_acctbal,
n_name,
c_address,
c_phone,
c_comment
FROM customer, orders, lineitem, nation
WHERE
c_custkey = o_custkey
AND l_orderkey = o_orderkey
AND o_orderdate >= CAST('1993-10-01' AS DATE)
AND o_orderdate < CAST('1993-10-01' AS DATE) + INTERVAL '3 MONTH'
AND l_returnflag = 'R'
AND c_nationkey = n_nationkey
)
SELECT
c_custkey,
c_name,
revenue,
c_acctbal,
n_name,
c_address,
c_phone,
c_comment
FROM customer_revenue
ORDER BY
revenue DESC

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['10_v9'])

Source

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