Skip to content

fix: quote catalog names in SHOW SCHEMAS commands (#1325)#1332

Merged
sd-db merged 3 commits intodatabricks:mainfrom
aarushisingh04:fix/1325-quote-catalog-in-show-schemas
Feb 26, 2026
Merged

fix: quote catalog names in SHOW SCHEMAS commands (#1325)#1332
sd-db merged 3 commits intodatabricks:mainfrom
aarushisingh04:fix/1325-quote-catalog-in-show-schemas

Conversation

@aarushisingh04
Copy link
Contributor

resolves #1325

Description

when a unity catalog name contains hyphens or other special characters (e.g., data_engineering-uc-dev), SHOW SCHEMAS commands fail with INVALID_IDENTIFIER because the catalog name is not quoted.

fix: added backtick quoting around {{ database }} in the list_schemas_sql and check_schema_exists_sql macros in metadata.sql.

before:

SHOW SCHEMAS IN data_engineering-uc-dev

after:

SHOW SCHEMAS IN `data_engineering-uc-dev`

added 4 unit tests covering normal, hyphenated, and null database names for both macros.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

Signed-off-by: aarushisingh04 <aarushi07.singh@gmail.com>
Copy link
Collaborator

@sd-db sd-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR !!

@sd-db sd-db merged commit 2705a34 into databricks:main Feb 26, 2026
10 checks passed
@mstfkmlbsbdk2023
Copy link

thanks for this PR

@aarushisingh04
Copy link
Contributor Author

@mstfkmlbsbdk2023 happy to help 👍

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.

Catalog names with hyphens not properly quoted in SHOW SCHEMAS commands Github Actions

3 participants