Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle reused symbols in ProjectNode #4667

Merged
merged 1 commit into from
Aug 3, 2020

Conversation

kasiafi
Copy link
Member

@kasiafi kasiafi commented Aug 2, 2020

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 or y -> s refer to the old semantics of symbol s.
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:

  • errors from duplicate assignments
  • incorrect results from mixed semantics of symbols

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.

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` or `y -> s` refer to the old semantics of symbol `s`.
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:
 - errors from duplicate assignments
 - incorrect results from mixed semantics of symbols
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.
@cla-bot cla-bot bot added the cla-signed label Aug 2, 2020
@kasiafi kasiafi requested a review from martint August 2, 2020 14:59
@martint martint merged commit aa7b555 into trinodb:master Aug 3, 2020
@martint martint added this to the 340 milestone Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants