-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Changes <!-- Summary of your changes that are easy to understand. Add screenshots when necessary --> ### 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 #871 Related PR: - #985 ### 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 - [X] modified existing table: `ucx.tables` ### 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) ![image](https://github.com/databrickslabs/ucx/assets/23179165/980bd9be-fc36-405f-b21b-186629097a92) ![image](https://github.com/databrickslabs/ucx/assets/23179165/7e81cd04-a5eb-4944-a43e-d0a89d794bca)
- Loading branch information
Showing
5 changed files
with
56 additions
and
3 deletions.
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
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
18 changes: 18 additions & 0 deletions
18
src/databricks/labs/ucx/upgrades/v0.19.0_add_is_partitioned_column.py
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,18 @@ | ||
# pylint: disable=invalid-name | ||
|
||
import logging | ||
|
||
from databricks.labs.blueprint.installation import Installation | ||
from databricks.sdk import WorkspaceClient | ||
|
||
from databricks.labs.ucx.config import WorkspaceConfig | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def upgrade(installation: Installation, ws: WorkspaceClient): | ||
config = installation.load(WorkspaceConfig) | ||
warehouse_id = str(config.warehouse_id) | ||
sql = f"ALTER TABLE {config.inventory_database}.tables ADD COLUMN is_partitioned BOOLEAN" | ||
ws.statement_execution.execute_statement(sql, warehouse_id=warehouse_id) | ||
installation.save(config) |
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