compute: plan the sink source arrangement key#37444
Draft
antiguru wants to merge 1 commit into
Draft
Conversation
Sinks that consume an arranged `from` collection previously chose an arrangement key arbitrarily at render time and derived the unthinning permutation there. Record the chosen key on `ComputeSinkDesc.from_key` during LIR lowering, where the available arrangements of `from` are known, and have the renderer consume it. `None` selects the unarranged collection. The permutation and thinning stay derived at render time, since they are a pure function of the key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
When a sink consumes an arranged
fromcollection, the renderer previously picked an arrangement key arbitrarily (bundle.arranged.iter().next()) at runtime and derived the unthinning permutation there. That key choice is a planning decision, so this moves it to LIR lowering.ComputeSinkDescgainsfrom_key: Option<Vec<LirScalarExpr>>. Lowering sets it from the available arrangements offrom:Noneselects the unarranged collection,Some(key)names an arrangement the renderer reconstructs full rows from. The permutation and thinning stay derived at render time, since they are a pure function of the key.Behavior is unchanged: when
rawis available lowering picksNone, matching the old collection-preference; otherwise it names the same key set the renderer builds. The former arbitrary-pick fallback becomes a planned lookup.Retires the
TODO[btv]inrender/sinks.rs.Draft: not yet exercised end-to-end against subscribe/MV/copy-to sink dataflows.
🤖 Generated with Claude Code