dbt_packages - dbt_external_tables

Hello Everyone, I’m trying to create an external table in my snowflake environment using the dbt_external_tables package, I’ve created the .yml into my tree.

image

but seems like when I run dbt run-operation stage_external_sources it is not reading my yml, even including a lot of typos, It doesn’t return an error, what I’m missing, help me, please!!

yml example:

version: 2

sources:
- name: mydb
  database: mydb
  schema: myschema
  loader: S3
  tables:
    - name: desired_externaltable_name
      ext_full_refresh: true
      description: >
      external:
      location: "@stage_example" ##reference an existing external stage 
      file_format: >
        (TYPE = CSVdawdawd COMPRESSION = AUTO FIELD_DELIMITER = ',' SKIP_HEADER = 1)
      columns:
        - name: ID ## you can input any name
          data_type: varchar ## best to use varchar for all

Let me know if you need any further information, thanks in advance.

Nvm, just figured out that it was my YML file that was incorrect, the indentation! dbt should have an error message or warning for that, wasted a long time before figure out!

1 Like

Some things that jump out at me:

  • location and file_format should be further indented
  • You had a > as your description, with no other content. I don’t know if that’s legal YAML - you could just leave out description if you wanted.
  • what is the dawdawd after CSV in the file_format block?

Try this - I haven’t used the external tables package myself so don’t know if this is going to work, but it is more cleaned up:

version: 2

sources:
- name: mydb
  database: mydb
  schema: myschema
  loader: S3
  tables:
    - name: desired_externaltable_name
      ext_full_refresh: true
      description: A description of the table
      external:
        location: "@stage_example" ##reference an existing external stage 
        file_format: >
          (TYPE = CSVdawdawd COMPRESSION = AUTO FIELD_DELIMITER = ',' SKIP_HEADER = 1)
      columns:
        - name: ID ## you can input any name
          data_type: varchar ## best to use varchar for all
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.