Handle reused symbols in ProjectNode #4667
Merged
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.
Fixes processing of ProjectNode with reused symbols In UnaliasSymbolReferences:
Assignment of a form
s -> x
establishes new semantics for symbol s.It is possible though that symbol
s
is present in the source plan,and represents the same or different semantics.
As a consequence, any symbol mapping derived from the source plan
involving symbol
s
becomes potentially invalid,e.g.
s -> y
ory -> s
refer to the old semantics of symbols
.In such case, the underlying mappings are only used to map
projection assignments' values to ensure consistency with the source plan.
They aren't used to map projection outputs to avoid:
Also, the underlying mappings aren't passed up the plan, and new mappings
aren't derived from projection assignments (with the exception for "deduplicating"
mappings for repeated assignments).
This can be thought of as a "cut-off" at the point of potentially changed semantics.
Note: the issue of ambiguous symbols does not apply to symbols involved in
context (correlation) mapping. Those symbols are supposed to represent constant
semantics throughout the plan.
change is needed for #4250, and will be tested there.