Hello dbt folks!
On one of the use case we have on our organisation, we have incremental
tables which basically hold the append-only records of incoming events and current
tables which stores the latest snapshots of incremental records with a unique key.
Above use-case looked us like an exact match to implement incremental model for good.
Documentation states that;
the first time a model is run, the table is built by transforming all rows of source data.
Because we have more than one record with the same unique key on our append-only incremental tables, the first incremental run generates more than one record with same unique key on current tables. Hence, consecutive batch following error;
UPDATE/MERGE must match at most one source row for each target row
Could anyone please let me know how this issue can be addressed with a solution or am I missing something?
Thanks in advance,
Soner