Is it possible to build seed dataset/table over multiple files in DBT?

473 views Asked by At

Is it possible to build seed dataset/table over multiple files in DBT?

I have two data files like below in my dbt project

enter image description here

Building seed dataset/table on individual file works perfectly fine.

However, what I am looking for is to create one seed dataset/table locations which should have the combined data from both the files.

1

There are 1 answers

3
Adam Kipnis On

No, you can't do this directly using dbt seed. The easiest approach is to keep them separate seed files resulting in 2 source tables, then just create a model that combines them. The model is as simple as

{{ dbt_utils.union_relations(relations=[
    source('locations', 'locations_1'), 
    source('locations', 'locations_2')
]) }}