From b3f85b9e2b5f9bcb5043a1f34d6090980a83877e Mon Sep 17 00:00:00 2001 From: CommonCrisis <44769652+CommonCrisis@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:18:03 +0200 Subject: [PATCH] fix: Optimize regex in post-hooks (#623) --- dbt/include/athena/macros/materializations/hooks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/athena/macros/materializations/hooks.sql b/dbt/include/athena/macros/materializations/hooks.sql index 55d76f20..a9489c4d 100644 --- a/dbt/include/athena/macros/materializations/hooks.sql +++ b/dbt/include/athena/macros/materializations/hooks.sql @@ -3,7 +3,7 @@ {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %} {% set rendered = render(hook.get('sql')) | trim %} {% if (rendered | length) > 0 %} - {%- if re.match("optimize\W+\w+\W+rewrite data using bin_pack", rendered.lower(), re.MULTILINE) -%} + {%- if re.match("optimize\W+\S+\W+rewrite data using bin_pack", rendered.lower(), re.MULTILINE) -%} {%- do adapter.run_optimize_with_partition_limit_catching(rendered) -%} {%- else -%} {% call statement(auto_begin=inside_transaction) %}