-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new db table to store metric errors (#31)
- added migration scripts to create new table for storing metric errors. - added new enabler in storage configuration to control whether metric errors need to be saved in DQ Storage. - added new enabler in encryption configuration to control whether data excerpts in metric errors should be encrypted. - modified class storing metric errors and created its Slick table representation. Added error hash field that is used as part of unique key to deduplicate error records. Error hash is and MD5 hash string that is always computed using raw data excerpts even if it is encrypted later. - added deduplication of finalized metric errors by their unique constraint in order to avoid sending repeating data. - modified encryptor to make it faster (do not re-generate AES key and initial IV vector for every encryption attempt). - fixed partition values filter in HiveSourceReader - added more verbose logs for case when some of the source keyFields are not found within dataframe columns. - enhances JDBC manager upsert method to avoid stack overflow errors when saving large sequences of results (quite usual case for storing metric errors). - added Source validation on read: checks that all keyFields are presented in datafarame. - refactored application settings logging. - added implicit class to convert Option instances to Result instances. - documentation is updated to reflect the changes.
- Loading branch information
Showing
32 changed files
with
466 additions
and
130 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/h2/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "${defaultSchema}"."results_metric_error" | ||
( | ||
"job_id" VARCHAR(512) NOT NULL, | ||
"metric_id" VARCHAR(512) NOT NULL, | ||
"source_id" VARCHAR(512), | ||
"source_key_fields" VARCHAR(2048), | ||
"metric_columns" VARCHAR(2048), | ||
"status" VARCHAR(512) NOT NULL, | ||
"message" TEXT NOT NULL, | ||
"row_data" TEXT NOT NULL, | ||
"error_hash" VARCHAR(512) NOT NULL, | ||
"reference_date" TIMESTAMP NOT NULL, | ||
"execution_date" TIMESTAMP NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") | ||
); |
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/mssql/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "${defaultSchema}"."results_metric_error" | ||
( | ||
"job_id" VARCHAR(512) NOT NULL, | ||
"metric_id" VARCHAR(512) NOT NULL, | ||
"source_id" VARCHAR(512), | ||
"source_key_fields" VARCHAR(2048), | ||
"metric_columns" VARCHAR(2048), | ||
"status" VARCHAR(512) NOT NULL, | ||
"message" VARCHAR(MAX) NOT NULL, | ||
"row_data" VARCHAR(MAX) NOT NULL, | ||
"error_hash" VARCHAR(512) NOT NULL, | ||
"reference_date" DATETIME NOT NULL, | ||
"execution_date" DATETIME NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/mysql/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "${defaultSchema}"."results_metric_error" | ||
( | ||
"job_id" VARCHAR(256) NOT NULL, | ||
"metric_id" VARCHAR(256) NOT NULL, | ||
"source_id" VARCHAR(512), | ||
"source_key_fields" VARCHAR(2048), | ||
"metric_columns" VARCHAR(2048), | ||
"status" VARCHAR(512) NOT NULL, | ||
"message" TEXT NOT NULL, | ||
"row_data" TEXT NOT NULL, | ||
"error_hash" VARCHAR(256) NOT NULL, | ||
"reference_date" TIMESTAMP NOT NULL, | ||
"execution_date" TIMESTAMP NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") | ||
); |
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/oracle/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "${defaultSchema}"."results_metric_error" | ||
( | ||
"job_id" VARCHAR(512) NOT NULL, | ||
"metric_id" VARCHAR(512) NOT NULL, | ||
"source_id" VARCHAR(512), | ||
"source_key_fields" VARCHAR(2048), | ||
"metric_columns" VARCHAR(2048), | ||
"status" VARCHAR(512) NOT NULL, | ||
"message" CLOB NOT NULL, | ||
"row_data" CLOB NOT NULL, | ||
"error_hash" VARCHAR(512) NOT NULL, | ||
"reference_date" TIMESTAMP NOT NULL, | ||
"execution_date" TIMESTAMP NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") | ||
); |
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/postgres/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "${defaultSchema}"."results_metric_error" | ||
( | ||
"job_id" TEXT NOT NULL, | ||
"metric_id" TEXT NOT NULL, | ||
"source_id" TEXT, | ||
"source_key_fields" TEXT, | ||
"metric_columns" TEXT, | ||
"status" TEXT NOT NULL, | ||
"message" TEXT NOT NULL, | ||
"row_data" TEXT NOT NULL, | ||
"error_hash" TEXT NOT NULL, | ||
"reference_date" TIMESTAMP NOT NULL, | ||
"execution_date" TIMESTAMP NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
checkita-core/src/main/resources/db/specific/sqlite/V1.4__add_metric_errors.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE "results_metric_error" | ||
( | ||
"job_id" TEXT NOT NULL, | ||
"metric_id" TEXT NOT NULL, | ||
"source_id" TEXT, | ||
"source_key_fields" TEXT, | ||
"metric_columns" TEXT, | ||
"status" TEXT NOT NULL, | ||
"message" TEXT NOT NULL, | ||
"row_data" TEXT NOT NULL, | ||
"error_hash" TEXT NOT NULL, | ||
"reference_date" TIMESTAMP NOT NULL, | ||
"execution_date" TIMESTAMP NOT NULL, | ||
UNIQUE ("job_id", "error_hash", "reference_date") ON CONFLICT REPLACE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.