I am running an incremental model in a curated layer table with delete+insert strategy. I want to add a option of hard delete based on a column ‘del’ in the staging table. I want to add a post hook to the curated layer table. But I am not sure how to use sources inside a post hook. Is it possible?
Basically I want to do something like -
post_hook = “DELETE FROM {{this}} where key in (select key from {{source(‘schema_name’ ,‘staging_table’) }} where del = ‘Y’)”