Search code examples
snowflake-cloud-data-platformdbt

Is there any way I can run the DBT snapshot with running the Post Hook command?


I have DBT snapshot job wherein I have a post-hook to update the delete entries with the current timestamp.

Now, I want to run the same job for full load and delta load.

When I run the full load, I do not want the post-hook to run. Post-hook should run only for the delta runs.

Is there any way we can ignore the post-hook query while running the full load?


Solution

  • You can make a macro that executes whatever your post hook does and put the condition inside the macro using a jinja if statement. Call the macro from your post hook and pass whatever drives the job type