Skip to content

Commit

Permalink
add comments on filters
Browse files Browse the repository at this point in the history
Signed-off-by: sophiely <ly.sophie200@gmail.com>
  • Loading branch information
sophiely committed Nov 17, 2023
1 parent ab4f42d commit dc74376
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/main/java/marquez/db/RunDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ run_facets_agg AS (
run_uuid,
JSON_AGG(facet ORDER BY lineage_event_time ASC) AS facets
FROM run_facets_view
-- This filter here is used for performance purpose: we only aggregate the json of run_uuid that matters
WHERE
run_uuid IN (SELECT uuid FROM runs_view WHERE job_uuid IN (SELECT uuid FROM filtered_jobs))
GROUP BY run_uuid
Expand All @@ -167,6 +168,7 @@ input_versions_agg AS (
)) AS input_versions
FROM runs_input_mapping im
INNER JOIN dataset_versions dv ON im.dataset_version_uuid = dv.uuid
-- This filter here is used for performance purpose: we only aggregate the json of run_uuid that matters
WHERE
im.run_uuid IN (SELECT uuid FROM runs_view WHERE job_uuid IN (SELECT uuid FROM filtered_jobs))
GROUP BY im.run_uuid
Expand All @@ -180,6 +182,7 @@ output_versions_agg AS (
'dataset_version_uuid', uuid
)) AS output_versions
FROM dataset_versions dv
-- This filter here is used for performance purpose: we only aggregate the json of run_uuid that matters
WHERE dv.run_uuid IN (SELECT uuid FROM runs_view WHERE job_uuid IN (SELECT uuid FROM filtered_jobs))
GROUP BY dv.run_uuid
),
Expand All @@ -193,6 +196,7 @@ dataset_facets_agg AS (
'facet', facet
) ORDER BY created_at ASC) as dataset_facets
FROM dataset_facets_view
-- This filter here is used for performance purpose: we only aggregate the json of run_uuid that matters
WHERE run_uuid IN (SELECT uuid FROM runs_view WHERE job_uuid IN (SELECT uuid FROM filtered_jobs))
AND (type ILIKE 'output' OR type ILIKE 'input')
GROUP BY run_uuid
Expand Down

0 comments on commit dc74376

Please sign in to comment.