This commit is contained in:
WHYTEWYLL 2024-03-14 19:23:38 -06:00
parent 022390ebdc
commit 3ea1836cc3
7 changed files with 31 additions and 116 deletions

View File

@ -46,42 +46,4 @@
SELECT
_utils.UDF_REGISTER_SECRET(REQUEST_ID, _utils.UDF_WHOAMI(), KEY)
{% endmacro %}
{% macro if_data_call_function_v2(
func,
target,
params
) %}
{% if var(
"STREAMLINE_INVOKE_STREAMS"
) %}
{% if execute %}
{{ log(
"Running macro `if_data_call_function`: Calling udf " ~ func ~ " with params: \n" ~ params | tojson(indent=2) ~ "\n on " ~ target,
True
) }}
{% endif %}
SELECT
{{ func }}( parse_json($${{ params | tojson }}$$) )
WHERE
EXISTS(
SELECT
1
FROM
{{ target }}
LIMIT
1
)
{% else %}
{% if execute %}
{{ log(
"Running macro `if_data_call_function`: NOOP",
False
) }}
{% endif %}
SELECT
NULL
{% endif %}
{% endmacro %}

View File

@ -1,19 +1,11 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet17.nodes.onflow.org:9000",
"external_table": "transaction_results_mainnet_17",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "800"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet17.nodes.onflow.org:9000', 'external_table', 'transaction_results_mainnet_17', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '800'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH blocks AS (
-- CTE to identify blocks that doesn't have tx_results ingested for mainnet 14

View File

@ -1,19 +1,11 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet18.nodes.onflow.org:9000",
"external_table": "transaction_results_mainnet_18",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "770"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet18.nodes.onflow.org:9000', 'external_table', 'transaction_results_mainnet_18', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '770'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH blocks AS (
-- CTE to identify blocks that doesn't have tx_results ingested for mainnet 18

View File

@ -1,19 +1,12 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet19.nodes.onflow.org:9000",
"external_table": "transaction_results_mainnet_19",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "750"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet19.nodes.onflow.org:9000', 'external_table', 'transaction_results_mainnet_19', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '750'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH blocks AS (
-- CTE to identify blocks that doesn't have tx_results ingested for mainnet 18

View File

@ -1,19 +1,11 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet22.nodes.onflow.org:9000",
"external_table": "transaction_results_mainnet_22",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "800"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet22.nodes.onflow.org:9000', 'external_table', 'transaction_results_mainnet_22', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '800'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH blocks AS (
-- CTE to identify blocks that doesn't have tx_results ingested for mainnet 18

View File

@ -1,19 +1,11 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet18.nodes.onflow.org:9000",
"external_table": "transactions_mainnet_18",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "850"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet18.nodes.onflow.org:9000', 'external_table', 'transactions_mainnet_18', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '850'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH collection_transactions AS (

View File

@ -1,19 +1,11 @@
{{ config (
materialized = "view",
post_hook = if_data_call_function_v2(
func = 'udf_bulk_grpc',
target = "streamline.{{this.identifier}}",
params = {
"node_url":"access-001.mainnet19.nodes.onflow.org:9000",
"external_table": "transactions_mainnet_19",
"sql_limit": "188000",
"producer_batch_size": "14000",
"worker_batch_size": "100",
"sql_source": "{{this.identifier}}",
"concurrent_requests": "800"
}
post_hook = if_data_call_function(
func = "streamline.udf_bulk_grpc(object_construct('node_url','access-001.mainnet19.nodes.onflow.org:9000', 'external_table', 'transactions_mainnet_19', 'sql_limit', '188000', 'producer_batch_size', '14000', 'worker_batch_size', '100', 'sql_source', '{{this.identifier}}', 'concurrent_requests', '800'))",
target = "streamline.{{this.identifier}}"
)
)
) }}
}}
WITH collection_transactions AS (