diff --git a/.changes/unreleased/Features-20240826-220108.yaml b/.changes/unreleased/Features-20240826-220108.yaml new file mode 100644 index 00000000..f5871356 --- /dev/null +++ b/.changes/unreleased/Features-20240826-220108.yaml @@ -0,0 +1,7 @@ +kind: Features +body: add properties_update_dict as optional argument to trino__create_table_as macro +time: 2024-08-26T22:01:08.103103-06:00 +custom: + Author: james-long-mx + Issue: "430" + PR: "431" diff --git a/dbt/include/trino/macros/adapters.sql b/dbt/include/trino/macros/adapters.sql index faf72b2d..929756f7 100644 --- a/dbt/include/trino/macros/adapters.sql +++ b/dbt/include/trino/macros/adapters.sql @@ -99,8 +99,11 @@ {%- endif -%} {%- endmacro -%} -{% macro trino__create_table_as(temporary, relation, sql, replace=False) -%} +{% macro trino__create_table_as(temporary, relation, sql, replace=False, properties_update_dict=None) -%} {%- set _properties = config.get('properties') -%} + {%- if properties_update_dict is not None -%} + {%- do _properties.update(properties_update_dict) -%} + {%- endif -%} {%- if replace -%} {%- set or_replace = ' or replace' -%}