-
Notifications
You must be signed in to change notification settings - Fork 88
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
Update existing and add new SQL queries to the assessment step dashboard #269
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3edefad
Enhance Assessment Dashboard (#268)
larsgeorge-db 5c97fe2
Added Dashboard testing
FastLee 713a41b
Added Dashboard testing and two more queries
FastLee 4fdbff3
Removed integration test and added queries.
FastLee 437f083
Added Clusters and Jobs queries
FastLee a61cd6c
Added Clusters and Jobs queries
FastLee 7030b35
Important Commit!!!
FastLee b0e469c
Fixed a couple of report issues.
FastLee 8564de8
Fix viz columns and format SQL code.
larsgeorge-db 9488221
Applied feedback and added counter viz support.
larsgeorge-db 17347f0
Applied feedback, rearranged dashboard, fixed empty widget title
larsgeorge-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
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,16 @@ | ||
-- viz type=table, name=Table Types, columns=database,name,type,format,table_view,storage,is_delta,location | ||
-- widget title=Table Types, col=0, row=3, size_x=6, size_y=6 | ||
SELECT `database`, | ||
name, | ||
object_type AS type, | ||
UPPER(table_format) AS format, | ||
IF(object_type IN ("MANAGED", "EXTERNAL"), "TABLE", "VIEW") AS table_view, | ||
CASE | ||
WHEN STARTSWITH(location, "/dbfs/") | ||
AND NOT STARTSWITH(location, "/dbfs/mnt") THEN "DBFS ROOT" | ||
WHEN STARTSWITH(location, "/dbfs/mnt") THEN "DBFS MOUNT" | ||
ELSE "EXTERNAL" | ||
END AS storage, | ||
IF(format = "delta", "Yes", "No") AS is_delta, | ||
location | ||
FROM $inventory.tables |
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,9 @@ | ||
-- viz type=table, name=Clusters, columns=cluster_id,cluster_name,creator,compatible,failures | ||
-- widget title=Clusters, col=0, row=25, size_x=6, size_y=8 | ||
SELECT cluster_id, | ||
cluster_name, | ||
creator, | ||
IF(success = 1, "Compatible", "Incompatible") AS compatible, | ||
failures | ||
FROM $inventory.clusters | ||
WHERE NOT STARTSWITH(cluster_name, "job-") |
4 changes: 4 additions & 0 deletions
4
src/databricks/labs/ucx/assessment/queries/count_total_databases.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,4 @@ | ||
-- viz type=counter, name=Total Database Count, counter_label=Total Databases, value_column=count_total_databases | ||
-- widget col=0, row=0, size_x=1, size_y=3 | ||
SELECT COUNT(DISTINCT `database`) AS count_total_databases | ||
FROM hive_metastore.ucx.tables |
4 changes: 4 additions & 0 deletions
4
src/databricks/labs/ucx/assessment/queries/count_total_tables.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,4 @@ | ||
-- viz type=counter, name=Total Table Count, counter_label=Total Tables, value_column=count_total_tables | ||
-- widget col=1, row=0, size_x=1, size_y=3 | ||
SELECT count(*) AS count_total_tables | ||
FROM $inventory.tables |
25 changes: 25 additions & 0 deletions
25
src/databricks/labs/ucx/assessment/queries/database_summary.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,25 @@ | ||
-- viz type=table, name=Database Summary, columns=database,tables,views,dbfs_root,delta_tables,upgrade | ||
-- widget title=Database Summary, col=0, row=9, size_x=6, size_y=8 | ||
SELECT `database`, | ||
SUM(is_table) AS tables, | ||
SUM(is_view) AS views, | ||
SUM(is_dbfs_root) AS dbfs_root, | ||
SUM(is_delta) AS delta_tables, | ||
CASE | ||
WHEN (SUM(is_dbfs_root)/SUM(is_table) > .3) THEN "Asset Replication Required" | ||
WHEN (SUM(is_delta)/SUM(is_table) < .7) THEN "Some Non Delta Assets" | ||
ELSE "In Place Sync" | ||
END AS upgrade | ||
FROM | ||
(SELECT DATABASE, | ||
name, | ||
object_type, | ||
UPPER(table_format) AS format, | ||
LOCATION, | ||
IF(object_type IN ("MANAGED", "EXTERNAL"), 1, 0) AS is_table, | ||
IF(object_type = "VIEW", 1, 0) AS is_view, | ||
IF(STARTSWITH(location, "/dbfs/") AND NOT STARTSWITH(location, "/dbfs/mnt"), 1, 0) AS is_dbfs_root, | ||
IF(UPPER(format) = "DELTA", 1, 0) AS is_delta | ||
FROM $inventory.tables) | ||
GROUP BY `database` | ||
ORDER BY `database` |
4 changes: 4 additions & 0 deletions
4
src/databricks/labs/ucx/assessment/queries/external_locations.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,4 @@ | ||
-- viz type=table, name=External Locations, columns=location | ||
-- widget title=External Locations, col=0, row=17, size_x=3, size_y=8 | ||
SELECT location | ||
FROM hive_metastore.ucx.external_locations |
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,9 @@ | ||
-- viz type=table, name=Jobs, columns=job_id,job_name,creator,compatible,failures | ||
-- widget title=Jobs, col=0, row=33, size_x=6, size_y=8 | ||
SELECT job_id, | ||
job_name, | ||
creator, | ||
IF(success=1, "Compatible", "Incompatible") AS compatible, | ||
failures | ||
FROM $inventory.jobs | ||
WHERE job_name not like '[UCX]%' |
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,5 @@ | ||
-- viz type=table, name=Mount Points, columns=name,source | ||
-- widget title=Mount Points, col=3, row=17, size_x=3, size_y=8 | ||
SELECT name, | ||
source | ||
FROM hive_metastore.ucx.mounts |
11 changes: 0 additions & 11 deletions
11
src/databricks/labs/ucx/assessment/queries/total_tables.sql
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/databricks/labs/ucx/assessment/queries/workspace_access_total_groups.sql
This file was deleted.
Oops, something went wrong.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the preprovisioned warehouse through environment variable, no need to create new warehouse to test a dashboard.