The problem I’m having
I have built an incremental model ‘fact_order’ and also I ran a macro to build this table first and copying some historical data into it. Even though the table is already created after macro running successfully, when the incremental model run for the first time, it still do the full refresh the table.
The context of why I’m trying to do this
I need to build the table and move some historical data into it to avoid running the full refresh, which cost more time and efforts.
What I’ve already tried
I tried to put the macro into pre-hook, on-run-start or call it at the top of the incremental model. None of them work as expected. I suspect dbt only validate if the table exists at very beginning of the running session and didn’t catch the macro already built table.
Thank you,