Skip to content

TPC-Havoc Q3_v1

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
l_orderkey,
(
SELECT
SUM(l2.l_extendedprice * (
1 - l2.l_discount
))
FROM lineitem AS l2
WHERE
l2.l_orderkey = l1.l_orderkey AND l2.l_shipdate > CAST('1995-03-15' AS DATE)
) AS revenue,
o_orderdate,
o_shippriority
FROM customer, orders, lineitem AS l1
WHERE
c_mktsegment = 'BUILDING'
AND c_custkey = o_custkey
AND l1.l_orderkey = o_orderkey
AND o_orderdate < CAST('1995-03-15' AS DATE)
AND l1.l_shipdate > CAST('1995-03-15' AS DATE)
GROUP BY
l_orderkey,
o_orderdate,
o_shippriority
ORDER BY
revenue DESC,
o_orderdate

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['3_v1'])

Source

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