-
Notifications
You must be signed in to change notification settings - Fork 319
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
provide simple implementation of one-level lineage optimized for parent jobs #2657
Open
julienledem
wants to merge
10
commits into
main
Choose a base branch
from
simple_lineage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
41c2439
provide simple implementation of one-level lineage optimized for pare…
julienledem 023985e
spotless apply
julienledem 72c96f7
cleanup test
julienledem 47cc1d5
cleanup test
julienledem a38028b
rename to direct lineage; use jobs_view in sql; replace simple_name w…
julienledem c14c836
add LineageService test
julienledem 95d43e4
add LineageService test
julienledem 53ff595
fixing integration tests
julienledem efa46fe
Merge branch 'main' into simple_lineage
julienledem e7af696
add javadoc to mapper
julienledem 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
36 changes: 36 additions & 0 deletions
36
api/src/main/java/marquez/db/mappers/SimpleLineageEdgeMapper.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,36 @@ | ||
package marquez.db.mappers; | ||
|
||
import static marquez.db.Columns.stringOrNull; | ||
import static marquez.db.Columns.stringOrThrow; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import org.jdbi.v3.core.mapper.RowMapper; | ||
import org.jdbi.v3.core.statement.StatementContext; | ||
|
||
import lombok.NonNull; | ||
import marquez.common.models.DatasetId; | ||
import marquez.common.models.DatasetName; | ||
import marquez.common.models.JobId; | ||
import marquez.common.models.JobName; | ||
import marquez.common.models.NamespaceName; | ||
import marquez.db.LineageDao.SimpleLineageEdge; | ||
|
||
public final class SimpleLineageEdgeMapper implements RowMapper<SimpleLineageEdge> { | ||
pawel-big-lebowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Override | ||
public SimpleLineageEdge map(@NonNull ResultSet results, @NonNull StatementContext context) | ||
throws SQLException { | ||
JobId job1 = JobId.of(NamespaceName.of(stringOrThrow(results, "job_namespace")), JobName.of(stringOrThrow(results, "job_name"))); | ||
String io1 = stringOrNull(results, "io1"); | ||
String ds_namespace = stringOrNull(results, "ds_namespace"); | ||
DatasetId ds = ds_namespace == null ? null : new DatasetId(NamespaceName.of(ds_namespace), DatasetName.of(stringOrNull(results, "ds_name"))); | ||
String io2 = stringOrNull(results, "io2"); | ||
String job2_namespace = stringOrNull(results, "job2_namespace"); | ||
JobId job2 = job2_namespace == null ? null : JobId.of(NamespaceName.of(job2_namespace), JobName.of(stringOrThrow(results, "job2_name"))); | ||
String job2parent_namespace = stringOrNull(results, "job2_parent_namespace"); | ||
JobId job2parent = job2parent_namespace == null ? null : JobId.of(NamespaceName.of(job2parent_namespace), JobName.of(stringOrThrow(results, "job2_parent_name"))); | ||
return new SimpleLineageEdge(job1, io1, ds, io2, job2, job2parent); | ||
} | ||
} | ||
|
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.
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.
Why not using existing
IOType
enum? It took me some time to understand whatdirection
is.Would it make sense to replace
job1
,job2
withjob
,upstreamJob
?