-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix to #15264 - QueryRewrite: incorporate query filters into nav rewrite #17021
Merged
Conversation
This file contains 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
maumar
commented
Aug 8, 2019
smitpatel
suggested changes
Aug 8, 2019
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.ExpressionVisitors.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Outdated
Show resolved
Hide resolved
test/EFCore.InMemory.FunctionalTests/Query/FiltersInheritanceInMemoryTest.cs
Show resolved
Hide resolved
test/EFCore.Specification.Tests/Query/QueryFilterFuncletizationTestBase.cs
Outdated
Show resolved
Hide resolved
maumar
force-pushed
the
fix15264
branch
2 times, most recently
from
August 9, 2019 00:18
89eb843
to
246be4c
Compare
new version up, still a couple outstanding issues/nitpicks left. |
maumar
commented
Aug 9, 2019
maumar
commented
Aug 9, 2019
maumar
commented
Aug 9, 2019
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Show resolved
Hide resolved
smitpatel
reviewed
Aug 9, 2019
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.ExpressionVisitors.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.Expressions.cs
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
maumar
force-pushed
the
fix15264
branch
2 times, most recently
from
August 9, 2019 21:36
e3c80c1
to
bb5a176
Compare
smitpatel
reviewed
Aug 9, 2019
smitpatel
reviewed
Aug 9, 2019
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
smitpatel
reviewed
Aug 9, 2019
src/EFCore/Query/Internal/NavigationExpandingExpressionVisitor.cs
Outdated
Show resolved
Hide resolved
smitpatel
reviewed
Aug 9, 2019
expressionPrinter.StringBuilder.Append("Source: "); | ||
expressionPrinter.Visit(Source); | ||
expressionPrinter.StringBuilder.AppendLine(); | ||
expressionPrinter.StringBuilder.Append("PendingSelector: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also print pending orderings
smitpatel
reviewed
Aug 9, 2019
test/EFCore.Specification.Tests/Query/SimpleQueryTestBase.QueryTypes.cs
Outdated
Show resolved
Hide resolved
smitpatel
reviewed
Aug 9, 2019
smitpatel
approved these changes
Aug 9, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When nav rewrite constructs new EntityQueryable it now looks into EntityType for any query filter annotations and applies them on top. Those predicates are parameterized and the parameters created are injected into the context as part of query execution expression. Generated predicate expression is re-visited by nav expansion to recursively handle filters (expand potential navigation expansions that were introduced in them). This adds some complexity to the way navigations are expanded - before the newly constructed join always was guaranteed to be an entity. Now it can be a complex structure with multiple navigations already expanded. Also small cleanup on ExpressionPrinter - adding IPrintable to some of the custom nodes created by nav expansion and removing rendering of connecting lines when printing the expression.
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.
When nav rewrite constructs new EntityQueryable it now looks into EntityType for any query filter annotations and applies them on top. Those predicates are parameterized and the parameters created are injected into the context as part of query execution expression.
Generated predicate expression is re-visited by nav expansion to recursively handle filters (expand potential navigation expansions that were introduced in them).
This adds some complexity to the way navigations are expanded - before the newly constructed join always was guaranteed to be an entity. Now it can be a complex structure with multiple navigations already expanded.