Skip to content

Commit

Permalink
MINOR - fix Data Quality 1.6 migration (#17966)
Browse files Browse the repository at this point in the history
* fix import issue

* fix: delete unlinked test case results

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
  • Loading branch information
TeddyCr and chirag-madlani authored Sep 24, 2024
1 parent fe72f0e commit 305b8b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-- Delete data quality records with no linked test case FQN in the test_case table
DELETE dqdts
FROM data_quality_data_time_series dqdts
LEFT JOIN test_case tc ON dqdts.entityFQNHash = tc.fqnHash
WHERE tc.fqnHash IS NULL;

-- Add FQN and UUID to data_quality_data_time_series records
UPDATE data_quality_data_time_series dqdts
INNER JOIN test_case tc ON dqdts.entityFQNHash = tc.fqnHash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-- Delete data quality records with no linked test case FQN in the test_case table
DELETE FROM data_quality_data_time_series dqdts
WHERE NOT EXISTS (
SELECT 1
FROM test_case tc
WHERE dqdts.entityFQNHash = tc.fqnHash
);

-- Add FQN and UUID to data_quality_data_time_series records
UPDATE data_quality_data_time_series dqdts
SET json = jsonb_set(
Expand Down

0 comments on commit 305b8b7

Please sign in to comment.