Skip to content

Commit

Permalink
Dataset.currentVersionUuid -> DatasetVersion.uuid (#2954)
Browse files Browse the repository at this point in the history
Signed-off-by: Willy Lulciuc <willy.lulciuc@gmail.com>
  • Loading branch information
wslulciuc authored Oct 25, 2024
1 parent 3b43a3e commit 5a33b2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions api/src/main/java/marquez/db/DatasetVersionDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ default void updateDatasetVersionMetric(
WITH selected_dataset_versions AS (
SELECT dv.*
FROM dataset_versions dv
WHERE dv.version = :version
WHERE dv.uuid = :version
), selected_dataset_version_facets AS (
SELECT dv.uuid, dv.dataset_name, dv.namespace_name, df.run_uuid, df.lineage_event_time, df.facet
FROM selected_dataset_versions dv
LEFT JOIN dataset_facets_view df ON df.dataset_version_uuid = dv.uuid
)
SELECT d.type, d.name, d.physical_name, d.namespace_name, d.source_name, d.description, dv.lifecycle_state,\s
dv.created_at, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
dv.created_at, dv.uuid AS current_version_uuid, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
sv.schema_location, t.tags, f.facets
FROM selected_dataset_versions dv
LEFT JOIN datasets_view d ON d.uuid = dv.dataset_uuid
Expand Down Expand Up @@ -206,7 +206,7 @@ WITH selected_dataset_versions AS (
LEFT JOIN dataset_facets_view df ON df.dataset_version_uuid = dv.uuid AND (df.type ILIKE 'dataset' OR df.type ILIKE 'unknown' OR df.type ILIKE 'input')
)
SELECT d.type, d.name, d.physical_name, d.namespace_name, d.source_name, d.description, dv.lifecycle_state,\s
dv.created_at, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
dv.created_at, dv.uuid AS current_version_uuid, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
sv.schema_location, t.tags, f.facets
FROM selected_dataset_versions dv
LEFT JOIN datasets_view d ON d.uuid = dv.dataset_uuid
Expand Down Expand Up @@ -255,7 +255,7 @@ default Optional<DatasetVersion> findByWithRun(UUID version) {
"""
WITH dataset_info AS (
SELECT d.type, d.name, d.physical_name, d.namespace_name, d.source_name, d.description, dv.lifecycle_state,
dv.created_at, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
dv.created_at, dv.uuid AS current_version_uuid, dv.version, dv.dataset_schema_version_uuid, dv.fields, dv.run_uuid AS createdByRunUuid,
sv.schema_location, t.tags, f.facets, f.lineage_event_time, f.dataset_version_uuid, facet_name
FROM dataset_versions dv
LEFT JOIN datasets_view d ON d.uuid = dv.dataset_uuid
Expand Down Expand Up @@ -285,13 +285,13 @@ dataset_symlinks_names as (
)
SELECT
type, name, physical_name, namespace_name, source_name, description, lifecycle_state,
created_at, version, dataset_schema_version_uuid, fields, createdByRunUuid, schema_location,
created_at, current_version_uuid, version, dataset_schema_version_uuid, fields, createdByRunUuid, schema_location,
tags, dataset_version_uuid,
JSONB_AGG(facets ORDER BY lineage_event_time ASC) AS facets
FROM dataset_info
WHERE name NOT IN (SELECT name FROM dataset_symlinks_names)
GROUP BY type, name, physical_name, namespace_name, source_name, description, lifecycle_state,
created_at, version, dataset_schema_version_uuid, fields, createdByRunUuid, schema_location,
created_at, current_version_uuid, version, dataset_schema_version_uuid, fields, createdByRunUuid, schema_location,
tags, dataset_version_uuid
ORDER BY created_at DESC
LIMIT :limit OFFSET :offset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public DatasetVersion map(@NonNull ResultSet results, @NonNull StatementContext
DatasetName.of(stringOrThrow(results, Columns.NAME)),
DatasetName.of(stringOrThrow(results, Columns.PHYSICAL_NAME)),
timestampOrThrow(results, Columns.CREATED_AT),
Version.of(uuidOrThrow(results, Columns.VERSION)),
Version.of(uuidOrThrow(results, Columns.CURRENT_VERSION_UUID)),
SourceName.of(stringOrThrow(results, Columns.SOURCE_NAME)),
toFields(results, "fields"),
columnNames.contains("tags") ? toTags(results, "tags") : null,
Expand All @@ -70,7 +70,7 @@ public DatasetVersion map(@NonNull ResultSet results, @NonNull StatementContext
DatasetName.of(stringOrThrow(results, Columns.NAME)),
DatasetName.of(stringOrThrow(results, Columns.PHYSICAL_NAME)),
timestampOrThrow(results, Columns.CREATED_AT),
Version.of(uuidOrThrow(results, Columns.VERSION)),
Version.of(uuidOrThrow(results, Columns.CURRENT_VERSION_UUID)),
SourceName.of(stringOrThrow(results, Columns.SOURCE_NAME)),
toURL(stringOrThrow(results, Columns.SCHEMA_LOCATION)),
toFields(results, "fields"),
Expand Down

0 comments on commit 5a33b2f

Please sign in to comment.