-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support more sources and targets (#14)
* added target options to write to Snowflake target * addes support for ingestion job to write to Snowflake target #10 * added support for merge/insert to load to other targets #11 * override get strategi to make config options insensitive * improved error message for unsupported types #7 * added type dict options support * added add_missing_columns option to snowflake transformation options * added target_type to the models according to the new syntax * changed column_transformations data type * made default Datalake for target_type * corrected typo in options, made made target_connection required * v0.2.2 --------- Co-authored-by: Tanya Shemet <tanyshak@gmail.com>
- Loading branch information
Showing
14 changed files
with
163 additions
and
81 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 +1 @@ | ||
version = "0.2.1" | ||
version = "0.2.2" |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
Target_options = { | ||
"datalake": { | ||
"globally_unique_keys": {"type": "boolean", "editable": False, "optional": True}, | ||
"storage_connection": {"type": "identifier", "editable": False, "optional": True}, | ||
"storage_location": {"type": "text", "editable": False, "optional": True}, | ||
"compute_cluster": {"type": "identifier", "editable": True, "optional": True}, | ||
"compression": {"type": "value", "editable": True, "optional": True}, | ||
"compaction_processes": {"type": "integer", "editable": True, "optional": True}, | ||
"disable_compaction": {"type": "boolean", "editable": True, "optional": True}, | ||
"retention_date_partition": {"type": "text", "editable": True, "optional": True}, | ||
"table_data_retention": {"type": "text", "editable": True, "optional": True}, | ||
"column_data_retention": {"type": "text", "editable": True, "optional": True}, | ||
"comment": {"type": "text", "editable": True, "optional": True} | ||
}, | ||
"materialized_view": { | ||
"storage_connection": {"type": "identifier", "editable": False, "optional": True}, | ||
"storage_location": {"type": "text", "editable": False, "optional": True}, | ||
"max_time_travel_duration": {"type": "integer", "editable": True, "optional": True}, | ||
"compute_cluster": {"type": "identifier", "editable": True, "optional": True}, | ||
}, | ||
"snowflake": { | ||
"column_transformations": {"type": "dict", "editable": False, "optional": True}, | ||
"deduplicate_with": {"type": "dict", "editable": False, "optional": True}, | ||
"exclude_columns": {"type": "list", "editable": False, "optional": True}, | ||
"create_table_if_missing": {"type": "boolean", "editable": False, "optional": True}, | ||
"write_interval": {"type": "integer", "editable": False, "optional": True}, | ||
} | ||
} |
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
12 changes: 10 additions & 2 deletions
12
dbt/include/upsolver/macros/materializations/incremental/create_copy_job.sql
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,16 +1,24 @@ | ||
{% macro get_create_copy_job_sql(job_identifier, sql, table, sync, options, source) -%} | ||
{% macro get_create_copy_job_sql(job_identifier, sql, into_relation, sync, options, source, target_type) -%} | ||
|
||
{% set connection_identifier = adapter.get_connection_from_sql(sql) %} | ||
{% set job_options, source_options = adapter.separate_options(options, source) %} | ||
{%- if target_type != 'datalake' -%} | ||
{% set target_options = adapter.enrich_options(options, target_type, 'target_options') %} | ||
{% set target_type = target_type %} | ||
{%- else -%} | ||
{% set target_options = {} %} | ||
{% set target_type = '' %} | ||
{%- endif -%} | ||
|
||
CREATE | ||
{% if sync %} | ||
SYNC | ||
{% endif %} | ||
JOB {{job_identifier}} | ||
{{ render_options(job_options, 'create') }} | ||
{{ render_options(target_options, 'create') }} | ||
AS COPY FROM {{source}} {{connection_identifier}} | ||
{{ render_options(source_options, 'create') }} | ||
INTO {{table}} | ||
INTO {{target_type}} {{into_relation}} | ||
|
||
{%- endmacro %} |
9 changes: 6 additions & 3 deletions
9
dbt/include/upsolver/macros/materializations/incremental/create_insert_job.sql
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
10 changes: 7 additions & 3 deletions
10
dbt/include/upsolver/macros/materializations/incremental/create_merge_job.sql
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
Oops, something went wrong.