Plan fails with option --select-model after making a change

未关闭
#5,818 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
半天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
clickhouse, python
领域
backend

调研方向

Examine how the --select-model flag resolves downstream dependencies in the planning phase. The error involves ClickHouse table fingerprinting, so focus on the snapshot management and model selection logic that determines which physical tables need recreation. Look for where downstream models are filtered out incorrectly when using selective planning, and verify the fingerprint-to-table mapping in the ClickHouse adapter.

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

描述

Bug

I'm running the following command: uv run sqlmesh plan --select-model "ch_bronze_nz_stats.areas__regional_council_clipped" -vv after making changes to ch_bronze_nz_stats.areas__regional_council_clipped

And am getting:
Updating virtual layer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━ 92.3% • 24/26 • 0:00:01
Error: Execution failed for node SnapshotId<"ch_silver_geography"."geographic_area_shapes": 1549095793>

"ch_silver_geography"."geographic_area_shapes" is downstream of "ch_bronze_nz_stats.areas__regional_council_clipped"

When I inspect the logs I can see:
clickhouse_connect.driver.exceptions.DatabaseError: Received ClickHouse exception, code: 60, server response: Code: 60. DB::Exception: Unknown table expression identifier 'sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768' in scope SELECT * FROM sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768. (UNKNOWN_TABLE) (for url [redacted])
I have checked the database and can see that across all replicas sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3267957768 does not exist. So it seems the fingerprint for the downstream model has changed, but no physical table was created for it to match? I can see the old table in there sqlmesh__ch_silver.ch_silver_geography__geographic_area_shapes__3737929073

If I run the update without --select-model it works, but I had thought even with that option, downstream models that are indirectly affected, would update?

主要语言
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 摘要。