You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
builders.plan.join and the physical equi-joins omit subtrees=, so a post_join_filter over a cached input raises #275
join() (src/substrait/builders/plan.py:695) and _physical_equi_join() (plan.py:1364) call _join_output_struct(...) without passing subtrees=, so the output schema they bind post_join_filter against is re-inferred from the raw root input with no shared-subtree scope. A ReferenceRel in either input then cannot resolve and inference raises.
lateral_join (plan.py:797) already does this correctly, reusing the left_ns / right_ns it inferred ~30 lines above via _join_struct_from_schemas(type_name, left_ns.struct, right_ns.struct).
no post_filter: OK
Traceback (most recent call last):
...
File "src/substrait/builders/plan.py", line 695, in resolve
struct=_join_output_struct(
File "src/substrait/type_inference.py", line 593, in _join_output_struct
left = infer_rel_schema(left_rel, registry=registry, subtrees=subtrees)
File "src/substrait/type_inference.py", line 893, in infer_rel_schema
raise Exception(
Exception: ReferenceRel subtree_ordinal 0 is out of range (0 shared subtree(s) in scope)
.hash_join(...) and .merge_join(...) fail the same way. Dropping post_filter succeeds, because nothing then re-enters _join_output_struct.
Measured on main at afa3c52. Pre-existing, not a regression — it reproduces identically on 45c8ca7.
Passing the already-inferred structs, as lateral_join does, both fixes the crash and drops a redundant recursive re-inference of both subtrees per join, which is the same quadratic re-inference tracked in #207. Shared-subplan support was added in #211.
🤖 Filed with AI assistance as a follow-up to review of #272.
Activity