-
Notifications
You must be signed in to change notification settings - Fork 1
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
filter and sort by field of related collection #72
Conversation
I tried testing the the latest engine version, and found that the integration tests I had didn't pass because the new engine version uses |
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.
I think this module might be a good candidate for some property tests.
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.
Looks good, but please consider adding some property tests or unit tests for unify_relationship_references.rs
.
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.
👍
You're right, I added some tests |
Filter and sort by fields of a related collection.
This involves a change where relationship references can be "unified". We might have multiple references to the same relationship - for example one that selects fields, another that filters. When these are registered they are unified if they have the same key in the query request
collection_relationships
map, and they don't have incompatibilities such as differing predicates or offsets. Unifying involves merging field/column selections so that we can get necessary data with a single$lookup
.Previously we blindly copied documents from relationship
$lookup
pipelines to top-level row sets. But unification means that relationship pipelines may produce fields that were not requested by query request fields or aggregates. This change updates$replaceWith
stages to prune data coming from$lookup
pipelines to select only requested data.The changes here are mostly to mongodb-specific code, with only small adjustments to the database-agnostic logic in
ndc-query-plan
.Tickets: