Skip to content

Quote catalog/schema identifiers in grant_permissions.py SQL - #268

Open
paulelbacha wants to merge 1 commit into
databricks-solutions:mainfrom
paulelbacha:feature/266-quote-catalog-identifiers
Open

paulelbacha wants to merge 1 commit into
databricks-solutions:mainfrom
paulelbacha:feature/266-quote-catalog-identifiers

Conversation

@paulelbacha

Copy link
Copy Markdown

Closes #266

scripts/grant_permissions.py interpolated the target catalog/schema into SQL unquoted in four places (_ensure_schema, _ensure_volume, the _ensure_tables DDL templating, and the CDF ALTER TABLE), so any catalog with a hyphen in its name (e.g. my-team-demos) failed the install with an identifier parse error at CREATE SCHEMA. This backtick-quotes the identifiers everywhere they are interpolated.

Tested: re-ran the full install against a hyphenated catalog in a field workspace — schema, artifact volume, and all GSO tables (including the CDF ALTERs) created cleanly; the bundle deploy completed and the app runs. No behavior change for unhyphenated catalogs.

Note for maintainers: the same unquoted pattern may also exist on the consumer side inside the GSO optimization job (GSO_CATALOG) — this PR only covers the install path.

This pull request and its description were written by Isaac.

CREATE SCHEMA/VOLUME, the table DDL templating, and the CDF ALTER all
interpolated the catalog and schema names unquoted, so any catalog with
a hyphen in its name (e.g. my-team-demos) failed the install with an
identifier parse error. Backtick-quote them everywhere they are
interpolated into SQL.

Closes databricks-solutions#266

Co-authored-by: Isaac

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install fails on hyphenated catalog names: grant_permissions.py builds unquoted SQL identifiers

1 participant