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

Remove usage of current_job_context_uuid column #2622

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions api/src/main/java/marquez/db/JobDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ INSERT INTO jobs_view AS j (
namespace_name,
name,
description,
current_job_context_uuid,
current_location,
current_inputs,
symlink_target_uuid,
Expand All @@ -297,7 +296,6 @@ INSERT INTO jobs_view AS j (
:namespaceName,
:name,
:description,
null,
:location,
:inputs,
:symlinkTargetId,
Expand Down Expand Up @@ -332,7 +330,6 @@ INSERT INTO jobs_view AS j (
namespace_name,
name,
description,
current_job_context_uuid,
current_location,
current_inputs,
symlink_target_uuid
Expand All @@ -346,7 +343,6 @@ INSERT INTO jobs_view AS j (
:namespaceName,
:name,
:description,
null,
:location,
:inputs,
:symlinkTargetId
Expand Down
12 changes: 4 additions & 8 deletions api/src/main/java/marquez/db/RunDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ LEFT OUTER JOIN (
+ "transitioned_at, "
+ "namespace_name, "
+ "job_name, "
+ "location, "
+ "job_context_uuid "
+ "location "
+ ") VALUES ( "
+ ":runUuid, "
+ ":parentRunUuid, "
Expand All @@ -224,8 +223,7 @@ LEFT OUTER JOIN (
+ ":runStateTime, "
+ ":namespaceName, "
+ ":jobName, "
+ ":location, "
+ "null "
+ ":location "
+ ") ON CONFLICT(uuid) DO "
+ "UPDATE SET "
+ "external_id = EXCLUDED.external_id, "
Expand Down Expand Up @@ -266,8 +264,7 @@ RunRow upsert(
+ "nominal_end_time, "
+ "namespace_name, "
+ "job_name, "
+ "location, "
+ "job_context_uuid "
+ "location "
+ ") VALUES ( "
+ ":runUuid, "
+ ":parentRunUuid, "
Expand All @@ -281,8 +278,7 @@ RunRow upsert(
+ ":nominalEndTime, "
+ ":namespaceName, "
+ ":jobName, "
+ ":location, "
+ "null"
+ ":location "
+ ") ON CONFLICT(uuid) DO "
+ "UPDATE SET "
+ "external_id = EXCLUDED.external_id, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ LEFT JOIN LATERAL (
public static final String INSERT_NEW_JOB_WITH_PARENT =
"""
INSERT INTO jobs(uuid, type, created_at, updated_at, namespace_uuid, name, description,
current_version_uuid, namespace_name, current_job_context_uuid, current_location, current_inputs,
current_version_uuid, namespace_name, current_location, current_inputs,
parent_job_uuid)
SELECT :uuid, type, created_at, updated_at, namespace_uuid, name, description, current_version_uuid,
namespace_name, current_job_context_uuid, current_location, current_inputs, :parent_job_uuid
namespace_name, current_location, current_inputs, :parent_job_uuid
FROM jobs
WHERE uuid=:job_uuid
ON CONFLICT (name, namespace_name, parent_job_uuid) DO NOTHING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ BEGIN
NEW.description,
NEW.current_version_uuid,
NEW.namespace_name,
NEW.current_job_context_uuid,
NULL,
NEW.current_location,
NEW.current_inputs,
NEW.symlink_target_uuid,
Expand All @@ -67,7 +67,6 @@ BEGIN
END,
type = EXCLUDED.type,
description = EXCLUDED.description,
current_job_context_uuid = EXCLUDED.current_job_context_uuid,
current_location = EXCLUDED.current_location,
current_inputs = EXCLUDED.current_inputs,
-- update the symlink target if null. otherwise, keep the old value
Expand Down
4 changes: 2 additions & 2 deletions api/src/test/java/marquez/db/BackfillTestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public static UUID writeJob(Jdbi jdbi, String jobName, Instant now, NamespaceRow
h -> {
return h.createQuery(
"""
INSERT INTO jobs (uuid, type, created_at, updated_at, namespace_uuid, name, namespace_name, current_job_context_uuid, current_inputs)
VALUES (:uuid, :type, :now, :now, :namespaceUuid, :name, :namespaceName, null, :currentInputs)
INSERT INTO jobs (uuid, type, created_at, updated_at, namespace_uuid, name, namespace_name, current_inputs)
VALUES (:uuid, :type, :now, :now, :namespaceUuid, :name, :namespaceName, :currentInputs)
RETURNING uuid
""")
.bind("uuid", UUID.randomUUID())
Expand Down
Loading