-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Cosmos: Complex properties Query #37577
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
base: main
Are you sure you want to change the base?
Conversation
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.
Need to merge with main after: #37321 and fix merge conflicts for entity equality.
Also need a cleanup
| context.AddRange( | ||
| new Context33449.EntityType | ||
| { | ||
| Id = 1, |
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.
TODO: This breaks sql tests, but is needed for cosmos to work. Can we generate a value on add..?
| } | ||
|
|
||
| public override async Task Contains_with_nested_and_composed_operators() | ||
| => await AssertTranslationFailed(base.Contains_with_nested_and_composed_operators); // Complex collection equality... Need ALL support |
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.
Is there an issue for this?
| return expression; | ||
| } | ||
|
|
||
| // This is for list.Contains(entity) |
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.
TODO? No wait don't think so, this isn't supported right?
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.
Remove comment
| return source; | ||
| } | ||
|
|
||
| private static bool IsProjectionCompatibleWithDistinct(Expression shaperExpression) // @TODO: Is there a better way to do this? // @TODO: Check if binding is done on client eval..? |
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.
Is there?
|
|
||
| Check.DebugAssert(entityType != null, "At least either side should be entityReference so entityType should be non-null."); | ||
| var obj = structuralReference.Object; | ||
| if (obj is StructuralTypeShaperExpression { ValueBufferExpression: ProjectionBindingExpression { QueryExpression: SelectExpression select } }) // @TODO: Is this the right way to check if this is a query object reference? |
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.
Improve?
| // x.Collection == x.Collection (should return null) | ||
| // x.Collection[1] == x.Collection[1] (should run below) | ||
| // How can we determine the difference? The structuralReference represents the entire complex type in both scenarios, wich is always of type ComplexType and IsCollection true.. | ||
| if (structuralReference.Parameter?.ValueBufferExpression is ObjectArrayAccessExpression) // @TODO: Is there a better way to do this? It feels like this might not be the right place. What about CosmosQueryableMethodTranslatingExpressionVisitor? What is the difference again? |
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.
Improve?
Adds Cosmos Db query pipeline support for complex properties