Skip to content

TPC-Havoc Q15_v6

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
s_suppkey,
s_name,
s_address,
s_phone,
revenue_table.total_revenue
FROM supplier, (
SELECT
l_suppkey AS supplier_no,
SUM(l_extendedprice * (
1 - l_discount
)) AS total_revenue
FROM lineitem
WHERE
l_shipdate >= CAST('1996-01-01' AS DATE)
AND l_shipdate < CAST('1996-01-01' AS DATE) + INTERVAL '3 MONTH'
GROUP BY
l_suppkey
) AS revenue_table
WHERE
s_suppkey = revenue_table.supplier_no
AND revenue_table.total_revenue = (
SELECT
MAX(max_calc.total_revenue)
FROM (
SELECT
l_suppkey,
SUM(l_extendedprice * (
1 - l_discount
)) AS total_revenue
FROM lineitem
WHERE
l_shipdate >= CAST('1996-01-01' AS DATE)
AND l_shipdate < CAST('1996-01-01' AS DATE) + INTERVAL '3 MONTH'
GROUP BY
l_suppkey
) AS max_calc
)
ORDER BY
s_suppkey

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['15_v6'])

Source

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