From 5ca008cd30ccf40f556df75e9f92c61263aeddef Mon Sep 17 00:00:00 2001 From: Erwan KOFFI Date: Tue, 4 Mar 2025 11:58:23 +0100 Subject: [PATCH 1/2] Add support for 'include' partition column in unload macro Unload command in Redshift supports an INCLUDE option, which has not been supported by this macro. This change is aimed toward supporting this functionality. The INCLUDE keyword will only work if the partition_by option has been set. --- macros/unload.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macros/unload.sql b/macros/unload.sql index 1bdf3d7..96c40d5 100644 --- a/macros/unload.sql +++ b/macros/unload.sql @@ -50,6 +50,7 @@ where option is cleanpath=False, parallel=False, partition_by=None, + include_partition=False, extension=None ) %} @@ -108,6 +109,9 @@ where option is {% endif %} {% if partition_by %} PARTITION BY ( {{ partition_by | join(', ') }} ) + {% if include_partition %} + INCLUDE + {% endif %} {% endif %} {% if extension %} EXTENSION '{{ extension }}' From daedac763293f4aedc77b743b2111a01ee98d19a Mon Sep 17 00:00:00 2001 From: Erwan KOFFI Date: Tue, 4 Mar 2025 12:00:07 +0100 Subject: [PATCH 2/2] Update README.md Updating the README to include the new option in the unload macro signature --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7149853..c3aa329 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Macro signature: cleanpath=Boolean, parallel=Boolean, partition_by=none|List, + include_partition=Boolean, extension=None|String ) }} ```