Skip to content

Conversation

@JoasE
Copy link
Contributor

@JoasE JoasE commented Jan 28, 2026

Adds Cosmos Db query pipeline support for complex properties

  • I've read the guidelines for contributing and seen the walkthrough
  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
  • The code builds and tests pass locally (also verified by our automated build checks)
  • Commit messages follow this format:
        Summary of the changes
        - Detail 1
        - Detail 2

        Fixes #bugnumber
  • Tests for the changes have been added (for bug fixes / features)
  • Code follows the same patterns and style as existing code in this repo

Copy link
Contributor Author

@JoasE JoasE left a 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,
Copy link
Contributor Author

@JoasE JoasE Jan 29, 2026

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
Copy link
Contributor Author

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)
Copy link
Contributor Author

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?

Copy link
Contributor Author

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..?
Copy link
Contributor Author

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?
Copy link
Contributor Author

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?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant