Repository navigation
docs(pre-asap): capture why resolution uses positional ColumnId, not names - #241
Merged
Merged
Conversation
…names Settles the design question raised in #216 ("column index vs column name as ref"): resolving every ColumnRef to a positional ColumnId once (rather than carrying qualified names all the way through, the way DataFusion's and Calcite's logical plans do) is the better trade for this codebase's shape -- name collisions across joins are real (see join_predicate_disambiguates_shared_column_name), a name's meaning shifts as you go up the tree, and resolving once centralizes scoping logic in one place instead of every downstream pass reimplementing its own qualifier-aware, collision-aware name resolver. No code change -- the conclusion is to keep the current design. This just moves the rationale from the issue thread into the module doc so a future "why not just use names" question finds its answer next to the code. Closes #216 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merged
5 tasks done
This was referenced Oct 20, 2026
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.
Summary
Settles the design question raised in #216 ("column index vs column name as ref") by moving its already-conclusive rationale from the issue thread into
resolve.rs's module doc, next to the code it explains.The question: should
QueryExprkeep positionalColumnIdrefs (resolved once byBinder), or could it carry name-basedColumnRefs all the way through, the way DataFusion's own logical plan and Calcite do?The answer (already worked out in #216, not new analysis): resolving once is the better trade for this codebase's shape — one front-end-facing tree feeding several independent downstream passes (
canonicalize, cost model,dag_export, schema/type inference, summary binding). Three reasons, now captured in the doc:join_predicate_disambiguates_shared_column_nametest.Projectrenames,Aggregatecollapses/synthesizes columns,Joinconcatenates schemas).No code change — the conclusion is to keep the current design as-is. This is purely documentation so a future "why not just use names" question finds its answer next to
resolve_rootinstead of requiring someone to dig up issue #216.Test plan
cargo build --workspace --all-targetscargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test -p asap-types --libCloses #216
🤖 Generated with Claude Code