Initial publish of dbt_f2dq (f2dq) package v0.12.1.

Clean package repo for Gitea installs via packages.yml git URL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
M7XBeast
2026-10-11 17:37:40 +03:00
co-authored by Cursor
commit ff096b51b5
188 changed files with 5251 additions and 0 deletions
@@ -0,0 +1,40 @@
{#
# This file contains significant part of code derived from
# https://github.com/fivetran/dbt_fivetran_utils/tree/v0.4.0 which is licensed under Apache License 2.0.
#}
{% macro json_extract(string, string_path) -%}
{{ adapter.dispatch('json_extract','f2dq') (string, string_path) }}
{%- endmacro %}
{% macro default__json_extract(string, string_path) %}
json_extract_path_text({{string}}, {{ "'" ~ string_path ~ "'" }} )
{% endmacro %}
{% macro snowflake__json_extract(string, string_path) %}
json_extract_path_text(try_parse_json( {{string}} ), {{ "'" ~ string_path ~ "'" }} )
{% endmacro %}
{% macro redshift__json_extract(string, string_path) %}
case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ "'" ~ string_path ~ "'" }} ) else null end
{% endmacro %}
{% macro bigquery__json_extract(string, string_path) %}
json_extract_scalar({{string}}, {{ "'$." ~ string_path ~ "'" }} )
{% endmacro %}
{% macro postgres__json_extract(string, string_path) %}
{{string}}::json->>{{"'" ~ string_path ~ "'" }}
{% endmacro %}
@@ -0,0 +1,60 @@
{#
# This file contains significant part of code derived from
# https://github.com/fivetran/dbt_fivetran_utils/tree/v0.4.0 which is licensed under Apache License 2.0.
#}
{% macro percentile(percentile_field, partition_field, percent) -%}
{{ adapter.dispatch('percentile','f2dq') (percentile_field, partition_field, percent) }}
{%- endmacro %}
--percentile calculation specific to Redshift
{% macro default__percentile(percentile_field, partition_field, percent) %}
percentile_cont(
{{ percent }} )
within group ( order by {{ percentile_field }} )
over ( partition by {{ partition_field }} )
{% endmacro %}
--percentile calculation specific to Redshift
{% macro redshift__percentile(percentile_field, partition_field, percent) %}
percentile_cont(
{{ percent }} )
within group ( order by {{ percentile_field }} )
over ( partition by {{ partition_field }} )
{% endmacro %}
--percentile calculation specific to BigQuery
{% macro bigquery__percentile(percentile_field, partition_field, percent) %}
percentile_cont(
{{ percentile_field }},
{{ percent }})
over (partition by {{ partition_field }}
)
{% endmacro %}
{% macro postgres__percentile(percentile_field, partition_field, percent) %}
percentile_cont(
{{ percent }} )
within group ( order by {{ percentile_field }} )
/* have to group by partition field */
{% endmacro %}
{% macro spark__percentile(percentile_field, partition_field, percent) %}
percentile(
{{ percentile_field }},
{{ percent }})
over (partition by {{ partition_field }}
)
{% endmacro %}