Skip to content

Commit

Permalink
add macro
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-catfritz committed Jul 22, 2024
1 parent 73d8a40 commit 52f84eb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions macros/is_incremental_compatible.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% macro is_incremental_compatible() %}
{% if target.type in ('databricks') %}
{% set re = modules.re %}
{% set path_match = target.http_path %}
{% set regex_pattern = "sql/protocol" %}
{% set match_result = re.search(regex_pattern, path_match) %}
{% if match_result %}
{{ return(True) }}
{% else %}
{{ return(False) }}
{% endif %}
{% elif target.type in ('bigquery','snowflake','postgres','redshift','sqlserver') %}
{{ return(True) }}
{% else %}
{{ return(False) }}
{% endif %}
{% endmacro %}

0 comments on commit 52f84eb

Please sign in to comment.