hotfix with qualify
Some checks failed
docs_update / run_dbt_jobs (push) Has been cancelled
docs_update / notify-failure (push) Has been cancelled

This commit is contained in:
Eric Laurello 2025-10-21 08:32:40 -04:00
parent 59fbf4d0ec
commit 81ced7bc61

View File

@ -9,9 +9,12 @@
tags = ['rewards_points_spend', 'streamline_non_core']
) }}
{% if var('STOREFRONT_INITIAL_RUN', false) %}
{% if var(
'STOREFRONT_INITIAL_RUN',
false
) %}
SELECT
SELECT
partition_key,
NULL AS entry_count,
NULL AS starting_after,
@ -29,12 +32,13 @@ SELECT
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
{{ source('flow_seeds', 'transaction_entries') }}
{% else %}
WITH bronze AS (
FROM
{{ source(
'flow_seeds',
'transaction_entries'
) }}
{% else %}
WITH bronze AS (
SELECT
partition_key,
DATA,
@ -83,6 +87,9 @@ FROM
bronze,
LATERAL FLATTEN(
input => DATA :data :: ARRAY
)
) qualify ROW_NUMBER() over (
PARTITION BY transaction_entries_id
ORDER BY
_inserted_timestamp DESC
) = 1
{% endif %}