Skip to content

materialization_view_fabric macro is not able to find correct relation when re-running a dbt model #236

Open

Description

Description

I'm running into this case where:

  • a model was first materialized as view
  • then changed to materialized as table
  • then when I try dbt run that model again (with existing materialization type still = table) dbt returns this error
Compilation Error in model stg__transaction_lines (models/staging/stg__transaction_lines.sql)
  When searching for a relation, dbt found an approximate match. Instead of guessing 
  which relation to use, dbt will move on. Please delete "DB_WG_BI"."dbt_staging"."stg__transaction_lines", or rename it to be less ambiguous.
  Searched for: "db_wg_bi"."dbt_staging"."stg__transaction_lines"
  Found: "DB_WG_BI"."dbt_staging"."stg__transaction_lines"
  
  > in macro materialization_table_fabric (macros/materializations/models/table/table.sql)
  > called by model stg__transaction_lines (models/staging/stg__transaction_lines.sql)

Image

Expected behavior

  • earlier I was running this model alright without dbt throwing a weird notice around schema upper/lower case. But based on the error here seems like dbt-fabric materialization macro is searching for a lower cased schema (while it should have respected the casing of the original schema), drop that object, then rebuild.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions