只运行一组型号?
我开始将您的一些转换作业迁移到DBT。正如您在图像上看到的那样,通常有1到2个转换之前有我们的最后一个桌子(在某些情况下最多5个转换)。
我要实现的是仅针对链接模型的集合进行DBT运行。例如,sales_prediction
和预测
。我目前可以使用dbt运行O
r仅使用dbt Run -select model_name
I started to migrate some of your transformations jobs to DBT. As you can see on the image bellow, there is usually 1 to 2 transformations before to have our final table (up to 5 transformations in some cases).
What I am trying to achieve is to do dbt run only for a set on linked model. For instance, sales_prediction
and forecast
. I am currently able to run either for everything with dbt run o
r just speficif model using dbt run --select model_name
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
DBT允许
+
模型名称名称之前))+
在模型名称之后)+Model_name+
)dbt run-选择 - 选择+预测
应该做技巧还可以选中 +操作员 。
Dbt allows syntax of
+
before the model name)+
after the model name)+model_name+
)In your case
dbt run --select +forecast
should do the trickAlso check the documentation of the
+
operator.除+ operator 只需要通过指定名称来运行多个无关模型,您就可以做到 >::
In addition to the + operator, incase you just need to run multiple unrelated models by specifying their names, you can do so as such:
为了运行模型及其子女(又称下游依赖关系),您必须在
中指定型号,然后在
参数中:+
运算符 - 选择同样,要运行模型及其父(或上游)依赖关系,
+
运算符必须遵循模型名称:您还可以同时运行上游和下游依赖项,
甚至可以选择级别深度将进行特定的命令。例如,以下命令将运行称为
sales_prediction
的模型以及其第一个和第二级的孩子(下游任务)。在选择DBT CLI中的特定资源(包括模型,测试,种子和快照)中,有无限的可能性。
In order to run a model as well as its children (aka downstream dependencies), you'll have to specify the model name followed by
+
operator in the--select
argument:Likewise, to run a model and its parent (or upstream) dependencies, the
+
operator must be followed by the model name:You can also run both the upstream and downstream dependencies
You can even choose the level of depth a specific command will go. For example, the following command will run the model called
sales_prediction
as well as its first and second level children (downstream tasks).There are limitless possibilities when it comes to selecting specific resources in dbt CLI (including models, tests, seeds and snapshots).