Skip to content

Commit

Permalink
fix: Optimize regex in post-hooks (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
CommonCrisis authored Apr 15, 2024
1 parent 65c65d6 commit b3f85b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/include/athena/macros/materializations/hooks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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) %}
Expand Down

0 comments on commit b3f85b9

Please sign in to comment.