mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:06:45 +00:00
parent
131146940b
commit
022390ebdc
@ -46,4 +46,42 @@
|
||||
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 %}
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config (
|
||||
materialized = "view",
|
||||
post_hook = fsc_utils.if_data_call_function_v2(
|
||||
post_hook = if_data_call_function_v2(
|
||||
func = 'udf_bulk_grpc',
|
||||
target = "streamline.{{this.identifier}}",
|
||||
params = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user