【问题标题】:yml table materialization in snowflake not working雪花中的yml表物化不起作用
【发布时间】:2022-10-15 11:00:13
【问题描述】:

我正在学习基础课程。在 yml 的模型部分中,我指定了 +materialized: table 指令,但 dim_customers 仍然创建为雪花中的视图。

但是,如果我将配置块放在 sql 块的顶部,它就可以正常工作。

你有什么建议吗?

yml

name: 'jaffle_shop'
version: '1.0.0'
config-version: 2

profile: 'default'

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

target-path: "target"  # directory which will store compiled SQL files
clean-targets:         # directories to be removed by `dbt clean`
  - "target"
  - "dbt_packages"

models:
  jaffle:
    marts:
      core:
        +materialized: table
    staging:
      +materialized: view

项目结构

【问题讨论】:

    标签: dbt


    【解决方案1】:

    您需要将项目名称添加到 dbt_project.yml 中的 models: 配置中:

    models:
      jaffle_shop:
        jaffle:
          marts:
            core:
              +materialized: table
          staging:
            +materialized: view
    

    【讨论】:

    • 嗨乔希。感谢你的回答。我只提供了一个摘录。我编辑并添加了完整版。我确实定义了名称。
    • @JimMurphy 我已经更新了我的答案。您需要有项目名称,然后是路径(模型内部),然后是配置。
    • 做到了。谢谢你,@乔希。非常感激。
    【解决方案2】:

    file-tree & yml snowflake

    嗨,即使添加了项目名称,我也面临着类似的问题。 我还尝试添加/删除 +enabled 选项。

    用配置宏覆盖是有效的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-12
      • 2020-02-14
      • 1970-01-01
      相关资源
      最近更新 更多