From 1b54f97b0d279367a8f6bc3980fee8f6c335e6bf Mon Sep 17 00:00:00 2001 From: Jack Forgash <58153492+forgxyz@users.noreply.github.com> Date: Tue, 17 Jun 2025 09:45:08 -0600 Subject: [PATCH] flip index order for tail, not backfill (#455) --- .../streamline__transaction_entries_realtime.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql b/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql index 4fab78f..f3b4606 100644 --- a/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql +++ b/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql @@ -25,7 +25,7 @@ ROW_NUMBER() over ( ORDER BY partition_key DESC, - INDEX DESC + INDEX ASC ) AS rn FROM {{ ref('silver_api__transaction_entries') }} @@ -55,7 +55,7 @@ SELECT DATE_PART('EPOCH', SYSDATE()) :: INTEGER AS partition_key, {{ target.database }}.live.udf_api( 'GET', - '{Service}/api/loyalty/transaction_entries' || '?organizationId=' || '{organization_id}' || '&websiteId=' || '{website_id}' || '&limit=' || api_limit{% if not var('STOREFRONT_INITIAL_RUN', false) %} || '&startingAfter=' || '{{ starting_after }}'{% endif %}{% if not var('IS_BACKFILL', false) %} || '&sortDir=asc'{% endif %}, + '{Service}/api/loyalty/transaction_entries' || '?organizationId=' || '{organization_id}' || '&websiteId=' || '{website_id}' || '&limit=' || api_limit{% if not var('STOREFRONT_INITIAL_RUN', false) %} || '&startingAfter=' || '{{ starting_after }}'{% endif %} || '&sortDir=asc', { 'x-api-key': '{Authentication}' }, {}, 'Vault/prod/flow/snag-api'