-
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(lineage) Add column-level impact analysis feature #6272
Merged
chriscollins3456
merged 20 commits into
datahub-project:master
from
chriscollins3456:cc--column-lineage-impact-analysis
Oct 26, 2022
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8df7289
set and update schemaField graph indices to have schemaField <-> sche…
25d50a2
update filters and wire it up to search for datasets from schemaField…
be0bcca
properly set all paths. also include pdl changes
6b88272
add comment
a1fa54f
make changes to return hydrated parent in schemaField path and fix bu…
194c52d
add all urns to path and set path according to relationship direction
15caae7
last two tweaks
7d4c507
PR edits
1a73d32
format
779fa3b
feat(ui) Add column menu and column selector to Impact Analysis (#954)
chriscollins3456 1354747
feat(ui) Display column paths on search cards for CLL impact analysis
68abc6a
update piece of state name
6572826
minor PR edits on cll-display-paths-on-results
b30cf5d
feat(ui) Display entity paths in modal for CLL impact analysis
7cf92c9
remove unused variable from FE
65124b9
fix conflict
cce631b
format
a3ca947
add cypress test for column level impact analysis
8fbcacc
throw exception instead of logging error on failing to get parent ent…
c23fc47
final styling changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...ql-core/src/main/java/com/linkedin/datahub/graphql/types/schemafield/SchemaFieldType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package com.linkedin.datahub.graphql.types.schemafield; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.common.urn.UrnUtils; | ||
import com.linkedin.datahub.graphql.QueryContext; | ||
import com.linkedin.datahub.graphql.generated.Entity; | ||
import com.linkedin.datahub.graphql.generated.EntityType; | ||
import com.linkedin.datahub.graphql.generated.SchemaFieldEntity; | ||
import com.linkedin.datahub.graphql.types.common.mappers.UrnToEntityMapper; | ||
import graphql.execution.DataFetcherResult; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
|
||
public class SchemaFieldType implements com.linkedin.datahub.graphql.types.EntityType<SchemaFieldEntity, String> { | ||
|
||
public SchemaFieldType() { } | ||
|
||
@Override | ||
public EntityType type() { | ||
return EntityType.SCHEMA_FIELD; | ||
} | ||
|
||
@Override | ||
public Function<Entity, String> getKeyProvider() { | ||
return Entity::getUrn; | ||
} | ||
|
||
@Override | ||
public Class<SchemaFieldEntity> objectClass() { | ||
return SchemaFieldEntity.class; | ||
} | ||
|
||
@Override | ||
public List<DataFetcherResult<SchemaFieldEntity>> batchLoad(@Nonnull List<String> urns, @Nonnull QueryContext context) throws Exception { | ||
final List<Urn> schemaFieldUrns = urns.stream() | ||
.map(UrnUtils::getUrn) | ||
.collect(Collectors.toList()); | ||
|
||
try { | ||
return schemaFieldUrns.stream() | ||
.map(this::mapSchemaFieldUrn) | ||
.map(schemaFieldEntity -> DataFetcherResult.<SchemaFieldEntity>newResult() | ||
.data(schemaFieldEntity) | ||
.build() | ||
) | ||
.collect(Collectors.toList()); | ||
|
||
} catch (Exception e) { | ||
throw new RuntimeException("Failed to load schemaField entity", e); | ||
} | ||
} | ||
|
||
private SchemaFieldEntity mapSchemaFieldUrn(Urn urn) { | ||
try { | ||
SchemaFieldEntity result = new SchemaFieldEntity(); | ||
result.setUrn(urn.toString()); | ||
result.setType(EntityType.SCHEMA_FIELD); | ||
result.setFieldPath(urn.getEntityKey().get(1)); | ||
Urn parentUrn = Urn.createFromString(urn.getEntityKey().get(0)); | ||
result.setParent(UrnToEntityMapper.map(parentUrn)); | ||
return result; | ||
} catch (Exception e) { | ||
throw new RuntimeException("Failed to load schemaField entity", e); | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2343,21 +2343,31 @@ type KeyValueSchema { | |
Standalone schema field entity. Differs from the SchemaField struct because it is not directly nested inside a | ||
schema field | ||
""" | ||
type SchemaFieldEntity { | ||
type SchemaFieldEntity implements Entity { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice |
||
""" | ||
Primary key of the schema field | ||
""" | ||
urn: String! | ||
|
||
""" | ||
A standard Entity Type | ||
""" | ||
type: EntityType! | ||
|
||
""" | ||
Field path identifying the field in its dataset | ||
""" | ||
fieldPath: String! | ||
|
||
""" | ||
The primary key of the field's parent. | ||
The field's parent. | ||
""" | ||
parent: String! | ||
parent: Entity! | ||
|
||
""" | ||
Granular API for querying edges extending from this entity | ||
""" | ||
relationships(input: RelationshipsInput!): EntityRelationshipsResult | ||
} | ||
|
||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's no issue if we can't convert right? It's still safe to return the mapped object without this field?
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.
ah that's a good catch -
SchemaFieldEntity
is expectingparent
to not be null here. so I think our options are to either makeparent
nullable or raise an error if this situation occurs (which it shouldn't). I don't think it really makes sense to haveparent
be null since the schemaField should always have a valid parent reference urn in its urn.. so i'm leaning towards raising an error. what do you think?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.
talked IRL and agreed on throwing an exception here