Customize target table in incremental models

Hello! I need to insert data from multiple incremental models in one table. Can I customize target table in config not to use table as file name? Of course I can do it by union all, but we have large data and it makes one big query instead several small, and in it critical for our dwh.

What warehouse are you using?
In any modern warehouse that uses column store, a union is one of the most efficient operations you can do. It would be much more efficient than looping over the ref tables and inserting them one at a time.

1 Like

U can customise ur target table name using alias and config in the model file or yml file

Model File:
{{ config(alias= 'target_table_name') }}
Yml file:
models:
  - name: tatget_table_sql_file_name
    config:
      alias: target_table_name

For more info

1 Like

dbt believes very strongly in one file :arrow_right: one object in the database. @Surya is right that you can use alias to change the name of the created object, but you can still only have one object with that name.

I agree with @jeffsk that your best bet is to make the incremental models separately, and then create a view on top that unions them.