JoinOrder Q9b — Canonical JoinOrder 9b
JoinOrder benchmark · all JoinOrder queries
Canonical JoinOrder SQL query 9b; generated DataFrame translation
Representative SQL
Rendered for DataFusion with default parameters.
SELECT MIN(an.name) AS alternative_name, MIN(chn.name) AS voiced_character, MIN(n.name) AS voicing_actress, MIN(t.title) AS american_movieFROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n, role_type AS rt, title AS tWHERE ci.note = '(voice)' AND cn.country_code = '[us]' AND mc.note LIKE '%(200%)%' AND ( mc.note LIKE '%(USA)%' OR mc.note LIKE '%(worldwide)%' ) AND n.gender = 'f' AND n.name LIKE '%Angel%' AND rt.role = 'actress' AND t.production_year BETWEEN 2007 AND 2010 AND ci.movie_id = t.id AND t.id = mc.movie_id AND ci.movie_id = mc.movie_id AND mc.company_id = cn.id AND ci.role_id = rt.id AND n.id = ci.person_id AND chn.id = ci.person_role_id AND an.person_id = n.id AND an.person_id = ci.person_idRepresentative DataFrame
Expression family (Polars, PySpark, DataFusion), default parameters.
def _impl(ctx: DataFrameContext) -> Any: return _execute_joinorder_expression_query(ctx, query_id)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 JoinOrder
bench = JoinOrder(scale_factor=1.0) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['9b'])For the DataFrame form:
from benchbox.core.query_catalog import get_dataframe_render
print(get_dataframe_render('joinorder', '9b', family="expression").source) # or family="pandas"Source
Query text: benchbox/core/joinorder/queries.py