-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(foreign keys): add foreign key models #3275
feat(foreign keys): add foreign key models #3275
Conversation
…s' into AddingForeignKeyPrimaryKeyModels
…s' into AddingForeignKeyPrimaryKeyModels
…s' into AddingForeignKeyPrimaryKeyModels
metadata-models/src/main/pegasus/com/linkedin/metadata/aspect/SchemaFieldAspect.pdl
Show resolved
Hide resolved
metadata-models/src/main/pegasus/com/linkedin/metadata/snapshot/DatasetSnapshot.pdl
Show resolved
Hide resolved
metadata-models/src/main/pegasus/com/linkedin/metadata/snapshot/SchemaFieldSnapshot.pdl
Show resolved
Hide resolved
metadata-models/src/main/pegasus/com/linkedin/metadata/snapshot/Snapshot.pdl
Show resolved
Hide resolved
import com.linkedin.metadata.key.SchemaFieldKey | ||
|
||
/** | ||
* A union of all supported metadata aspects for a Dataset |
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.
Fix comment
import com.linkedin.common.Urn | ||
|
||
/** | ||
* Key for a SchemaField |
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.
Should we call these models DatasetSchemaField?
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.
hmm.. actually updating this to be container
rather than dataset
so we have the flexibility to add schema fields to other things
} | ||
dataset: Urn | ||
|
||
/** |
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.
Field path spec is going to get much more important :)
"entityTypes": [ "schemaField" ] | ||
} | ||
} | ||
foreignFields: array[Urn] |
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.
What's a use case with multiple foreign key fields?
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.
(a,b,c) in Table 1 are compound keys pointing to (d,e,f) in Table 2
"name": "ForeignKeyToDataset", | ||
"entityTypes": [ "dataset" ] | ||
} | ||
foreignDataset: Urn |
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.
Consider placing this at the top of this model
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 it makes sense where it is- this is just for sake of easy 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.
I like how you've kept things fairly minimal
name: string | ||
|
||
/** | ||
* Fields the constraint maps to on the foreign dataset |
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.
maybe a note that these are expected to be schema field urns... and what that structure looks like?
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.
that is already annotated in the entityTypes property below :)
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.
Overall LGTM with minor documentation comments. Can we remove the new snapshot models... since we are trying to move to less monolithic models.
4abbbee
to
b4acd57
Compare
@Searchable = { | ||
"fieldType": "URN", | ||
} | ||
container: Urn |
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.
container / parent?
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.
LGTM!
)" This reverts commit 6d6acff.
Adding the modeling for foreign keys + schema fields
Checklist