diff --git a/.changes/unreleased/Fixes-20221122-172014.yaml b/.changes/unreleased/Fixes-20221122-172014.yaml new file mode 100644 index 000000000..a30be59b6 --- /dev/null +++ b/.changes/unreleased/Fixes-20221122-172014.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Friendlier error message for misspecified distkey type +time: 2022-11-22T17:20:14.432522-08:00 +custom: + Author: dluftspring + Issue: "224" + PR: "226" diff --git a/dbt/include/redshift/macros/adapters.sql b/dbt/include/redshift/macros/adapters.sql index 8b74933bd..b38897161 100644 --- a/dbt/include/redshift/macros/adapters.sql +++ b/dbt/include/redshift/macros/adapters.sql @@ -1,6 +1,10 @@ {% macro dist(dist) %} {%- if dist is not none -%} + {%- if dist is iterable or dist is mapping and (dist is not string) -%} + {% do exceptions.raise_compiler_error("Expected a single valued property for dist and got: " ~ dist ~ " instead") %} + {%- endif -%} + {%- set dist = dist.strip().lower() -%} {%- if dist in ['all', 'even'] -%}