diff --git a/src/databricks/labs/ucx/queries/progress/main/02_1_pending_migration_data_objects.sql b/src/databricks/labs/ucx/queries/progress/main/02_1_pending_migration_data_objects.sql new file mode 100644 index 0000000000..bfb9784f4c --- /dev/null +++ b/src/databricks/labs/ucx/queries/progress/main/02_1_pending_migration_data_objects.sql @@ -0,0 +1,4 @@ +/* --title 'Pending migration' --description 'Total number of tables and views' --height 6 */ +SELECT COUNT(*) AS count +FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +WHERE object_type = "migration_status" AND SIZE(failures) > 0 diff --git a/src/databricks/labs/ucx/queries/progress/main/02_1_migration_status_by_owner_bar_graph.sql b/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql similarity index 87% rename from src/databricks/labs/ucx/queries/progress/main/02_1_migration_status_by_owner_bar_graph.sql rename to src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql index 696786b588..0e092d9428 100644 --- a/src/databricks/labs/ucx/queries/progress/main/02_1_migration_status_by_owner_bar_graph.sql +++ b/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql @@ -1,5 +1,7 @@ /* ---title 'Tables and views not migrated' +--title 'Pending migration' +--description 'Tables and views per owner' +--width 5 --overrides '{"spec": { "version": 3, "widgetType": "bar", diff --git a/src/databricks/labs/ucx/queries/progress/main/02_3_migrated_data_objects.sql b/src/databricks/labs/ucx/queries/progress/main/02_3_migrated_data_objects.sql new file mode 100644 index 0000000000..c74313a424 --- /dev/null +++ b/src/databricks/labs/ucx/queries/progress/main/02_3_migrated_data_objects.sql @@ -0,0 +1,4 @@ +/* --title 'Migrated' --description 'Total number of tables and views' --height 6 */ +SELECT COUNT(*) AS count +FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +WHERE object_type = "migration_status" AND SIZE(failures) == 0 diff --git a/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_overview.sql b/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql similarity index 83% rename from src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_overview.sql rename to src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql index 9d997df927..1be1b8ac7a 100644 --- a/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_overview.sql +++ b/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql @@ -1,4 +1,4 @@ -/* --title 'Tables and views migration completion (%)' --description 'Per owner' */ +/* --title 'Overview' --description 'Tables and views migration' --width 5 */ WITH migration_statuses AS ( SELECT * FROM ucx_catalog.multiworkspace.latest_historical_per_workspace diff --git a/tests/integration/queries/test_migration_progress.py b/tests/integration/queries/test_migration_progress.py index 60f716a975..d9d631d1c1 100644 --- a/tests/integration/queries/test_migration_progress.py +++ b/tests/integration/queries/test_migration_progress.py @@ -320,11 +320,19 @@ def test_migration_progress_dashboard( ("01_6_percentage_pipeline_migration_readiness", [Row(percentage=50.0)]), ("01_7_percentage_policy_migration_readiness", [Row(percentage=50.0)]), ( - "02_1_migration_status_by_owner_bar_graph", + "02_2_migrated_data_objects", + [Row(count=5)], + ), + ( + "02_2_pending_migration_data_objects", + [Row(count=5)], + ), + ( + "02_3_migration_status_by_owner_bar_graph", [Row(owner="Andrew", count=1), Row(owner="Cor", count=4)], ), ( - "02_2_migration_status_by_owner_overview", + "02_4_migration_status_by_owner_overview", [ Row(owner="Andrew", percentage=50.0, total=2, total_migrated=1, total_not_migrated=1), Row(owner="Cor", percentage=42.857142857142854, total=7, total_migrated=3, total_not_migrated=4),