dbt-labs / dbt-external-tables

dbt macros to stage external sources
https://hub.getdbt.com/dbt-labs/dbt_external_tables/latest/
Apache License 2.0
298 stars 120 forks source link

alias column for snowflake external table #257

Closed cakkinep closed 5 months ago

cakkinep commented 7 months ago

Description & motivation

resolves: #213 These changes will specifically solve the issue with snowflake tables where the underlying file format or table format has a column named VALUE ( error below) . In general this change will allow aliasing column name for any reason.

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

More about the changes:

Checklist

cakkinep commented 7 months ago

@jeremyyeo , the CI seems to be failing, it is not related to this PR

wjhrdy commented 7 months ago

This is useful. Thanks for the work on this.

thomas-vl commented 7 months ago

@jeremyyeo , the CI seems to be failing, it is not related to this PR

CI fails because of a protobuf issue in DBT Core, I have created a PR with a temporary fix that will resolve this issue: https://github.com/dbt-labs/dbt-external-tables/pull/258

cakkinep commented 5 months ago

@dataders Added integration test to validate column alias.