I’m using insert_by_period_materialization for backfill incremental load.
Im incrementaly loading historical data per hour and all hours of increment works nice except last one which fails with statement:
Tried to run an empty query on model
sql, eg. in a model hook, make sure your `else` clause contains valid sql!
I googled but it seeme like this is not really error it’s just that dbt fails in case it has to run empty query.
This is causing problems since model stops execution on this error.
Any help apriciated,
Thanks!
Note that it’s not an officially-supported macro so we probably won’t be able to dig into it very far, but potentially another community member will be able to contribute to a workaround.
In the meantime, I would ensure that you always have a record for the final period - perhaps you can widen the size of your windows?