我可以在我的 yaml 文件中为 DBT 中的 Snowflake 指定集群密钥吗?

Can I specify cluster keys for Snowflake in DBT within my yaml file?

根据当前 DBT documentation for Snowflake,您可以通过将 cluster_by 提供到模型的 config.

中来配置 Snowflake 中的集群
config(
    materialized='table',
    cluster_by=['col_1']
  )

我宁愿在模型的 yml 文件中提供这些值,如下所示:

models:
  - name: my_model
  cluster_by: ['col_1']

这可以吗?

您应该可以使用 .yml 文件中的 config 资源 属性 来完成此操作。

例如

models:
  - name: my_model
    config:
      cluster_by: ['col_1']

https://docs.getdbt.com/reference/model-configs and https://docs.getdbt.com/reference/model-properties