Adrien Arcuri
Adrien Arcuri

Reputation: 2410

Can a model be used as a source in dbt?

I'm asking this question to get feedbacks about when it is necessary to use a dbt model as source in the same dbt project?.

In which scenario is it recommended or not? In which scenario, we do not have the choice to reuse a model as source?

Thank you!

Upvotes: 0

Views: 1413

Answers (2)

Matthew Munn
Matthew Munn

Reputation: 11

Brad,

How about insert into tablea Select key from tableb where key not in(select key from tablea where key is not null)

This is an extremely common pattern when building data warehouses.

Upvotes: 0

Brad
Brad

Reputation: 306

It's not necessary.

A source and a model are two different things.

There is no good use case to build a model and then create a source on top of that model. Instead, just use the model to directly to maintain model transparency and lineage.

Upvotes: 1

Related Questions