The problem I’m having
I am adding a pre-hook in the config block of my model which deletes rows based on a filter. The filter is like:
pre-hook = ’ DELETE FROM TABLE WHERE = ‘Y’ ’
The error I am getting is 000904 (42000): SQL compilation error: error line 5 at position 30
invalid identifier ‘Y’
What I’ve already tried
Putting double single quotes around Y
putting braces like ‘’{{ “Y” }}‘’
Some example code
{{ config(
materialized = 'incremental',
unique_key = 'key',
incremental_strategy = 'delete+insert',
on_schema_change = 'sync-all-columns',
pre_hook = ' DELETE FROM TABLE WHERE <COLUMN> = 'Y' '
)}}