Skip to content

TPC-Havoc Q12_v3

TPC-Havoc benchmark · all TPC-Havoc queries

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
l.l_shipmode,
SUM(
CASE
WHEN o.o_orderpriority = '1-URGENT' OR o.o_orderpriority = '2-HIGH'
THEN 1
ELSE 0
END
) AS high_line_count,
SUM(
CASE
WHEN o.o_orderpriority <> '1-URGENT' AND o.o_orderpriority <> '2-HIGH'
THEN 1
ELSE 0
END
) AS low_line_count
FROM orders AS o
INNER JOIN lineitem AS l
ON o.o_orderkey = l.l_orderkey
WHERE
l.l_shipmode IN ('MAIL', 'SHIP')
AND l.l_commitdate < l.l_receiptdate
AND l.l_shipdate < l.l_commitdate
AND l.l_receiptdate >= CAST('1994-01-01' AS DATE)
AND l.l_receiptdate < CAST('1994-01-01' AS DATE) + INTERVAL '1 YEAR'
GROUP BY
l.l_shipmode
ORDER BY
l.l_shipmode

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['12_v3'])

Source

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