Graph Operators
Last updated
Last updated
Graph operators in dbt are special syntax used with the --select
flag to target specific parts of your project's execution graph (DAG). This graph represents the dependencies between your models, with each model as a node and the dependencies as edges.
The graph operators allow you to navigate this execution graph and select subsets of your project's resources. They're like secret codes to tell dbt exactly which models you want to work with, whether it's running, testing, or listing them.
*
)Run all models in a schema.
No special character needed, just use the path.
+
)The plus before a model name selects the model and its parents. The plus after a model name selects the model and its children.
@
)Select parents or children, without the original model.
,
)Run multiple models.
,
)Get the intersection of multiple selectors.
Combine operators for laser-focused selection:
Use dbt ls
to preview your selection:
Refresh two generations of parents and all children of critical models:
Test everything related to final reports except the reports themselves:
Remember, the order of operators matters, as dbt processes them from left to right.
With these graph operators, you can create powerful, precise dbt commands to execute exactly the models you need in your data transformation pipelines.