Open T-Dunlap opened 5 months ago
yikes! this is special column. quick question is the column have single quotes ('
) or backticks (`
)?
I wasn't able to reproduce, in fact it worked for me. I suspect there might be something else going on?
Here's what I did. I used the people_a.csv
from this repo (link), but the file shouldn't matter since data isn't checked when the CREATE EXTERNAL TABLE
statement is run, only when it's queried.
Anyway the below YAML generated the below SQL (can be found in logs/dbt.log
). You can see the column name is properly enclosed within double quotes ("
) as per Snowflake guidance.
# sources.yml
version: 2
sources:
- name: snowflake_external
schema: "{{ target.schema }}"
loader: S3
tables:
- name: people_csv_unpartitioned
external:
location: '@{{ target.schema }}.dbt_external_tables_testing/csv'
file_format: '( type = csv skip_header = 1 )'
columns:
- name: "EXAMPLE`COLUMN`2"
data_type: varchar(255)
quote: true
create or replace external table DBT_TEST.dbt_external_tables_integration_tests_snowflake.people_csv_unpartitioned(
"EXAMPLE`COLUMN`2" varchar(255) as ((case when is_null_value(value:c1) or lower(value:c1) = 'null' then null else value:c1 end)::varchar(255))
)
location = @dbt_external_tables_integration_tests_snowflake.dbt_external_tables_testing/csv
Describe the bug
We're encountering an issue with the
quote:true
column configuration of one of our external tables. It won't accept a column name[EXAMPLE'COLUMN'2]
See the quote: true property example.Steps to reproduce
In our yml file for our external tables, we're applying the quote:true property to our column. See example below
Expected results
We expect that the package will correctly identify the
[EXAMPLE'COLUMN'2]
as a valid column name and create the external table accordingly.Actual results
We received the following error
Screenshots and log output
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
The output of
python --version
:Additional context