You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kyleburke-meq
No, I only used name and alias, but when that did not work as expected, I used name and expression. Unfortunately, that makes me have to replicate the logic in the package for null handling, which I would like to avoid for simply renaming a column.
Describe the bug
When using the alias for a column in a Snowflake external table, the alias used both as a column name as well as within the column expression
Steps to reproduce
sources.yml:
version: 2
sources:
name: datalake
schema: datalake
tables:
external:
location: '@datalake.batch_load_stage/'
file_format: datalake.parquet_format
auto_refresh: true
integration:
columns:
alias: created_at_utc
data_type: TIMESTAMP_NTZ
Expected results
I expected the alias to be used in either the expression, or the column name - not both places.
create or replace external table .datalake.external_table_test( created_at_utc TIMESTAMP_NTZ as ((case when is_null_value(value:FILECREATETIME) or lower(value:FILECREATETIME) = 'null' then null else value:FILECREATETIMEend)::TIMESTAMP_NTZ) ) location = @datalake.batch_load_stage/ auto_refresh = True
Actual results
The alias is used in the expression and as the column name in the table resulting in the column always returning null values.
Screenshots and log output
Output from log:
create or replace external table .datalake.external_table_test( created_at_utc TIMESTAMP_NTZ as ((case when is_null_value(value:created_at_utc) or lower(value:created_at_utc) = 'null' then null else value:created_at_utc end)::TIMESTAMP_NTZ) ) location = @datalake.batch_load_stage/ auto_refresh = True
System information
The contents of your
packages.yml
file:packages:
version: 1.1.1
version: 0.9.0
version: 0.11.0
Which database are you using dbt with?
The output of
dbt --version
:2024.8.235 (from dbt cloud using versionless)
The operating system you're using:
dbt cloud
The output of
python --version
:N/A
Additional context
The text was updated successfully, but these errors were encountered: