-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix: Cosmos ToList on structural collection is treated as scalar #38122
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -881,22 +881,7 @@ public override Task Json_collection_in_projection_with_composition_where_and_an | |
| => base.Json_collection_in_projection_with_composition_where_and_anonymous_projection_of_scalars(async); | ||
|
|
||
| public override Task Json_collection_leaf_filter_in_projection(bool async) | ||
| => Fixture.NoSyncTest( | ||
| async, async a => | ||
| { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This used to generate a JsonConvert.Deserialize call for materialization. I think we can't translate this because the Where would have to be ran in the materializer since we don't bind ["OwnedReferenceRoot"]["OwnedReferenceBranch"]["OwnedCollectionLeaf"], and 34067 should solve that |
||
| await base.Json_collection_leaf_filter_in_projection(a); | ||
|
|
||
| AssertSql( | ||
| """ | ||
| SELECT VALUE ARRAY( | ||
| SELECT VALUE o | ||
| FROM o IN c["OwnedReferenceRoot"]["OwnedReferenceBranch"]["OwnedCollectionLeaf"] | ||
| WHERE (o["SomethingSomething"] != "Baz")) | ||
| FROM root c | ||
| WHERE (c["Discriminator"] = "Basic") | ||
| ORDER BY c["Id"] | ||
| """); | ||
| }); | ||
| => AssertTranslationFailed(() => base.Json_collection_leaf_filter_in_projection(async)); | ||
|
|
||
| public override Task Json_collection_of_primitives_contains_in_predicate(bool async) | ||
| => Fixture.NoSyncTest( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -465,7 +465,7 @@ await AssertQuery( | |
|
|
||
| AssertSql( | ||
| """ | ||
| SELECT VALUE o["Details"] | ||
| SELECT VALUE o | ||
| FROM root c | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This projection now happens on the client side in the materializer. This used to generate a JsonConvert.Deserialize call for materialization
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this is a SelectMany, we do bind the c["Orders"], but the "Details" projection part happens in the materializer |
||
| JOIN o IN c["Orders"] | ||
| WHERE (c["Terminator"] IN ("OwnedPerson", "Branch", "LeafB", "LeafA") AND (ARRAY_LENGTH(o["Details"]) = 1)) | ||
|
|
@@ -546,7 +546,7 @@ await AssertQuery( | |
|
|
||
| AssertSql( | ||
| """ | ||
| SELECT VALUE o["Details"] | ||
| SELECT VALUE o | ||
| FROM root c | ||
| JOIN o IN c["Orders"] | ||
| WHERE (c["Terminator"] IN ("OwnedPerson", "Branch", "LeafB", "LeafA") AND (ARRAY_LENGTH(o["Details"]) = 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.
This used to generate a JsonConvert.Deserialize call for materialization. I think we can't translate this because the Distinct would have to be ran in the materializer since we don't bind ["AssociateCollection"], and 34067 should solve that