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

[6.0.1] Query: Update table references in pushdown after moving table references to subquery #26700

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

smitpatel
Copy link
Contributor

@smitpatel smitpatel commented Nov 15, 2021

Doing so causes all table references to maintain referential integrity again, which is required in processing projections in certain scenarios

Resolves #26587

Description
Pushing down a select expression in subquery causes it to transfer table references to subquery which causes intermediate phase where the referential integrity of select expression graph is violated. Processing of projection requires the graph to be consistent. We made the graph consistent again but after processing the projection so this can cause exception if projection runs some code which requires consistent graph.

Customer impact
Customer queries involving GroupBy which has aggregate applied on it and using grouping key in aggregate, if it gets pushed down (which can happen due to Skip/Take operators, joining it with other queries or other kind of composition), then it will throw exception.

How found
Customer reported on RTM package

Regression
Yes.

Testing
Added tests for the root cause scenario and also for the customer scenario.

Risk
Low. We are doing same processing as before just little early. Also added quirk to revert to previous behavior.

…ces to subquery

Doing so causes all table references to maintain referential integrity again, which is required in processing projections in certain scenarios

Resolves #26587
@smitpatel smitpatel requested a review from a team November 15, 2021 22:30
@smitpatel smitpatel requested a review from ajcvickers November 15, 2021 22:30
@smitpatel smitpatel added this to the 6.0.x milestone Nov 15, 2021
@smitpatel smitpatel changed the base branch from main to release/6.0 November 15, 2021 22:34
@ajcvickers ajcvickers modified the milestones: 6.0.x, 6.0.1 Nov 15, 2021
@smitpatel smitpatel merged commit 1b1c77a into release/6.0 Nov 15, 2021
@smitpatel smitpatel deleted the smit/TimingHasToBeRight branch November 15, 2021 23:54
@ajcvickers ajcvickers removed this from the 6.0.1 milestone Nov 17, 2021
@ajcvickers ajcvickers changed the title [6.0.x] Query: Update table references in pushdown after moving table referen… [6.0.1] Query: Update table references in pushdown after moving table references to subquery Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InvalidOperationException "sequence contains no matching element" in TableReferenceExpression.get_Table
3 participants