-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(gms) Add aspect mappings to graphql fields to improve request efficiency #15274
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: master
Are you sure you want to change the base?
feat(gms) Add aspect mappings to graphql fields to improve request efficiency #15274
Conversation
| fineGrainedLineages: [FineGrainedLineage!] | ||
| @aspectMapping(aspects: ["upstreamLineage"]) |
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.
@chriscollins3456 do we actually need upstreamLineage here?
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 would hope this would come from elastic?
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 is actually needed i'm pretty sure in our lineage UI in order to show CLL. I can double check with @asikowitz though to be sure.
|
Seems like a reasonable approach, annotate the graphql schema with the mapping to aspects required. Some manual/AI work to setup, but I think the it makes a lot of sense. |
Note: This still needs tests right now
This is a POC PR that adds aspect mappings to GraphQL fields for the Dataset entity. The goal of this PR is to pave a path forward for us to optimize our entity hydration SQL queries by only fetching the aspects that we need based on the GraphQL query, as opposed to fetching all aspects on every hydration of an entity like we do right now.
In order to do this, I added a few new directives to our graphql schema to map the aspects that populate those fields. This should only be necessary on top level fields for a given entity, like I have in
entity.graphqlhere for Datasets.When we go to hydrate a Dataset, check which fields are being queried for in the graphql query, then check the fields on a Dataset, and get only the required aspects for those fields.
If we're ever in a position where someone adds a new field and forgets to add the aspect directive, I added the conservative fallback to fetch all aspects like before.