-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add include_data_types flag to generate_source macro (#76)
* Add include_data_types flag to generate_source macro * Add test for include_data_types * Fix test_generate_source_all_args for Redshift * Fix test_generate_source_all_args for Snowflake * Fix int types test_generate_source_all_args for Snowflake * Fix test_generate_source_all_args for BigQuery * Fix typo * Fix typo * trying to avoid db-specific type defenitions * Dummy fix * Dummy fix * Dummy fix * Dummy fix * Revert to initial schema I've tried several approaches to generate the exact text, but it's not working. So returninig tests to 3a1267b state. * Example of generating data types for columns * Update changelog * Remove comment [skip ci] Co-authored-by: Doug Beatty <doug.beatty@dbtlabs.com>
- Loading branch information
Showing
6 changed files
with
45 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{%- macro integer_type_value() -%} | ||
{%- if target.type == "snowflake" -%} | ||
NUMBER(38,0) | ||
{%- elif target.type == "bigquery" -%} | ||
INT64 | ||
{%- else -%} | ||
INTEGER | ||
{%- endif -%} | ||
{%- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{%- macro text_type_value(text_length) -%} | ||
{%- if target.type == "redshift" -%} | ||
CHARACTER VARYING({{ text_length }}) | ||
{%- elif target.type == "snowflake" -%} | ||
CHARACTER VARYING(16777216) | ||
{%- elif target.type == "bigquery" -%} | ||
STRING | ||
{%- else -%} | ||
TEXT | ||
{%- endif -%} | ||
{%- 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