遇到未知的标签'快照'在DBT快照中

发布于 2025-02-11 00:10:32 字数 764 浏览 1 评论 0原文

I want to run a DBT Snapshot and am following a near-identical template to the one outlined in the

Compilation Error in model test_snapshot (.../project_folder/snapshots/test_snapshot.sql)    
Encountered unknown tag 'snapshot'.
        line 1
          {% snapshot test_snapshot %}

这是我试图编译的代码。

{% snapshot test_snapshot %}
    {{
        config(
            strategy='check',
            unique_key='id',
            target_schema='snapshots',
            check_cols= 'all'
        )
    }}

select
        *
from {{ ref('modle_in_sample_folder') }}

{% endsnapshot %}

快照文件夹和参考文件的顺序为.../project_folder/snapshots/test_snapshot.sql和.../project_folder/intermediate/model_in_in_sample_folder.sql

I want to run a DBT Snapshot and am following a near-identical template to the one outlined in the documentation. However, I get the error when I run dbt snpashot

Compilation Error in model test_snapshot (.../project_folder/snapshots/test_snapshot.sql)    
Encountered unknown tag 'snapshot'.
        line 1
          {% snapshot test_snapshot %}

Below is the code I am attempting to compile.

{% snapshot test_snapshot %}
    {{
        config(
            strategy='check',
            unique_key='id',
            target_schema='snapshots',
            check_cols= 'all'
        )
    }}

select
        *
from {{ ref('modle_in_sample_folder') }}

{% endsnapshot %}

The order of the snapshot folder and ref file is .../project_folder/snapshots/test_snapshot.sql and .../project_folder/intermediate/model_in_sample_folder.sql

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

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

发布评论

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

评论(1

从来不烧饼 2025-02-18 00:10:32

问题是我快照文件夹的位置。一旦我将其从型号项目文件夹中移出,并且在文件夹层次结构中最多可将其移出一个级别,那么我就可以成功运行它。

The problem was the location of my Snapshot folder. Once I moved it out of my models project folder, and up to one level in the folder hierarchy, I was able to run it successfully.

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