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
294 stars 119 forks source link

Including metadata column descriptions causes duplicate column name error #170

Closed gavh3 closed 9 months ago

gavh3 commented 1 year ago

Describe the bug

Including metadata column descriptions causes duplicate column name error

Steps to reproduce

I want to be able to provide field descriptions for the metadata columns in the source.yml as such:

        columns:
          - name: value
            description: A JSON field containing the entire message
          - name: metadata_filename
            description: The name of the file provided
          - name: metadata_file_row_number
            description: The row number in the file provided
          - name: _dbt_copied_at
            description: Timestamp when dbt/snowpipe loaded this row

However, this confuses the macro causing a duplicate column name error.

Expected results

Be able to provide field definitions for the metadata columns

Actual results

I get a duplicate column name error

Screenshots and log output

  002025 (42S21): SQL compilation error:
  duplicate column name 'METADATA_FILENAME'

Which database are you using dbt with?

data-blade commented 1 year ago

have you tried specifying the data type:

columns:
  - name: foo
    description: bar
    data_type: string    
github-actions[bot] commented 10 months ago

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

github-actions[bot] commented 9 months ago

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.