Skip to content

Commit

Permalink
Merge pull request #289 from ScalefreeCOM/tkirschke-patch-2
Browse files Browse the repository at this point in the history
Fixed PARTION BY Clause in Sat v0 for Fabric
  • Loading branch information
tkiehn authored Nov 19, 2024
2 parents 44a2c91 + dbf902e commit 8a73818
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions macros/tables/fabric/sat_v0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ latest_entries_in_sat_prep AS (
SELECT
tgt.{{ parent_hashkey }},
tgt.{{ ns.hdiff_alias }},
ROW_NUMBER() OVER(PARTITION BY tgt.{{ parent_hashkey|lower }} ORDER BY tgt.{{ src_ldts }} DESC) as rn
ROW_NUMBER() OVER(PARTITION BY tgt.{{ parent_hashkey }} ORDER BY tgt.{{ src_ldts }} DESC) as rn
FROM {{ this }} tgt
INNER JOIN distinct_incoming_hashkeys src
ON tgt.{{ parent_hashkey }} = src.{{ parent_hashkey }}
Expand Down Expand Up @@ -91,7 +91,7 @@ deduplicated_numbered_source_prep AS (
{{ parent_hashkey }},
{{ ns.hdiff_alias }},
{{ datavault4dbt.print_list(source_cols) }}
, LAG({{ ns.hdiff_alias }}) OVER(PARTITION BY {{ parent_hashkey|lower }} ORDER BY {{ src_ldts }}) as prev_hashdiff
, LAG({{ ns.hdiff_alias }}) OVER(PARTITION BY {{ parent_hashkey }} ORDER BY {{ src_ldts }}) as prev_hashdiff
FROM source_data

),
Expand Down Expand Up @@ -142,4 +142,4 @@ records_to_insert AS (

SELECT * FROM records_to_insert

{%- endmacro -%}
{%- endmacro -%}

0 comments on commit 8a73818

Please sign in to comment.