只运行一组型号?

发布于 2025-02-11 10:40:17 字数 241 浏览 1 评论 0原文

我开始将您的一些转换作业迁移到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 or just speficif model using dbt run --select model_name

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风筝有风,海豚有海 2025-02-18 10:40:17

DBT允许

  • 选择节点及其所有节点的语法((+模型名称名称之前))
  • 选择节点和所有依赖于它的节点+在模型名称之后)
  • 您也可以在情况下同时执行(+Model_name+

dbt run-选择 - 选择+预测应该做技巧

还可以选中 +操作员

Dbt allows syntax of

  • selecting a node and all nodes it requires (+ before the model name)
  • selecting a node and all nodes that depend on it (+ after the model name)
  • you can also do both (+model_name+)

In your case dbt run --select +forecast should do the trick

Also check the documentation of the + operator.

猫性小仙女 2025-02-18 10:40:17

+ operator 只需要通过指定名称来运行多个无关模型,您就可以做到 >::

dbt run --select my_first_model my_second_model

In addition to the + operator, incase you just need to run multiple unrelated models by specifying their names, you can do so as such:

dbt run --select my_first_model my_second_model
谜兔 2025-02-18 10:40:17

为了运行模型及其子女(又称下游依赖关系),您必须在中指定型号,然后在+运算符 - 选择参数中:

dbt run --select sales_prediction+

同样,要运行模型及其父(或上游)依赖关系,+运算符必须遵循模型名称:

dbt run --select +sales_prediction

您还可以同时运行上游和下游依赖项,

dbt run --select +sales_prediction+

甚至可以选择级别深度将进行特定的命令。例如,以下命令将运行称为sales_prediction的模型以及其第一个和第二级的孩子(下游任务)。

dbt run --select sales_prediction+2

在选择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:

dbt run --select sales_prediction+

Likewise, to run a model and its parent (or upstream) dependencies, the + operator must be followed by the model name:

dbt run --select +sales_prediction

You can also run both the upstream and downstream dependencies

dbt run --select +sales_prediction+

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).

dbt run --select sales_prediction+2

There are limitless possibilities when it comes to selecting specific resources in dbt CLI (including models, tests, seeds and snapshots).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文