Skip to content

Commit

Permalink
fixed complex_rule_validation_success_flag (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
shourya116 authored Jan 11, 2023
1 parent ee8e326 commit 2539d80
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions clouddq/templates/dbt/macros/macros.sql
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -149,7 +149,7 @@
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/bq_native_partitioned_sql_expected.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/dataplex_gcs_metadata_sql_expected.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/dataplex_metadata_sql_expected.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ custom_sql_statement_validation_errors,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down
28 changes: 14 additions & 14 deletions tests/resources/dq_advanced_rules_expected_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"progress_watermark": true,
"rows_validated": 100,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -36,7 +36,7 @@
"progress_watermark": true,
"rows_validated": 100,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -64,7 +64,7 @@
"progress_watermark": true,
"rows_validated": 86,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -134,7 +134,7 @@
"progress_watermark": true,
"rows_validated": 4002,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -148,7 +148,7 @@
"progress_watermark": true,
"rows_validated": 4002,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -176,7 +176,7 @@
"progress_watermark": true,
"rows_validated": 4002,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -190,7 +190,7 @@
"progress_watermark": true,
"rows_validated": 4002,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -204,7 +204,7 @@
"progress_watermark": true,
"rows_validated": 4002,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -442,7 +442,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -456,7 +456,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -484,7 +484,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -512,7 +512,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down Expand Up @@ -554,7 +554,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand All @@ -568,7 +568,7 @@
"progress_watermark": true,
"rows_validated": 99,
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": 0,
"failed_count": 0,
"null_count": null
Expand Down
8 changes: 4 additions & 4 deletions tests/resources/dq_rules_expected_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"progress_watermark": true,
"rows_validated": "7",
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": "0",
"failed_count": "0",
"null_count": null
Expand Down Expand Up @@ -120,7 +120,7 @@
"progress_watermark": true,
"rows_validated": "9",
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": "0",
"failed_count": "0",
"null_count": null
Expand Down Expand Up @@ -148,7 +148,7 @@
"progress_watermark": true,
"rows_validated": "0",
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": null,
"failed_count": null,
"null_count": null
Expand All @@ -162,7 +162,7 @@
"progress_watermark": true,
"rows_validated": "0",
"complex_rule_validation_errors_count": null,
"complex_rule_validation_success_flag": null,
"complex_rule_validation_success_flag": true,
"success_count": null,
"failed_count": null,
"null_count": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down Expand Up @@ -82,7 +82,7 @@ CAST(NULL AS BOOLEAN) AS simple_rule_row_is_valid,
TRUE AS skip_null_count,
custom_sql_statement_validation_errors.complex_rule_validation_errors_count AS complex_rule_validation_errors_count,
CASE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN CAST(NULL AS BOOLEAN)
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count IS NULL THEN TRUE
WHEN custom_sql_statement_validation_errors.complex_rule_validation_errors_count = 0 THEN TRUE
ELSE FALSE
END AS complex_rule_validation_success_flag,
Expand Down

0 comments on commit 2539d80

Please sign in to comment.