mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:47:00 +00:00
hotfix with qualify
This commit is contained in:
parent
59fbf4d0ec
commit
81ced7bc61
@ -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 %}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user