flip index order for tail, not backfill (#455)

This commit is contained in:
Jack Forgash 2025-06-17 09:45:08 -06:00 committed by GitHub
parent 041626d9bc
commit 1b54f97b0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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'