I have a view model with multiple union all of different sources data.
Let’s call it "v_combined_data"
Then there is a table model named "fact_sales_transactions"
that uses this view.
In this model, I do a simple select from {{ref ('v_combined_data') }}
which should already indicate there’s an order to execute this
However, there is a job running every day, and sometimes the table does not get all the data from the view model. The view has the correct data, but the table is incomplete. When I run the job manually again, without changing anything at all, the data gets completed.
Here’s what I already did
-
We use the
ref
function correctly. -
I analysed the DAG graph and it seems correct.
-
I added the following comment to the beginning of the .sql model (Forcing Dependencies -- depends_on example code)
-- depends on: {{ ref('v_combined_data') }}
-
The job commands’ list executes first the view and then the next command is to execute the table.
Does anyone have any idea why this might be happening?
NOTE: I noticed that this dbt project does not have a schema.yml set up, could this be a reason for this to happen?