feat(isthmus): observe field reference types - #1080
Open
alexandrefimov wants to merge 1 commit into
Open
Conversation
Report Calcite input-schema types for root, outer and lambda field references through TypeObserver while keeping RexNode construction unchanged. The conversion context now tracks input row types and lambda parameter types; a field reference converted with no input in scope is reported as an inference failure rather than failing the conversion. Aggregate, sort and fetch open a conversion scope so their expressions can resolve input field types. Calcite's Aggregate and Sort carry no variablesSet, so a correlation bound to one of those inputs is rejected instead of being silently dropped. Named update now applies its filter with the correlation ids resolved while converting the condition and the transformations.
alexandrefimov
force-pushed
the
issue-379-field-reference-type-observer
branch
from
August 10, 2026 20:06
2fc101f to
fc0c796
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.
Summary
TypeObserverMotivation
#379 lists four conversion points where the Substrait-supplied type and the type Calcite would infer can diverge; scalar functions (#1015) and window functions (#1059) are already observed. Field references are the case the issue singles out as needing access to the underlying input schema, which is what the scope tracking here adds.
Changes
Aggregate, sort and fetch open a conversion scope so their expressions can resolve input field types. Calcite's
AggregateandSortcarry novariablesSet, so an outer reference bound to one of those inputs has nowhere to be declared and is rejected — previously it failed anyway, inrequireScope, because no scope existed at all.NamedUpdateapplies its filter with the correlation ids resolved while converting the condition and the transformations.Related to #379.