Skip to content

[Bug] dbt-snowflake doesn't handle lowercase table names from SHOW OBJECTS #1480

Description

@dataders

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Which packages are affected?

  • dbt-adapters
  • dbt-tests-adapter
  • dbt-athena
  • dbt-athena-community
  • dbt-bigquery
  • dbt-postgres
  • dbt-redshift
  • dbt-snowflake
  • dbt-spark

Current Behavior

via @ameyakhedekar (community slack thread)

if you use a Catalog-Linked Database (CLD) attached to Unity Catalog, you might encounter this error

Compilation Error in model dbt found an approximate match. Please delete ...  

the working hypothesis is that, for time immemorial, Snowflake's SHOW OBJECTS would return case-insensitive tables names which means dbt receives upper-cased identifiers (provided there was now account-level override).

However, tables in the CLD pointing to Unity Catalog return case-sensitive identifiers by default

We suspect this is what is causing the approximate match

Expected Behavior

dbt-snowflake should account for potential case-sensitivity in the results of SHOW OBJECTS as a result of external catalog identifiers

Steps To Reproduce

try to materialize a table to a CLD that points to Unity Catalog

Relevant log output

Environment

- OS:
- Python:
- dbt-adapters:
- <adapter>:

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:icebergIssues related to Iceberg supportpkg:dbt-snowflakeIssue affects dbt-snowflaketype:bugSomething isn't working as documented

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions