From 50d02e457dee76ca636fe318567281bec68b4b7e Mon Sep 17 00:00:00 2001 From: Joel McNierney Date: Wed, 13 Dec 2023 14:25:13 -0800 Subject: [PATCH] use aws_sns_topic property when present --- macros/plugins/snowflake/create_external_table.sql | 3 +++ sample_sources/snowflake.yml | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/macros/plugins/snowflake/create_external_table.sql b/macros/plugins/snowflake/create_external_table.sql index f48b87a7..3c86ef0e 100644 --- a/macros/plugins/snowflake/create_external_table.sql +++ b/macros/plugins/snowflake/create_external_table.sql @@ -51,6 +51,9 @@ {% if external.auto_refresh in (true, false) -%} auto_refresh = {{external.auto_refresh}} {%- endif %} + {% if external.aws_sns_topic -%} + aws_sns_topic = '{{external.aws_sns_topic}}' + {%- endif %} {% if external.pattern -%} pattern = '{{external.pattern}}' {%- endif %} {% if external.integration -%} integration = '{{external.integration}}' {%- endif %} file_format = {{external.file_format}} diff --git a/sample_sources/snowflake.yml b/sample_sources/snowflake.yml index 035f5335..59ecde22 100644 --- a/sample_sources/snowflake.yml +++ b/sample_sources/snowflake.yml @@ -84,4 +84,12 @@ sources: - name: id description: this is an id - name: name - description: and this is a name \ No newline at end of file + description: and this is a name + + - name: aws_sns_refresh_tbl + description: "External table using AWS SNS for auto-refresh" + external: + location: "@stage" # reference an existing external stage + file_format: "( type = csv )" + # auto_refresh is assumed, setting to false is not supported + aws_sns_topic: "arn:aws:sns:us-east-1:123456789012:my_topic" # SNS topic ARN \ No newline at end of file