Skip to content

alias for column property not allowed for AzureDB #356

@epacheco-sd

Description

@epacheco-sd

Describe the bug

We need to change the name of a column in order to be loaded into Snowflake, from AzureDB. The column original name is VALUE, this generates a SQL error and at the same time is in conflict with the auto generated metadata column. We are attempting to use the alias option in the column definition stage as documented in the snowflake.yml example

Steps to reproduce

by running dbt run-operation stage_external_sources with the source defined as follows in the .YML file:
...
columns:

  • name: VALUE
    quoted: true / false (tested both options)
    alias: AMOUNT
    data_type: TEXT
    ...

Expected results

Expected result is for the command to run successfully and load the VALUE data in NEW_VALUE column

Actual results

Command execution fails with error
18:01:44 Encountered an error while running operation: Database Error
091311 (42601): SQL compilation error:
'VALUE' cannot be used as a column name for external tables.

When the .YML source file is built it prompts the warning that property is not allowed

Image

Is there an option to rename a column for AzureDB?

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

The contents of your packages.yml file:

Which database are you using dbt with?

  • redshift
  • snowflake
  • [x ] other (specify: AzureDB)

The output of dbt --version:

versionless

The operating system you're using:
dbt cloud

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions