Skip to content
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(models) : Joins (Datasets) schema, resolvers and UI #8325

Merged
merged 118 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
da18715
Initial version - Joins Schema
rtekal May 4, 2023
bdf2bc6
Joins slight model changes
rtekal May 9, 2023
eeba4cb
Added resolvers
rtekal May 31, 2023
89e8782
Graphql change and extraneous code removed
rtekal May 31, 2023
0c22848
Merge branch 'master' into master
rtekal May 31, 2023
35ea6ca
Remove Snapshot and Aspect
rtekal Jun 15, 2023
5ff65c5
Merge branch 'master' into master
rtekal Jun 16, 2023
03319c1
Merge - Sync with master
rtekal Jun 21, 2023
a819bfa
Join resolver updates
rtekal Jun 23, 2023
0cd6323
Additional changes to graphql files
rtekal Jun 25, 2023
f84a576
join ui changes
poorvi767 Jun 27, 2023
badcb44
minor correction
poorvi767 Jun 27, 2023
996bcce
more updates to join ui
poorvi767 Jun 28, 2023
0b9246a
Merge branch 'master' into pl-join-ui
poorvi767 Jun 28, 2023
6d123c1
review comments incorporate for UI
poorvi767 Jul 14, 2023
2550337
Review changes 1
rtekal Jul 17, 2023
7d3680b
Merge branch 'pl-join-ui-review' into vt-pl-join-ui-codeReview
rtekal Jul 17, 2023
1a4967b
Merge pull request #1 from rtekal/vt-pl-join-ui-codeReview
poorvi767 Jul 17, 2023
6173ce4
placed new entries at the end
poorvi767 Jul 17, 2023
2c7e901
graphql fragments update
poorvi767 Jul 17, 2023
a3c8f0c
WIP- create and update join resolvers separate implementation
poorvi767 Jul 18, 2023
60ee9e8
fetched unr from envt for update join
poorvi767 Jul 18, 2023
fca944c
CreatedBy is an entity
rtekal Jul 19, 2023
8c1d018
create and update resolver refactoring done
poorvi767 Jul 19, 2023
3f0d55e
Merge with pl-join-ui-review
rtekal Jul 20, 2023
2d87628
updated return type for join mutations
poorvi767 Jul 20, 2023
d0f3b45
Merge branch 'pl-join-ui-review' into vt-pl-join-ui-codeReview
rtekal Jul 20, 2023
c99b654
Merged with pl-join-ui-review
rtekal Jul 20, 2023
e08fa36
join policy configuration
poorvi767 Jul 21, 2023
73f5993
Merge branch 'pl-join-ui-review' into vt-pl-join-ui-codeReview
rtekal Jul 21, 2023
fdff95f
CreatedActor as Entity
rtekal Jul 24, 2023
3fc0ba2
Merge pull request #2 from rtekal/vt-pl-join-ui-codeReview
poorvi767 Jul 25, 2023
cd8d480
timestamp to auditstamp changes
poorvi767 Jul 25, 2023
6ca1bb4
Merge branch 'pl-join-ui-review' of https://github.com/poorvi767/data…
poorvi767 Jul 25, 2023
b317a90
CreatedActor when not present
rtekal Jul 25, 2023
0d29228
policy and authorization for join
poorvi767 Jul 26, 2023
1442f3a
conflict resolution
poorvi767 Jul 26, 2023
084ca29
Merge pl-join-ui-review for Policy AuditStamp, FieldMapping
rtekal Jul 27, 2023
f0af033
Create_Join_Privilege should be part of COMMON_ENTITY_PRIVILEGES
rtekal Jul 27, 2023
3d8991e
Merge pull request #4 from rtekal/vt-pl-join-ui-codeReview
poorvi767 Jul 27, 2023
7a00ade
update create join authorization
poorvi767 Jul 27, 2023
6a6ebf8
removed commented code
poorvi767 Jul 28, 2023
c7cf14c
Merge pull request #5 from poorvi767/pl-join-ui-review
poorvi767 Jul 28, 2023
3139b8b
Merge branch 'master' into pl-join-ui
poorvi767 Jul 28, 2023
80484c3
create join modal refactored
poorvi767 Aug 1, 2023
795f663
removed console log
poorvi767 Aug 3, 2023
c0a64f3
skipped using apollo client direct for check duplicate join name
poorvi767 Aug 3, 2023
d784cad
Merge branch 'master' into pl-join-ui
poorvi767 Sep 6, 2023
9368a21
Join UUID non-random generation
rtekal Sep 13, 2023
d2fa626
Join GUID generation
rtekal Sep 15, 2023
7299279
Join Feature with Feature Flag
rtekal Sep 18, 2023
7cd52b2
Use About Join for description
rtekal Sep 20, 2023
b4c74fb
Removed details from JoinFieldMapping
rtekal Sep 21, 2023
34df52b
Message modification when empty join fields
rtekal Sep 22, 2023
e4deef1
review comments incorporate
poorvi767 Sep 29, 2023
ba32a4e
Merge authorization changes
rtekal Sep 29, 2023
96c5d6d
Merge authorization conflict resolution
rtekal Sep 29, 2023
3675766
Correction for style check
rtekal Oct 2, 2023
f25663a
Merge pull request #8 from rtekal/rtekal-reviews-pl-join-ui
poorvi767 Oct 3, 2023
e7916f2
css fixes
poorvi767 Oct 3, 2023
9ce4607
Merge pull request #10 from poorvi767/pl-join-ui-pr
poorvi767 Oct 3, 2023
6847170
Merge/conflict fixes with master
rtekal Oct 3, 2023
4715295
Merge pull request #11 from rtekal/rtekal-reviews-pl-join-ui
poorvi767 Oct 4, 2023
75499a7
fixed loading join under relationships tab
poorvi767 Oct 4, 2023
b53de1c
Merge pull request #12 from poorvi767/pl-join-ui-pr
poorvi767 Oct 4, 2023
e337e32
Merge branch 'master' into pl-join-ui
poorvi767 Oct 4, 2023
3da6cdb
Merge branch 'master' into pl-join-ui
poorvi767 Oct 4, 2023
ac87425
minor fix- reset join form after submit
poorvi767 Oct 4, 2023
085e472
Merge branch 'master' into pl-join-ui
poorvi767 Oct 4, 2023
5a03193
Merge with v0.12.1rc2
rtekal Dec 19, 2023
6325729
Changed Join to ERModelRelation - build compiles
rtekal Jan 3, 2024
d122996
Datahub comes up. Needs more UI testing
rtekal Jan 19, 2024
8e727c3
Typo in entity name
rtekal Jan 22, 2024
07c6a18
Merge pull request #13 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Jan 22, 2024
7c0d45f
Merged with master
rtekal Jan 23, 2024
91ac7d9
Indent correction
rtekal Jan 23, 2024
226fa40
Merging with main
rtekal Jan 30, 2024
43bc95c
spotless java changes
rtekal Feb 1, 2024
2369e07
Register for UI ERModelRelationEntity
rtekal Feb 2, 2024
dd09115
Merge pull request #14 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Feb 2, 2024
2831bf6
Master merge and resolve conflicts
rtekal Feb 2, 2024
aab5d0a
Merge pull request #16 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Feb 2, 2024
d9e0e5f
UI display: ER-Model-Relation
rtekal Feb 2, 2024
6952bab
Merge pull request #17 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Feb 2, 2024
a0a7264
Merge with master due to conflict
rtekal Feb 9, 2024
f2f8023
Merge pull request #18 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Feb 9, 2024
80bdd98
Merge branch 'master' into pl-join-ui
poorvi767 Feb 16, 2024
724145e
Feature flag name change
rtekal Feb 23, 2024
7422b4b
DatasetA -> source, DatasetB -> destination
rtekal Feb 27, 2024
3da6c48
Use generic Urn instead of DatasetUrn
rtekal Feb 28, 2024
0fd67ce
Mutation name changes Relation -> Relationship
rtekal Mar 4, 2024
39623ac
afield, bfield -> sourceField, destinationField
rtekal Mar 4, 2024
faf98b6
Merge with master
rtekal Mar 5, 2024
693b37c
Correct after merge
rtekal Mar 5, 2024
71cc165
Merge pull request #19 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 5, 2024
c984965
Merge branch 'master' into rtekal-pl-join-ui-ERModelRelation
rtekal Mar 5, 2024
15cf41c
Merge pull request #20 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 5, 2024
8c46b16
Changed to array of RelatipnshipFieldMapping
rtekal Mar 12, 2024
860006d
Entity name change: ermodelrelation -> erModelRelationship
rtekal Mar 13, 2024
1dc9631
Changed ermodelrelation to ermodelrelationship for entity name and ma…
rtekal Mar 14, 2024
97817f3
Rename ermodelrelationId -> id
rtekal Mar 14, 2024
5ce698f
ERModel relation -> relationship; code compiles
rtekal Mar 14, 2024
36ace22
Few more name changes
rtekal Mar 18, 2024
0690c2d
Add Cardinality based on relations
rtekal Mar 18, 2024
4e569d2
More Web files names changed to relationship
rtekal Mar 18, 2024
eda02f7
One more rename to relathipship
rtekal Mar 18, 2024
94220c5
Some more renames to relationship
rtekal Mar 18, 2024
15b7334
Merge branch 'master' into rtekal-pl-join-ui-ERModelRelation
rtekal Mar 18, 2024
6f4d1b1
Merge pull request #21 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 18, 2024
ce7d553
Merge branch 'master' into rtekal-pl-join-ui-ERModelRelation
rtekal Mar 18, 2024
40da935
Merge pull request #22 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 18, 2024
004eac0
Merge branch 'master' into pl-join-ui
chriscollins3456 Mar 19, 2024
9ebb047
Merge with main and some renames
rtekal Mar 19, 2024
5b54652
few more renames
rtekal Mar 19, 2024
49d9e55
Some more name changes
rtekal Mar 19, 2024
4d50ae2
Merge pull request #23 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 19, 2024
79694d7
Merge branch 'master' into rtekal-pl-join-ui-ERModelRelation
rtekal Mar 19, 2024
99ded17
Merge pull request #24 from rtekal/rtekal-pl-join-ui-ERModelRelation
rtekal Mar 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@
import com.linkedin.datahub.graphql.generated.GlossaryTermAssociation;
import com.linkedin.datahub.graphql.generated.IngestionSource;
import com.linkedin.datahub.graphql.generated.InstitutionalMemoryMetadata;
import com.linkedin.datahub.graphql.generated.Join;
import com.linkedin.datahub.graphql.generated.JoinProperties;
import com.linkedin.datahub.graphql.generated.LineageRelationship;
import com.linkedin.datahub.graphql.generated.ListAccessTokenResult;
import com.linkedin.datahub.graphql.generated.ListOwnershipTypesResult;
import com.linkedin.datahub.graphql.generated.ListDomainsResult;
import com.linkedin.datahub.graphql.generated.ListGroupsResult;
import com.linkedin.datahub.graphql.generated.ListQueriesResult;
import com.linkedin.datahub.graphql.generated.ListJoinResult;
import com.linkedin.datahub.graphql.generated.ListTestsResult;
import com.linkedin.datahub.graphql.generated.ListViewsResult;
import com.linkedin.datahub.graphql.generated.MLFeature;
Expand All @@ -92,6 +95,7 @@
import com.linkedin.datahub.graphql.generated.Test;
import com.linkedin.datahub.graphql.generated.TestResult;
import com.linkedin.datahub.graphql.generated.UserUsageCounts;
import com.linkedin.datahub.graphql.resolvers.AuthenticatedResolver;
import com.linkedin.datahub.graphql.resolvers.MeResolver;
import com.linkedin.datahub.graphql.resolvers.assertion.AssertionRunEventResolver;
import com.linkedin.datahub.graphql.resolvers.assertion.DeleteAssertionResolver;
Expand Down Expand Up @@ -296,6 +300,7 @@
import com.linkedin.datahub.graphql.types.tag.TagType;
import com.linkedin.datahub.graphql.types.test.TestType;
import com.linkedin.datahub.graphql.types.view.DataHubViewType;
import com.linkedin.datahub.graphql.types.join.JoinType;
import com.linkedin.entity.client.EntityClient;
import com.linkedin.metadata.config.DataHubConfiguration;
import com.linkedin.metadata.config.IngestionConfiguration;
Expand Down Expand Up @@ -421,6 +426,7 @@ public class GmsGraphQLEngine {
private final DataHubPolicyType dataHubPolicyType;
private final DataHubRoleType dataHubRoleType;
private final SchemaFieldType schemaFieldType;
private final JoinType joinType;
private final DataHubViewType dataHubViewType;
private final QueryType queryType;
private final DataProductType dataProductType;
Expand Down Expand Up @@ -518,6 +524,7 @@ public GmsGraphQLEngine(final GmsGraphQLEngineArgs args) {
this.dataHubPolicyType = new DataHubPolicyType(entityClient);
this.dataHubRoleType = new DataHubRoleType(entityClient);
this.schemaFieldType = new SchemaFieldType();
this.joinType = new JoinType(entityClient);
this.dataHubViewType = new DataHubViewType(entityClient);
this.queryType = new QueryType(entityClient);
this.dataProductType = new DataProductType(entityClient);
Expand Down Expand Up @@ -552,6 +559,7 @@ public GmsGraphQLEngine(final GmsGraphQLEngineArgs args) {
dataHubPolicyType,
dataHubRoleType,
schemaFieldType,
joinType,
dataHubViewType,
queryType,
dataProductType,
Expand Down Expand Up @@ -615,6 +623,7 @@ public void configureRuntimeWiring(final RuntimeWiring.Builder builder) {
configureTestResultResolvers(builder);
configureRoleResolvers(builder);
configureSchemaFieldResolvers(builder);
configureJoinResolvers(builder);
configureEntityPathResolvers(builder);
configureViewResolvers(builder);
configureQueryEntityResolvers(builder);
Expand Down Expand Up @@ -701,6 +710,9 @@ private void configureDataPlatformInstanceResolvers(final RuntimeWiring.Builder

private void configureQueryResolvers(final RuntimeWiring.Builder builder) {
builder.type("Query", typeWiring -> typeWiring
.dataFetcher("join", new AuthenticatedResolver<>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

AuthenticatedResolver is actually deprecated and an authentication check is handled elsewhere so if the user isn't logged in they can't get to any of these endpoints! so feel free to remove it from here as well as below

Copy link
Collaborator

Choose a reason for hiding this comment

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

also i see duplicate "join" entries here in configureQueryResolvers so I think you can just remove this one entirely.

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed

new LoadableTypeResolver<>(joinType,
(env) -> env.getArgument(URN_FIELD_NAME))))
.dataFetcher("appConfig",
new AppConfigResolver(gitVersion, analyticsService != null,
this.ingestionConfiguration,
Expand Down Expand Up @@ -740,6 +752,7 @@ private void configureQueryResolvers(final RuntimeWiring.Builder builder) {
.dataFetcher("glossaryTerm", getResolver(glossaryTermType))
.dataFetcher("glossaryNode", getResolver(glossaryNodeType))
.dataFetcher("domain", getResolver((domainType)))
.dataFetcher("join", getResolver(joinType))
.dataFetcher("dataPlatform", getResolver(dataPlatformType))
.dataFetcher("mlFeatureTable", getResolver(mlFeatureTableType))
.dataFetcher("mlFeature", getResolver(mlFeatureType))
Expand Down Expand Up @@ -842,6 +855,8 @@ private void configureMutationResolvers(final RuntimeWiring.Builder builder) {
.dataFetcher("updateDataFlow", new MutableTypeResolver<>(dataFlowType))
.dataFetcher("updateCorpUserProperties", new MutableTypeResolver<>(corpUserType))
.dataFetcher("updateCorpGroupProperties", new MutableTypeResolver<>(corpGroupType))
.dataFetcher("updateJoin", new AuthenticatedResolver<>(new MutableTypeResolver<>(joinType)))
.dataFetcher("createJoin", new MutableTypeResolver<>(joinType))
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have started moving away from using MutableTypeResolver in favor of individual resolvers for endpoints. This makes it easier to follow the code path and also keeps the JoinType from getting too bloated with business logic and permissions logic. So I might suggest creating two new resolvers like UpdateJoinResolver and CreateJoinResolver

Copy link
Contributor

Choose a reason for hiding this comment

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

Two new resolvers added: UpdateJoinResolver and CreateJoinResolver

.dataFetcher("addTag", new AddTagResolver(entityService))
.dataFetcher("addTags", new AddTagsResolver(entityService))
.dataFetcher("batchAddTags", new BatchAddTagsResolver(entityService))
Expand Down Expand Up @@ -991,6 +1006,12 @@ private void configureGenericEntityResolvers(final RuntimeWiring.Builder builder
.map(Domain::getUrn)
.collect(Collectors.toList())))
)
.type("ListJoinResult", typeWiring -> typeWiring
Copy link
Collaborator

Choose a reason for hiding this comment

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

may need to remove this if not doing the list joins endpoint

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed - listJoin is removed

.dataFetcher("join", new LoadableTypeBatchResolver<>(joinType,
(env) -> ((ListJoinResult) env.getSource()).getJoin().stream()
.map(Join::getUrn)
.collect(Collectors.toList())))
)
.type("GetRootGlossaryTermsResult", typeWiring -> typeWiring
.dataFetcher("terms", new LoadableTypeBatchResolver<>(glossaryTermType,
(env) -> ((GetRootGlossaryTermsResult) env.getSource()).getTerms().stream()
Expand Down Expand Up @@ -1396,6 +1417,46 @@ private void configureTypeExtensions(final RuntimeWiring.Builder builder) {
builder.scalar(GraphQLLong);
}

/**
* Configures resolvers responsible for resolving the {@link Join} type.
*/
private void configureJoinResolvers(final RuntimeWiring.Builder builder) {
builder
.type("Join", typeWiring -> typeWiring
.dataFetcher("privileges", new EntityPrivilegesResolver(entityClient))
.dataFetcher("relationships", new EntityRelationshipsResultResolver(graphClient))
.dataFetcher("browsePaths", new EntityBrowsePathsResolver(this.joinType))
.dataFetcher("container",
new LoadableTypeResolver<>(containerType,
(env) -> {
final Join join = env.getSource();
return join.getContainer() != null ? join.getContainer().getUrn() : null;
})
))
.type("JoinProperties", typeWiring -> typeWiring
.dataFetcher("datasetA",
new LoadableTypeResolver<>(datasetType,
(env) -> {
final JoinProperties joinProperties = env.getSource();
return joinProperties.getDatasetA() != null ? joinProperties.getDatasetA().getUrn() : null;
}))
.dataFetcher("datasetB",
new LoadableTypeResolver<>(datasetType,
(env) -> {
final JoinProperties joinProperties = env.getSource();
return joinProperties.getDatasetB() != null ? joinProperties.getDatasetB().getUrn() : null;
}))
)
.type("Owner", typeWiring -> typeWiring
.dataFetcher("owner", new OwnerTypeResolver<>(ownerTypes,
(env) -> ((Owner) env.getSource()).getOwner()))
)
.type("InstitutionalMemoryMetadata", typeWiring -> typeWiring
.dataFetcher("author", new LoadableTypeResolver<>(corpUserType,
(env) -> ((InstitutionalMemoryMetadata) env.getSource()).getAuthor().getUrn()))
);
}

/**
* Configures resolvers responsible for resolving the {@link com.linkedin.datahub.graphql.generated.DataJob} type.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class EntityTypeMapper {
.put(EntityType.NOTEBOOK, "notebook")
.put(EntityType.DATA_PLATFORM_INSTANCE, "dataPlatformInstance")
.put(EntityType.TEST, "test")
.put(EntityType.JOIN, Constants.JOIN_ENTITY_NAME)
.put(EntityType.DATAHUB_VIEW, Constants.DATAHUB_VIEW_ENTITY_NAME)
.put(EntityType.DATA_PRODUCT, Constants.DATA_PRODUCT_ENTITY_NAME)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.linkedin.datahub.graphql.generated.EntityType;
import com.linkedin.datahub.graphql.generated.GlossaryNode;
import com.linkedin.datahub.graphql.generated.GlossaryTerm;
import com.linkedin.datahub.graphql.generated.Join;
import com.linkedin.datahub.graphql.generated.MLFeature;
import com.linkedin.datahub.graphql.generated.MLFeatureTable;
import com.linkedin.datahub.graphql.generated.MLModel;
Expand Down Expand Up @@ -147,6 +148,11 @@ public Entity apply(Urn input) {
((Domain) partialEntity).setUrn(input.toString());
((Domain) partialEntity).setType(EntityType.DOMAIN);
}
if (input.getEntityType().equals("join")) {
partialEntity = new Join();
((Join) partialEntity).setUrn(input.toString());
((Join) partialEntity).setType(EntityType.JOIN);
}
if (input.getEntityType().equals("assertion")) {
partialEntity = new Assertion();
((Assertion) partialEntity).setUrn(input.toString());
Expand Down
Loading