Skip to content

Commit

Permalink
Merge pull request #36 from fishtown-analytics/fix/snowflake-no-cols
Browse files Browse the repository at this point in the history
Create Snowflake external tables with no columns defined
  • Loading branch information
jtcohen6 authored Jul 29, 2020
2 parents b6737b9 + 98f0ebd commit b31de34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/external/create_external_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{# https://docs.snowflake.net/manuals/sql-reference/sql/create-external-table.html #}
{# This assumes you have already created an external stage #}
create or replace external table {{source(source_node.source_name, source_node.name)}}
{%- if columns|length > 0 or partitions|length > 0 -%}
{%- if columns or partitions -%}
(
{%- if partitions -%}{%- for partition in partitions %}
{{partition.name}} {{partition.data_type}} as {{partition.expression}}{{- ',' if columns|length > 0 -}}
Expand Down

0 comments on commit b31de34

Please sign in to comment.