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

Create schema for external tables when it is not there. #167

Closed guillesd closed 1 year ago

guillesd commented 1 year ago

Description & motivation

Addresses https://github.com/dbt-labs/dbt-external-tables/issues/100 for the following adapters:

Checklist

Details

The create_external_schema macro is created, which takes in a source_node and creates the schema. The macro is added to the build_plan so that the process is more explicit (and logged). This macro is common for Snowflake, Spark and BigQuery and is overwritten in the SQL Server adapter. I did not use the create_schema default macro of dbt since it takes in a different argument than a source_node and I did not want to overwrite such a core macro for this.

Hope you liked my approach!

guillesd commented 1 year ago

@jeremyyeo tagging you for visibility! @pgoslatara

guillesd commented 1 year ago

@jeremyyeo does this need something to be merged?

guillesd commented 1 year ago

@jeremyyeo Fixed the wrong reference to the docs. Anything else?

taskooh commented 1 year ago

Hello, I am waiting for this PR to be merged, but is there any problem?

taskooh commented 1 year ago

@jeremyyeo @jtcohen6 Hello, when will this PR Merged? I'm waiting for this feature

jeremyyeo commented 1 year ago

Thanks @guillesd - appreciate the contribution and apologies for taking forever to merge this :P