diff --git a/.changes/unreleased/Fixes-20230810-014122.yaml b/.changes/unreleased/Fixes-20230810-014122.yaml new file mode 100644 index 000000000..fcb34237e --- /dev/null +++ b/.changes/unreleased/Fixes-20230810-014122.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: include tblproperties macro in adapters.sql create table +time: 2023-08-10T01:41:22.782982+08:00 +custom: + Author: etheleon + Issue: "865" diff --git a/dbt/include/spark/macros/adapters.sql b/dbt/include/spark/macros/adapters.sql index 202564e4e..471d1deef 100644 --- a/dbt/include/spark/macros/adapters.sql +++ b/dbt/include/spark/macros/adapters.sql @@ -1,4 +1,8 @@ -{% macro dbt_spark_tblproperties_clause() -%} +{% macro tblproperties_clause() %} + {{ return(adapter.dispatch('tblproperties_clause', 'dbt')()) }} +{%- endmacro -%} + +{% macro spark__tblproperties_clause() -%} {%- set tblproperties = config.get('tblproperties') -%} {%- if tblproperties is not none %} tblproperties ( @@ -156,10 +160,12 @@ {% endif %} {{ file_format_clause() }} {{ options_clause() }} + {{ tblproperties_clause() }} {{ partition_cols(label="partitioned by") }} {{ clustered_cols(label="clustered by") }} {{ location_clause() }} {{ comment_clause() }} + as {{ compiled_code }} {%- endif -%}