-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to infer schemas on Snowflake (#211)
* Add support to infer schemas on Snowflake * Add tests and example for Snowflake infer schema
- Loading branch information
Showing
5 changed files
with
101 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
{% macro snowflake__prep_external() %} | ||
|
||
{% set external_stage = target.schema ~ '.dbt_external_tables_testing' %} | ||
{% set parquet_file_format = target.schema ~ '.dbt_external_tables_testing_parquet' %} | ||
|
||
{% set create_external_stage %} | ||
{% set create_external_stage_and_file_format %} | ||
|
||
begin; | ||
create or replace stage | ||
{{ external_stage }} | ||
url = 's3://dbt-external-tables-testing'; | ||
|
||
create or replace file format {{ parquet_file_format }} type = parquet; | ||
commit; | ||
|
||
{% endset %} | ||
|
||
{% do log('Creating external stage ' ~ external_stage, info = true) %} | ||
{% do run_query(create_external_stage) %} | ||
{% do log('Creating parquet file format ' ~ parquet_file_format, info = true) %} | ||
{% do run_query(create_external_stage_and_file_format) %} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Can't i reuse the orginal columns as one of partitions? If this is right at the top, it will not be able to identify partitions without creating expressions.