Код: Выделить всё
{{
config(
post_hook=[
'{{ execute_if_exists("delete from " ~ this ~ " where day = date('' " ~ var("mydatevar") ~ " '')") }}',
]
)
}}
Код: Выделить всё
{% macro execute_if_exists(query) -%}
{{ query }}
{%- endmacro %}
Код: Выделить всё
delete from catalog.myschema.mytable where day = date( 2024-10-02 )
Код: Выделить всё
delete from catalog.myschema.mytable where day = date(' 2024-10-02 ')
ОБНОВЛЕНО
- — ошибка компиляции
Код: Выделить всё
'{{ execute_if_exists("delete from " ~ this ~ " where day = date(' " ~ var("mydatevar") ~ " ')") }} - — тот же эффект
Код: Выделить всё
"{{ execute_if_exists('delete from ' ~ this ~ ' where day = date(' ' ~ var('mydatevar') ~ ' ')') }}" - — тоже ошибка компиляции
Код: Выделить всё
"{{ execute_if_exists('delete from ' ~ this ~ ' where day = date(' ' ~ var('mydatevar') ~ ' ')') }}"
Подробнее здесь: https://stackoverflow.com/questions/790 ... with-jinja