-
Notifications
You must be signed in to change notification settings - Fork 79
Dashboard As Code for Reconcile #768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
14b031c
init
sundarshankar89 1e11205
Merge branch 'main' into feature/lsql_dashboard
sundarshankar89 20dde6b
fix pom
sundarshankar89 a8d4835
Renamed Files
sundarshankar89 dffb4db
Enhancement
sundarshankar89 a28d55a
intermediate commit
sundarshankar89 bcc21b5
intermediate commit
sundarshankar89 387290c
test case fixes
sundarshankar89 9e6d590
Add Recon dashboard tiles
bishwajit-db 8ca71f9
Add Aggregate Recon dashboard tiles
bishwajit-db 3bbd158
Merge branch 'main' into feature/lsql_dashboard
bishwajit-db 9d27325
Resolve review comments
bishwajit-db 202217c
Merge branch 'main' into feature/lsql_dashboard
bishwajit-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/databricks/labs/remorph/resources/reconcile/dashboards/0_1_recon_main.sql
This file contains hidden or 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,31 @@ | ||
| select | ||
| main.recon_id, | ||
| main.source_type, | ||
| main.report_type, | ||
| main.source_table.`catalog` as source_catalog, | ||
| main.source_table.`schema` as source_schema, | ||
| main.source_table.table_name as source_table_name, | ||
| CASE | ||
| WHEN COALESCE(MAIN.SOURCE_TABLE.CATALOG, '') <> '' THEN CONCAT(MAIN.SOURCE_TABLE.CATALOG, '.', MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| ELSE CONCAT(MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| END AS source_table, | ||
| main.target_table.`catalog` as target_catalog, | ||
| main.target_table.`schema` as target_schema, | ||
| main.target_table.table_name as target_table_name, | ||
| CONCAT(MAIN.TARGET_TABLE.CATALOG, '.', MAIN.TARGET_TABLE.SCHEMA, '.', MAIN.TARGET_TABLE.TABLE_NAME) AS target_table, | ||
| metrics.run_metrics.status as status, | ||
| metrics.run_metrics.exception_message as exception, | ||
| metrics.recon_metrics.row_comparison.missing_in_source as missing_in_source, | ||
| metrics.recon_metrics.row_comparison.missing_in_target as missing_in_target, | ||
| metrics.recon_metrics.column_comparison.absolute_mismatch as absolute_mismatch, | ||
| metrics.recon_metrics.column_comparison.threshold_mismatch as threshold_mismatch, | ||
| metrics.recon_metrics.column_comparison.mismatch_columns as mismatch_columns, | ||
| metrics.recon_metrics.schema_comparison as schema_comparison, | ||
| metrics.run_metrics.run_by_user as executed_by, | ||
| main.start_ts as start_ts, | ||
| main.end_ts as end_ts | ||
| from IDENTIFIER(:catalog || '.' || :schema || '.main' ) main | ||
| inner join | ||
| IDENTIFIER(:catalog || '.' || :schema || '.metrics' ) metrics | ||
| on main.recon_table_id = metrics.recon_table_id | ||
| order by metrics.inserted_ts desc, main.recon_id, main.target_table.table_name | ||
31 changes: 31 additions & 0 deletions
31
src/databricks/labs/remorph/resources/reconcile/dashboards/1_0_recon_details_schema.sql
This file contains hidden or 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,31 @@ | ||
| with tmp as (select | ||
| recon_table_id, | ||
| inserted_ts, | ||
| explode(data) as schema_data | ||
| from IDENTIFIER(:catalog || '.' || :schema || '.details' ) | ||
| where recon_type='schema' | ||
| ) | ||
| select | ||
| main.recon_id, | ||
| main.source_table.`catalog` as source_catalog, | ||
| main.source_table.`schema` as source_schema, | ||
| main.source_table.table_name as source_table_name, | ||
| CASE | ||
| WHEN COALESCE(MAIN.SOURCE_TABLE.CATALOG, '') <> '' THEN CONCAT(MAIN.SOURCE_TABLE.CATALOG, '.', MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| ELSE CONCAT(MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| END AS source_table, | ||
| main.target_table.`catalog` as target_catalog, | ||
| main.target_table.`schema` as target_schema, | ||
| main.target_table.table_name as target_table_name, | ||
| CONCAT(MAIN.TARGET_TABLE.CATALOG, '.', MAIN.TARGET_TABLE.SCHEMA, '.', MAIN.TARGET_TABLE.TABLE_NAME) AS target_table, | ||
| schema_data['source_column'] as source_column, | ||
| schema_data['source_datatype'] as source_datatype, | ||
| schema_data['databricks_column'] as databricks_column, | ||
| schema_data['databricks_datatype'] as databricks_datatype, | ||
| schema_data['is_valid'] as is_valid | ||
| from | ||
| IDENTIFIER(:catalog || '.' || :schema || '.main' ) main | ||
| inner join | ||
| tmp | ||
| on main.recon_table_id = tmp.recon_table_id | ||
| order by tmp.inserted_ts desc, main.recon_id, main.target_table |
22 changes: 22 additions & 0 deletions
22
src/databricks/labs/remorph/resources/reconcile/dashboards/1_1_recon_details_pivot.sql
This file contains hidden or 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,22 @@ | ||
| with tmp as (select recon_table_id, inserted_ts ,recon_type, explode(data) as data, | ||
| row_number() over(partition by recon_table_id,recon_type order by recon_table_id) as rn | ||
| from IDENTIFIER(:catalog || '.' || :schema || '.details' ) | ||
| where recon_type != 'schema') | ||
| select main.recon_id, | ||
| main.source_table.`catalog` as source_catalog, | ||
| main.source_table.`schema` as source_schema, | ||
| main.source_table.table_name as source_table_name, | ||
| CASE | ||
| WHEN COALESCE(MAIN.SOURCE_TABLE.CATALOG, '') <> '' THEN CONCAT(MAIN.SOURCE_TABLE.CATALOG, '.', MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| ELSE CONCAT(MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| END AS source_table, | ||
| main.target_table.`catalog` as target_catalog, | ||
| main.target_table.`schema` as target_schema, | ||
| main.target_table.table_name as target_table_name, | ||
| CONCAT(MAIN.TARGET_TABLE.CATALOG, '.', MAIN.TARGET_TABLE.SCHEMA, '.', MAIN.TARGET_TABLE.TABLE_NAME) AS target_table, | ||
| recon_type, key, value, rn | ||
| from tmp | ||
| inner join | ||
| IDENTIFIER(:catalog || '.' || :schema || '.main' ) main | ||
| on main.recon_table_id = tmp.recon_table_id | ||
| lateral view explode(data) exploded_data AS key, value |
26 changes: 26 additions & 0 deletions
26
src/databricks/labs/remorph/resources/reconcile/dashboards/2_1_failed_table_list.sql
This file contains hidden or 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,26 @@ | ||
| select | ||
| main.recon_id, | ||
| main.source_type, | ||
| main.report_type, | ||
| main.source_table.`catalog` as source_catalog, | ||
| main.source_table.`schema` as source_schema, | ||
| main.source_table.table_name as source_table_name, | ||
| CASE | ||
| WHEN COALESCE(MAIN.SOURCE_TABLE.CATALOG, '') <> '' THEN CONCAT(MAIN.SOURCE_TABLE.CATALOG, '.', MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| ELSE CONCAT(MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| END AS source_table, | ||
| main.target_table.`catalog` as target_catalog, | ||
| main.target_table.`schema` as target_schema, | ||
| main.target_table.table_name as target_table_name, | ||
| CONCAT(MAIN.TARGET_TABLE.CATALOG, '.', MAIN.TARGET_TABLE.SCHEMA, '.', MAIN.TARGET_TABLE.TABLE_NAME) AS target_table, | ||
| metrics.run_metrics.status as status, | ||
| metrics.run_metrics.run_by_user as executed_by, | ||
| main.start_ts as start_ts, | ||
| main.end_ts as end_ts, | ||
| date(main.start_ts) as start_date | ||
| from IDENTIFIER(:catalog || '.' || :schema || '.main' ) main | ||
| inner join | ||
| IDENTIFIER(:catalog || '.' || :schema || '.metrics' ) metrics | ||
| on main.recon_table_id = metrics.recon_table_id | ||
| where metrics.run_metrics.status = false | ||
| order by metrics.inserted_ts desc, main.recon_id, main.target_table.table_name |
20 changes: 20 additions & 0 deletions
20
src/databricks/labs/remorph/resources/reconcile/dashboards/2_2_success_table_list.sql
This file contains hidden or 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,20 @@ | ||
| select | ||
| main.recon_id, | ||
| main.source_type, | ||
| main.report_type, | ||
| CASE | ||
| WHEN COALESCE(MAIN.SOURCE_TABLE.CATALOG, '') <> '' THEN CONCAT(MAIN.SOURCE_TABLE.CATALOG, '.', MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| ELSE CONCAT(MAIN.SOURCE_TABLE.SCHEMA, '.', MAIN.SOURCE_TABLE.TABLE_NAME) | ||
| END AS source_table, | ||
| CONCAT(MAIN.TARGET_TABLE.CATALOG, '.', MAIN.TARGET_TABLE.SCHEMA, '.', MAIN.TARGET_TABLE.TABLE_NAME) AS target_table, | ||
| metrics.run_metrics.status as status, | ||
| metrics.run_metrics.run_by_user as executed_by, | ||
| main.start_ts as start_ts, | ||
| main.end_ts as end_ts, | ||
| date(main.start_ts) as start_date | ||
| from IDENTIFIER(:catalog || '.' || :schema || '.main' ) main | ||
| inner join | ||
| IDENTIFIER(:catalog || '.' || :schema || '.metrics' ) metrics | ||
| on main.recon_table_id = metrics.recon_table_id | ||
| where metrics.run_metrics.status = true | ||
| order by metrics.inserted_ts desc, main.recon_id, main.target_table.table_name |
2,905 changes: 2,904 additions & 1 deletion
2,905
...databricks/labs/remorph/resources/reconcile/dashboards/Remorph-Reconciliation.lvdash.json
Large diffs are not rendered by default.
Oops, something went wrong.
sundarshankar89 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Empty file.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.