gpt4 book ai didi

dbt - 我们如何在 SCD 1 实现的增量模型中使用合并语句

转载 作者:行者123 更新时间:2023-12-05 05:00:52 28 4
gpt4 key购买 nike

我正在尝试使用合并查询在数据构建工具中实现 scd1。但我没有得到在增量模型中编写此查询的确切方法。

谁能告诉我们必须在哪里编写合并查询。

{{
config(
materialized='incremental'
)
}}

<MERGE QUERY HERE>

{% if is_incremental() %}
where last_modified_date > '2020-07-11'
{% endif %}

最佳答案

您实际上不需要编写合并语句,dbt 会为您处理。您应该编写一个查询来返回您想要更新插入的记录。然后您可以检查 dbt 生成的合并查询的日志。

另请查看有关配置增量模型的 dbt 文档:https://docs.getdbt.com/docs/building-a-dbt-project/building-models/configuring-incremental-models#what-is-an-incremental_strategy

关于dbt - 我们如何在 SCD 1 实现的增量模型中使用合并语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62931605/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com