Skip to content

Commit 6ba71a1

Browse files
Renamed columns in assessment SQL queries to use actual names, not aliases (#983)
## Changes <!-- Summary of your changes that are easy to understand. Add screenshots when necessary --> Aliases are usually not allowed in projections (as they are replaced later in the query execution phases). While the DBSQL was smart enough to handle the references via aliases, for some setups this results in an error. Changing column references to use actual names fixes this. ### Linked issues <!-- DOC: Link issue with a keyword: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved. See https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword --> Resolves #980 ### Functionality - [ ] added relevant user documentation - [ ] added new CLI command - [ ] modified existing command: `databricks labs ucx ...` - [ ] added a new workflow - [ ] modified existing workflow: `...` - [ ] 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 - [ ] verified on staging environment (screenshot attached)
1 parent ec6adf6 commit 6ba71a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/databricks/labs/ucx/queries/assessment/main/03_0_database_summary.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WITH table_stats AS (
1818
WHEN STARTSWITH(location, "adl") THEN 1
1919
ELSE 0
2020
END AS is_unsupported,
21-
IF(format = "DELTA", 1, 0) AS is_delta
21+
IF(table_format = "DELTA", 1, 0) AS is_delta
2222
FROM $inventory.tables
2323
), database_stats AS (
2424
SELECT `database`,

src/databricks/labs/ucx/queries/assessment/main/05_0_all_tables.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SELECT CONCAT(tables.`database`, '.', tables.name) AS name,
1414
WHEN STARTSWITH(location, "adl") THEN "UNSUPPORTED"
1515
ELSE "EXTERNAL"
1616
END AS storage,
17-
IF(format = "DELTA", "Yes", "No") AS is_delta,
17+
IF(table_format = "DELTA", "Yes", "No") AS is_delta,
1818
location,
1919
CASE
2020
WHEN size_in_bytes IS null THEN "Non DBFS Root"

0 commit comments

Comments
 (0)