From 776d2b3f09d6a93ed57f141879e1d518504cb053 Mon Sep 17 00:00:00 2001 From: Luis Trinidad Date: Thu, 7 Nov 2024 12:48:08 -0400 Subject: [PATCH] fix(profiling): add parenthesis to the formatted anomaly criteria --- testgen/template/profiling/profile_anomalies_screen_column.sql | 2 +- .../profiling/profile_anomalies_screen_multi_column.sql | 2 +- .../template/profiling/profile_anomalies_screen_variants.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testgen/template/profiling/profile_anomalies_screen_column.sql b/testgen/template/profiling/profile_anomalies_screen_column.sql index e0d9e34..cb9c4c1 100644 --- a/testgen/template/profiling/profile_anomalies_screen_column.sql +++ b/testgen/template/profiling/profile_anomalies_screen_column.sql @@ -19,4 +19,4 @@ LEFT JOIN v_inactive_anomalies i AND '{ANOMALY_ID}' = i.anomaly_id) WHERE p.profile_run_id = '{PROFILE_RUN_ID}'::UUID AND i.anomaly_id IS NULL - AND {ANOMALY_CRITERIA}; + AND ({ANOMALY_CRITERIA}); diff --git a/testgen/template/profiling/profile_anomalies_screen_multi_column.sql b/testgen/template/profiling/profile_anomalies_screen_multi_column.sql index 7a61561..6451eaf 100644 --- a/testgen/template/profiling/profile_anomalies_screen_multi_column.sql +++ b/testgen/template/profiling/profile_anomalies_screen_multi_column.sql @@ -44,7 +44,7 @@ WITH mults AS ( SELECT p.project_code, AND '{ANOMALY_ID}' = i.anomaly_id) WHERE p.profile_run_id = '{PROFILE_RUN_ID}'::UUID AND i.anomaly_id IS NULL - AND {ANOMALY_CRITERIA} + AND ({ANOMALY_CRITERIA}) ) INSERT INTO profile_anomaly_results (project_code, table_groups_id, profile_run_id, anomaly_id, diff --git a/testgen/template/profiling/profile_anomalies_screen_variants.sql b/testgen/template/profiling/profile_anomalies_screen_variants.sql index cec9bdb..266e73e 100644 --- a/testgen/template/profiling/profile_anomalies_screen_variants.sql +++ b/testgen/template/profiling/profile_anomalies_screen_variants.sql @@ -22,7 +22,7 @@ WITH all_matches AND p.column_name = i.column_name AND '{ANOMALY_ID}' = i.anomaly_id) WHERE p.profile_run_id = '{PROFILE_RUN_ID}'::UUID - AND {ANOMALY_CRITERIA} + AND ({ANOMALY_CRITERIA}) AND p.top_freq_values > '' AND i.anomaly_id IS NULL AND fn_count_intersecting_items(LOWER(fn_extract_top_values(p.top_freq_values)), v.check_values, '|') > 1