From 664ac88b0fba67f7413ffe215d0eca8cdc50c2d8 Mon Sep 17 00:00:00 2001 From: ganesh Date: Sat, 6 Mar 2021 20:55:17 -0600 Subject: [PATCH] Add 'macros/get_backup_table_command.sql' --- macros/get_backup_table_command.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 macros/get_backup_table_command.sql diff --git a/macros/get_backup_table_command.sql b/macros/get_backup_table_command.sql new file mode 100644 index 0000000..f29d49a --- /dev/null +++ b/macros/get_backup_table_command.sql @@ -0,0 +1,13 @@ +{% macro get_backup_table_command(table, day_of_month) %} + + {% set backup_key -%} + day_{{ day_of_month }}/{{ table.database.lower() }}/{{ table.schema.lower() }}/{{ table.name.lower() }}/data_ + {%- endset %} + + copy into @s3://awsnowflakedata/adventureworks.public.backup_stage/{{ backup_key }} + from {{ table.database }}.{{ table.schema }}."{{ table.name.upper() }}" + header = true + overwrite = true + max_file_size = 1073741824; + +{% endmacro %} \ No newline at end of file