cleaned up table names and fixed jinja issues

This commit is contained in:
Mike Stepanovic 2025-06-05 11:10:15 -06:00
parent 95e3d72354
commit 8b01ccf088
8 changed files with 18 additions and 15 deletions

View File

@ -30,7 +30,7 @@
b.partition_key = s.partition_key
{% endmacro %}
{% macro streamline_external_table_FR_query_v2(
{% macro streamline_external_table_query_fr(
source_name,
partition_function="CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)"
) %}

View File

@ -4,5 +4,5 @@
) }}
{{ streamline_external_table_query(
source_name = 'tx_counts'
source_name = 'tx_count'
) }}

View File

@ -4,5 +4,5 @@
) }}
{{ streamline_external_table_query_fr(
source_name = 'tx_counts'
source_name = 'tx_count'
) }}

View File

@ -16,7 +16,8 @@ SELECT
DATA :result :block :header :time :: TIMESTAMP AS block_timestamp,
ARRAY_SIZE(
DATA :result :block :data :txs
) tx_count {{ dbt_utils.generate_surrogate_key(
) tx_count,
{{ dbt_utils.generate_surrogate_key(
['block_id']
) }} AS complete_blocks_id,
SYSDATE() AS inserted_timestamp,

View File

@ -1,7 +1,7 @@
{# Get variables #}
{% set vars = return_vars() %}
-- depends_on: {{ ref('bronze__tx_counts') }}
-- depends_on: {{ ref('bronze__tx_count') }}
{{ config (
materialized = "incremental",
@ -26,7 +26,7 @@ SELECT
FROM
{% if is_incremental() %}
{{ ref('bronze__tx_counts') }}
{{ ref('bronze__tx_count') }}
WHERE
inserted_timestamp >= (
SELECT
@ -34,9 +34,8 @@ WHERE
FROM
{{ this }}
)
AND block_id NOT IN (21208991)
{% else %}
{{ ref('bronze__tx_counts_fr') }}
{{ ref('bronze__tx_count_fr') }}
{% endif %}
qualify(ROW_NUMBER() over (PARTITION BY block_id

View File

@ -53,14 +53,14 @@ LIMIT {{ vars.MAIN_SL_BLOCKS_REALTIME_SQL_LIMIT }}
'producer_batch_size': vars.MAIN_SL_BLOCKS_REALTIME_PRODUCER_BATCH_SIZE,
'worker_batch_size': vars.MAIN_SL_BLOCKS_REALTIME_WORKER_BATCH_SIZE,
'async_concurrent_requests': vars.MAIN_SL_BLOCKS_REALTIME_ASYNC_CONCURRENT_REQUESTS,
'sql_source': "{{this.identifier}}",
'sql_source' : this.identifier
"order_by_column": "block_id"
} %}
{% set function_call_sql %}
{{ fsc_utils.if_data_call_function_v2(
func = 'streamline.udf_bulk_rest_api_v2',
target = '{{this.schema}}.{{this.identifier}}',
target = this.schema ~ '.' ~ this.identifier,
params = params
) }}
{% endset %}

View File

@ -14,6 +14,7 @@ WITH blocks AS (
SELECT
A.block_id,
A.block_timestamp,
tx_count
FROM
{{ ref('streamline__blocks_complete') }} A
@ -39,6 +40,7 @@ numbers AS (
blocks_with_page_numbers AS (
SELECT
tt.block_id :: INT AS block_id,
tt.block_timestamp,
n.n AS page_number
FROM
blocks tt
@ -52,6 +54,7 @@ numbers AS (
EXCEPT
SELECT
block_id,
null as block_timestamp, -- placeholder for now...
page_number
FROM
{{ ref('streamline__transactions_complete') }}
@ -98,7 +101,7 @@ LIMIT {{ vars.MAIN_SL_TRANSACTIONS_REALTIME_SQL_LIMIT }}
'producer_batch_size': vars.MAIN_SL_TRANSACTIONS_REALTIME_PRODUCER_BATCH_SIZE,
'worker_batch_size': vars.MAIN_SL_TRANSACTIONS_REALTIME_WORKER_BATCH_SIZE,
'async_concurrent_requests': vars.MAIN_SL_TRANSACTIONS_REALTIME_ASYNC_CONCURRENT_REQUESTS,
'sql_source': "{{this.identifier}}",
'sql_source' : this.identifier
'exploded_key': '["result.txs"]',
"order_by_column": "block_id_requested"
} %}
@ -106,7 +109,7 @@ LIMIT {{ vars.MAIN_SL_TRANSACTIONS_REALTIME_SQL_LIMIT }}
{% set function_call_sql %}
{{ fsc_utils.if_data_call_function_v2(
func = 'streamline.udf_bulk_rest_api_v2',
target = '{{this.schema}}.{{this.identifier}}',
target = this.schema ~ '.' ~ this.identifier,
params = params
) }}
{% endset %}

View File

@ -20,7 +20,7 @@ WITH blocks AS (
SELECT
block_id
FROM
{{ ref('streamline__tx_counts_complete') }}
{{ ref('streamline__tx_count_complete') }}
),
{# retry AS (
SELECT
@ -80,13 +80,13 @@ ORDER BY
'producer_batch_size': vars.MAIN_SL_TX_COUNTS_REALTIME_PRODUCER_BATCH_SIZE,
'worker_batch_size': vars.MAIN_SL_TX_COUNTS_REALTIME_WORKER_BATCH_SIZE,
'async_concurrent_requests': vars.MAIN_SL_TX_COUNTS_REALTIME_ASYNC_CONCURRENT_REQUESTS,
'sql_source' :"{{this.identifier}}"
'sql_source' : this.identifier
} %}
{% set function_call_sql %}
{{ fsc_utils.if_data_call_function_v2(
func = 'streamline.udf_bulk_rest_api_v2',
target = '{{this.schema}}.{{this.identifier}}',
target = this.schema ~ '.' ~ this.identifier,
params = params
) }}
{% endset %}