diff --git a/src/databricks/labs/ucx/progress/install.py b/src/databricks/labs/ucx/progress/install.py index 39479f2956..a80ac9027b 100644 --- a/src/databricks/labs/ucx/progress/install.py +++ b/src/databricks/labs/ucx/progress/install.py @@ -55,9 +55,7 @@ def run(self) -> None: self._schema_deployer.deploy_schema() self._schema_deployer.deploy_table("workflow_runs", WorkflowRun) self._schema_deployer.deploy_table("historical", Historical) - self._schema_deployer.deploy_view( - "latest_historical_per_workspace", "queries/views/latest_historical_per_workspace.sql" - ) + self._schema_deployer.deploy_view("objects_snapshot", "queries/views/objects_snapshot.sql") logger.info("Installation completed successfully!") diff --git a/src/databricks/labs/ucx/queries/progress/main/01_0_percentage_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_0_percentage_migration_progress.sql index fbdedf169e..d429af42cc 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_0_percentage_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_0_percentage_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Overall progress (%)' --width 2 */ SELECT ROUND(100 * try_divide(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type IN ('ClusterInfo', 'Grant', 'JobInfo', 'PipelineInfo', 'PolicyInfo', 'Table', 'Udf') diff --git a/src/databricks/labs/ucx/queries/progress/main/01_1_percentage_udf_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_1_percentage_udf_migration_progress.sql index 9207cb719d..f5a883ea31 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_1_percentage_udf_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_1_percentage_udf_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'UDF migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "Udf" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_2_percentage_grant_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_2_percentage_grant_migration_progress.sql index 1b678fe886..cddca0c6d3 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_2_percentage_grant_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_2_percentage_grant_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Grant migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "Grant" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_3_percentage_job_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_3_percentage_job_migration_progress.sql index 0e2149b9d5..ba3d535b11 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_3_percentage_job_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_3_percentage_job_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Job migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "JobInfo" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_4_percentage_cluster_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_4_percentage_cluster_migration_progress.sql index 521c9001cb..4da37b5e72 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_4_percentage_cluster_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_4_percentage_cluster_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Cluster migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "ClusterInfo" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_5_percentage_table_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_5_percentage_table_migration_progress.sql index 9684840805..b3a2e4554e 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_5_percentage_table_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_5_percentage_table_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Table migration progress (%)' --width 2 */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "Table" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_6_percentage_pipeline_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_6_percentage_pipeline_migration_progress.sql index 3e9866ab15..bc2ee6bef9 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_6_percentage_pipeline_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_6_percentage_pipeline_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Pipeline migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "PipelineInfo" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_7_percentage_policy_migration_progress.sql b/src/databricks/labs/ucx/queries/progress/main/01_7_percentage_policy_migration_progress.sql index 667737961e..077be97ffa 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_7_percentage_policy_migration_progress.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_7_percentage_policy_migration_progress.sql @@ -1,5 +1,5 @@ /* --title 'Policy migration progress (%)' */ SELECT ROUND(100 * TRY_DIVIDE(COUNT_IF(SIZE(failures) = 0), COUNT(*)), 2) AS percentage -FROM ucx_catalog.multiworkspace.latest_historical_per_workspace +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = "PolicyInfo" diff --git a/src/databricks/labs/ucx/queries/progress/main/01_8_distinct_failures_per_object_type.sql b/src/databricks/labs/ucx/queries/progress/main/01_8_distinct_failures_per_object_type.sql index 672c826027..00a229d02f 100644 --- a/src/databricks/labs/ucx/queries/progress/main/01_8_distinct_failures_per_object_type.sql +++ b/src/databricks/labs/ucx/queries/progress/main/01_8_distinct_failures_per_object_type.sql @@ -1,7 +1,7 @@ /* --title 'Distinct failures per object type' --width 6 */ with failures AS ( SELECT object_type, explode(failures) AS failure - FROM ucx_catalog.multiworkspace.latest_historical_per_workspace + FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type IN ('ClusterInfo', 'Grant', 'JobInfo', 'PipelineInfo', 'PolicyInfo', 'Table', 'Udf') ) 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 index 3b9314ff17..48c344aa08 100644 --- 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 @@ -1,4 +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 +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = 'Table' AND array_contains(failures, 'Pending migration') diff --git a/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql b/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql index cd8c46fd15..09d47b9c10 100644 --- a/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql +++ b/src/databricks/labs/ucx/queries/progress/main/02_2_migration_status_by_owner_bar_graph.sql @@ -13,7 +13,7 @@ */ WITH owners_with_failures AS ( SELECT owner - FROM ucx_catalog.multiworkspace.latest_historical_per_workspace + FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = 'Table' AND array_contains(failures, 'Pending migration') ) 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 index 28c4f3dfee..27dc9f1082 100644 --- 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 @@ -1,4 +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 +FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = 'Table' AND SIZE(failures) == 0 diff --git a/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql b/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql index 4788946377..8252838b23 100644 --- a/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql +++ b/src/databricks/labs/ucx/queries/progress/main/02_4_migration_status_by_owner_overview.sql @@ -1,7 +1,7 @@ /* --title 'Overview' --description 'Tables and views migration' --width 5 */ WITH migration_statuses AS ( SELECT * - FROM ucx_catalog.multiworkspace.latest_historical_per_workspace + FROM ucx_catalog.multiworkspace.objects_snapshot WHERE object_type = 'Table' AND SIZE(failures) == 0 ) diff --git a/src/databricks/labs/ucx/queries/views/latest_historical_per_workspace.sql b/src/databricks/labs/ucx/queries/views/objects_snapshot.sql similarity index 100% rename from src/databricks/labs/ucx/queries/views/latest_historical_per_workspace.sql rename to src/databricks/labs/ucx/queries/views/objects_snapshot.sql