-
Notifications
You must be signed in to change notification settings - Fork 318
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
Job parent hierarchy #1935
Job parent hierarchy #1935
Conversation
api/src/main/java/marquez/db/migrations/V43__UpdateRunsWithJobUUID.java
Outdated
Show resolved
Hide resolved
api/src/main/resources/marquez/db/migration/V41__alter_jobs_add_job_parent_id.sql
Outdated
Show resolved
Hide resolved
api/src/main/resources/marquez/db/migration/V41__alter_jobs_add_job_parent_id.sql
Outdated
Show resolved
Hide resolved
api/src/main/resources/marquez/db/migration/V41__alter_jobs_add_job_parent_id.sql
Outdated
Show resolved
Hide resolved
api/src/main/resources/marquez/db/migration/V42__runs_job_versions_add_job_uuid.sql
Outdated
Show resolved
Hide resolved
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.
Thanks for entertaining my thoughts and feedback @collado-mike. Left some minor comment, and suggestion to rename a few columns, but otherwise great work! 💯 🥇
382e3a5
to
620a18c
Compare
Codecov Report
@@ Coverage Diff @@
## main #1935 +/- ##
============================================
- Coverage 78.23% 78.20% -0.04%
Complexity 955 955
============================================
Files 194 194
Lines 5293 5303 +10
Branches 420 420
============================================
+ Hits 4141 4147 +6
- Misses 706 713 +7
+ Partials 446 443 -3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Signed-off-by: Michael Collado <[email protected]>
Signed-off-by: Michael Collado <[email protected]>
…simple name to fqn added unit test to verify Signed-off-by: Michael Collado <[email protected]>
bdfa4a5
to
a45885b
Compare
Signed-off-by: Michael Collado <[email protected]>
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.
Thanks for addressing my comments! Left one minor suggestion on naming, otherwise 👍
@@ -0,0 +1,44 @@ | |||
ALTER TABLE jobs ADD COLUMN IF NOT EXISTS parent_job_uuid uuid CONSTRAINT jobs_parent_fk_jobs REFERENCES jobs (uuid); |
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.
_Minor: I would also update the migration script to reflect the name of the column added:
V43__alter_jobs_add_job_parent_uuid.sql
Signed-off-by: Michael Collado <[email protected]>
Problem
Database migration as described in #1928 . This implements the database migration necessary to create the new columns (
job_uuid
andparent_run_id
inruns
andparent_job_uuid
injobs
.Solution
This PR addresses only the migration. After merging this, a deployment will have the new columns and values will be present, but aren't being actively written by the code and aren't being read. The migration is intended to be fully backward compatible, so if a deployment needs to be rolled back, the original data/behavior is preserved.
I added a
jobs_view
that calculates the fully qualified name rather than storing the FQN directly. With this implementation, a parent job can be renamed and child jobs can automatically be renamed (we'll need a separate issue to automatically redirect, as that's not currently handled in this impl). We also use the simple name of the job to display in the UI (currently relying on parsing the dot characters in the name). If we store the FQN directly, we'll need to parse the FQN to derive the simple name for display. On the other hand, constructing the FQN after storing the simple name is easy and cheap. While the view adds some complexity, I think it gives us direct access to the information we want without forcing us to use heuristics to figure it out.Checklist
CHANGELOG.md
with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary).sql
database schema migration according to Flyway's naming convention (if relevant)