Skip to content

TPC-Havoc Q4_v10

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
CASE
WHEN o_orderpriority = '1-URGENT'
THEN '1-URGENT'
WHEN o_orderpriority = '2-HIGH'
THEN '2-HIGH'
WHEN o_orderpriority = '3-MEDIUM'
THEN '3-MEDIUM'
WHEN o_orderpriority = '4-NOT SPECIFIED'
THEN '4-NOT SPECIFIED'
WHEN o_orderpriority = '5-LOW'
THEN '5-LOW'
ELSE o_orderpriority
END AS o_orderpriority,
COUNT(
CASE
WHEN EXISTS(
SELECT
*
FROM lineitem
WHERE
l_orderkey = o_orderkey AND l_commitdate < l_receiptdate
)
THEN 1
ELSE NULL
END
) AS order_count
FROM orders
WHERE
CASE WHEN o_orderdate >= CAST('1993-07-01' AS DATE) THEN 1 ELSE 0 END = 1
AND CASE
WHEN o_orderdate < CAST('1993-07-01' AS DATE) + INTERVAL '3 MONTH'
THEN 1
ELSE 0
END = 1
GROUP BY
o_orderpriority
ORDER BY
o_orderpriority

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['4_v10'])

Source

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