Fix target (#295)

* hardcoding v2

* v2
This commit is contained in:
WHYTEWYLL 2024-03-14 18:58:58 -06:00 committed by GitHub
parent 131146940b
commit 022390ebdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 44 additions and 6 deletions

View File

@ -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 %}

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {