Read Primitives optimizer_scalar_subquery_flattening
Read Primitives benchmark · all Read Primitives queries
Representative SQL
Rendered in the benchmark’s native SQL with default parameters (no dialect translation available).
SELECT c.c_name, c.c_mktsegment, c.c_acctbal, ( SELECT AVG(o.o_totalprice) FROM orders AS o WHERE o.o_custkey = c.c_custkey AND o.o_orderdate >= CAST('1995-01-01' AS DATE) ) AS avg_order_value, ( SELECT COUNT(o.o_orderkey) FROM orders AS o WHERE o.o_custkey = c.c_custkey AND o.o_orderdate >= CAST('1995-01-01' AS DATE) ) AS order_countFROM customer AS cWHERE c.c_nationkey = 15 AND c.c_acctbal > 5000ORDER BY avg_order_value DESC, c.c_nameLIMIT 100Representative 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 ReadPrimitives
bench = ReadPrimitives(scale_factor=0.01) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['optimizer_scalar_subquery_flattening'])Source
Query text: benchbox/core/read_primitives/queries.py