The problem I’m having
I’m trying to insert records into one data vault hub from multiple models (based on different ERPs each with their own extract/refresh timeline). I know a union all is possible, but that means maintaining the code every time something new is added, making the code more complex. I would rather that I could just have the equivalent of a single insert statement (however that is done in dbt), but dbt doesn’t allow multiple models to insert into one table and raises an error on compilation.
The context of why I’m trying to do this
I don’t know eventually how many ERP data sets I need to bring in
What I’ve already tried
I’ve used both the scalefree and dbtvault packages.
Some example code or error messages
dbt found two resources with the database representation "FOO.BAR.hub_contacts". dbt cannot create two resources with identical database representations. To fix this, change the configuration of one of these resources: - model.ingest.foo_hub_party (models/raw_vault/foo_hub_party.sql) - model.ingest.foo_hub_contacts (models/raw_vault/foo_hub_contacts.sql)```