Quote catalog/schema identifiers in grant_permissions.py SQL - #268
Open
paulelbacha wants to merge 1 commit into
Open
paulelbacha wants to merge 1 commit into
paulelbacha wants to merge 1 commit into
Conversation
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #266
scripts/grant_permissions.pyinterpolated the target catalog/schema into SQL unquoted in four places (_ensure_schema,_ensure_volume, the_ensure_tablesDDL templating, and the CDFALTER TABLE), so any catalog with a hyphen in its name (e.g.my-team-demos) failed the install with an identifier parse error atCREATE 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.