In this lesson we will:
- Learn about the dbt ethemeral views feature.
dbt executes it's transformations as a series of chained operations represented by a Directed Acyclic Graph (DAG).
For each of the intermediate and final steps of this chain of operations, we can choose how to materialise the results. Typically people will choose between tables and views.
As dbt executes the operations, each of the tables and views will be generated in the database. If they are tables, they of course would require storage. If they are views, the object will simply be created in the database on top of the underlying data.
There are many cases where we would prefer our data consumers do not use these intermediate objects. Perhaps they are likely to change, or contain data in a structure which is in some way not ready or appropriate for consumption.
Ethemeral views can be useful in this situation, as they are not actually created in the database.
The Ethemeral view allows us to represent some intermediate concept in our transformation logic, but it is never actually created in the database. Instead, dbt will interpolate the query so that it is used.