Repository navigation
feat(substrait): fork consumers for concurrent relation inputs - #26896
Draft
alexanderbianchi wants to merge 4 commits into
Draft
alexanderbianchi wants to merge 4 commits into
alexanderbianchi wants to merge 4 commits into
Conversation
This was referenced Oct 29, 2026
alexanderbianchi
force-pushed
the
codex/substrait-consumer-forks
branch
from
October 29, 2026 21:02
fd1057f to
cc2c877
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #26602. Stacked on #26603; merge the input hook first. Both PRs target Apache
main, so this draft includes the prerequisite commit. Fork-only diff.Rationale for this change
Concurrent inputs cannot safely share mutable lambda and outer-query scope stacks. Consumers need a way to give each branch its own scope.
What changes are included in this PR?
Add optional
fork_for_branch() -> Option<Self>.consume_rel_inputsconsumes isolated forks concurrently when all inputs can be forked, otherwise it stays sequential. The default consumer implements forking by copying scope stacks and sharing session configuration.This extracts the fork approach previously included in #26603. Table caching and lookup limits remain separate in #26680; #26890 explores explicit contexts instead.
What is the testing strategy for this PR?
Existing tests cover sequential fallback, concurrent completion in input order, cancellation on error, and inherited but independent scopes. The updated hook prerequisite passes the extended workspace suite (12,896 Rust tests and 540 SQL logic files). The combined fork branch passes formatting, workspace Clippy, 73 Substrait unit tests, 228 integration tests, and 3 doctests.
Are there any user-facing changes?
The default consumer consumes independent JOIN, CROSS JOIN, set-operation, and multi-input extension children concurrently. Custom consumers remain sequential unless they implement the fork hook or override
consume_rel_inputs. Existing implementations remain source-compatible.