Question in Model Kind Documentation

未关闭 适合新手
#5,696 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
冷清
技术栈
python
领域
documentation

调研方向

该 issue 引用了 SCD Type 2 By Column 模型文档页面。首先,在 SQLMesh 仓库中找到该文档部分的源文件,查看示例以明确 unique_key 和 columns 参数之间的关系,然后更新示例或添加说明文字,以消除对将 id 设为唯一键时出现重复 [Name, Price] 值的疑惑。

由索引模型根据 Issue 内容生成。

描述

Improvement

On example Example of SCD Type 2 By Column in Action its mentioned: We configure the SCD Type 2 By Column model to check the columns Name and Price for changes as I checked on the model definition a column should be declared as or composition as unique_key

If the model definition is like the example on the same example above:

MODEL (
  name db.menu_items,
  kind SCD_TYPE_2_BY_COLUMN (
    unique_key id,
    columns [name, price]
  )
);

SELECT
  id::INT,
  name::STRING,
  price::DOUBLE,
FROM
  stg.current_menu_items;

how is possible to have multiple ids for the same [Name,Price] since id is the unique_key?

Thanks

主要语言
Python
星标
3.3k
派生
471
平均合并
6 天 7 小时
30 天内合并 PR
35

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SQLMesh/sqlmesh 的其他 Issue

查看 SQLMesh/sqlmesh 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。