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,23 @@
{# https://github.com/fast2dev/f2dq/issues/143 #}
{#
macro returns rows with she same key set (unique_cols)
along with the fields of the base model duplicates information added:
f2dq_duplicate_count - total number of duplicates with the same current key set
f2dq_duplicate_row_number - number of a duplicate row inside the group of duplicates with the same current key set
#}
{% macro filter_get_duplicates(relation, unique_cols, sort_columns) %}
(
with duplication_context as (
{{f2dq.add_duplication_context(relation, unique_cols, sort_columns)}}
),
duplicate_rows as (
select * from duplication_context where f2dq_duplicate_group_row_count > 1
)
{# return surrogate key as well? #}
select *
from duplicate_rows
)
{% endmacro %}
@@ -0,0 +1,15 @@
{% macro filter_remove_duplicates(relation, unique_cols, sort_columns) %}
(
with with_row_num as (
{{f2dq.add_duplication_context(relation, unique_cols, sort_columns)}}
),
one_row_num as (
select * from with_row_num where f2dq_duplicate_group_row_number = 1
)
select {{ dbt_utils.star(from=relation) }}
from one_row_num
)
{% endmacro %}