Skip to content

Commit

Permalink
Deploy static views needed by #1123 interactive dashboard (#1139)
Browse files Browse the repository at this point in the history
## Changes
Deploy views `misc_patterns_vw` and `code_patterns_vw` that should have
been deployed with #1123 and fixes the `interactive` dashboard queries.

### Functionality 

- [ ] added relevant user documentation
- [ ] added new CLI command
- [ ] modified existing command: `databricks labs ucx ...`
- [ ] added a new workflow
- [ ] modified existing workflow: `...`
- [x] added a new table
- [ ] modified existing table: `...`

### Tests
<!-- How is this tested? Please see the checklist below and also
describe any other relevant tests -->

- [x] manually tested
- [ ] added unit tests
- [ ] added integration tests
- [x] verified on staging environment (screenshot attached)
- [ ] 

![image](https://github.com/databrickslabs/ucx/assets/1122251/1e5a64cf-52f9-414b-b213-2a1dc3c58841)
  • Loading branch information
dmoore247 authored Mar 27, 2024
1 parent 1930792 commit b4b3b52
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/databricks/labs/ucx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def deploy_schema(sql_backend: SqlBackend, inventory_schema: str):
deployer.deploy_view("objects", "queries/views/objects.sql")
deployer.deploy_view("grant_detail", "queries/views/grant_detail.sql")
deployer.deploy_view("table_estimates", "queries/views/table_estimates.sql")
deployer.deploy_view("misc_patterns", "queries/views/misc_patterns.sql")
deployer.deploy_view("code_patterns", "queries/views/code_patterns.sql")


def extract_major_minor(version_string):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ iteractive_cluster_commands (
WHERE a.event_date >= DATE_SUB(CURRENT_DATE(), 90)
),
misc_patterns(
SELECT commandLanguage, dbr_version_major, dbr_version_minor, dbr_type, pattern, issue FROM $inventory.misc_patterns_vw
SELECT commandLanguage, dbr_version_major, dbr_version_minor, dbr_type, pattern, issue FROM $inventory.misc_patterns
),
pattern_matcher(
SELECT
array_except(array(p.issue, lp.issue, rv.issue,dbr_type.issue), array(null)) issues,
a.*
FROM iteractive_cluster_commands a
LEFT OUTER JOIN $inventory.code_patterns_vw p
LEFT OUTER JOIN $inventory.code_patterns p
ON a.commandLanguage in ('python','scala')
AND contains(a.commandText, p.pattern)
LEFT OUTER JOIN misc_patterns lp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ iteractive_cluster_commands (
WHERE a.event_date >= DATE_SUB(CURRENT_DATE(), 90)
),
misc_patterns(
SELECT commandLanguage, dbr_version_major, dbr_version_minor, dbr_type, pattern, issue FROM $inventory.misc_patterns_vw
SELECT commandLanguage, dbr_version_major, dbr_version_minor, dbr_type, pattern, issue FROM $inventory.misc_patterns
),
pattern_matcher(
SELECT
explode(array_except(array(p.issue, lp.issue, rv.issue,dbr_type.issue), array(null))) issue,
a.*
FROM iteractive_cluster_commands a
LEFT OUTER JOIN $inventory.code_patterns_vw p
LEFT OUTER JOIN $inventory.code_patterns p
ON a.commandLanguage in ('python','scala')
AND contains(a.commandText, p.pattern)
LEFT OUTER JOIN misc_patterns lp
Expand Down

0 comments on commit b4b3b52

Please sign in to comment.