You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Support schema evolution in DATA BRANCH DIFF / MERGE #24549
DATA BRANCH DIFF/MERGE require the two tables to have an identical schema. Adding a column on a branch (a normal data-evolution step, e.g. a new feature column) breaks diff/merge.
Reproduce
CREATETABLEa(id INTPRIMARY KEY, f0 DOUBLE);
DATA BRANCH CREATE TABLE b FROM a;
ALTERTABLE b ADD COLUMN f1 DOUBLE DEFAULT 0.0;
DATA BRANCH DIFF b AGAINST a;
Actual
ERROR 20101 (HY000): internal error: the target table schema is not equivalent to the base table.
Request
Support diff/merge across compatible schema changes (added / nullable columns), which is essential for evolving feature/label tables across versions.
Found while evaluating MatrixOne git4data / SQL as a data-versioning & agent-trace backend. Version: 8.0.30-MatrixOne-v3.0.11 (MatrixOne v3.0.11).
Testing background
Found in a feature-store experiment: a feature definition changed on a branch (we added a feature column via ALTER TABLE ... ADD COLUMN), then we tried to DATA BRANCH DIFF/MERGE the new feature values against the base.
Why it matters (expected purpose)
Feature/label/training tables evolve over time (new features get added). Requiring identical schemas means any column addition breaks diff/merge, blocking continuous feature engineering on branches. Supporting compatible schema evolution (added / nullable columns) is needed for iterative dataset work.
Merged implementation: #25882, merge commit 2ddf1d4c37c64e9b074aee9cab27a3234a667bc5 (final PR head c86eb01c76582c26971b535caad91c8191f26227).
Current main at handoff: 41332062a6740978f269088a92ee362a888c7bd7.
QA Decision
required: yes
reason: this is user-visible DATA BRANCH DIFF/MERGE schema-evolution functionality involving persisted lineage, historical ownership, snapshot/PITR, concurrency, and GC
production_entrypoint: DIFF/MERGE across supported schema evolution, plus COPY ALTER while branch/snapshot/PITR historical owners are created or removed
automated_terminal_coverage: the merged unit, race, embedded, and BVT coverage exercises stable-identity mapping, reorder/lineage-proven rename, supported target-only columns, fail-closed incompatible/redefined schemas, historical-owner publication barriers, and generation cleanup
remaining_validation: validate the supported/rejected schema matrix in a deployed environment, verify DIFF output and MERGE data preservation, exercise snapshot/PITR ownership and concurrent COPY ALTER, then confirm safe reclamation only after the final owner is removed
PASS requires deterministic DIFF/MERGE results for supported evolution, explicit rejection without partial writes for ambiguous/incompatible evolution, preservation of target-only data, correct historical ownership across snapshot/PITR, and eventual cleanup after the last owner disappears. FAIL includes guessed column matching, silent casts, lost target data, false snapshot/PITR success, partial merge, stale ownership, or premature/leaked generation cleanup.
Please record the tested build/commit, environment, schema scenarios, concurrency setup, and terminal catalog/data results. This feature should remain open after QA if product/reporter acceptance or additional regression coverage is still required; QA PASS alone is not permission for mechanical closure.
复现 issue 中 CREATE TABLE a(id INT PRIMARY KEY, f0 DOUBLE) → DATA BRANCH CREATE TABLE b FROM a → ALTER TABLE b ADD COLUMN f1 DOUBLE DEFAULT 0.0 → DATA BRANCH DIFF/MERGE 的兼容 schema-evolution 路径。当前 main 的 DIFF 与 MERGE 均可完成,并保留共同列的数据语义。
本轮回放四个已有 Data Branch BVT 文件,合计 TOTAL 736, SUCCESS 736, FAILED 0:branch_edge_cases 211 条、branch_matrix_coverage 108 条、diff_schema_evolve 278 条、merge_schema_evolve 139 条。
Activity
feat(frontend): support schema evolution in data branch diff/merge
feat(frontend): support schema evolution in data branch diff/merge
feat(frontend): support schema evolution in data branch diff/merge
feat(frontend): support schema evolution in data branch diff/merge
feat(frontend): support schema evolution in data branch diff/merge (#…
VioletQwQ-0 commentedon Jul 30, 2026
QA handoff
Merged implementation: #25882, merge commit
2ddf1d4c37c64e9b074aee9cab27a3234a667bc5(final PR headc86eb01c76582c26971b535caad91c8191f26227).Current
mainat handoff:41332062a6740978f269088a92ee362a888c7bd7.QA Decision
PASS requires deterministic DIFF/MERGE results for supported evolution, explicit rejection without partial writes for ambiguous/incompatible evolution, preservation of target-only data, correct historical ownership across snapshot/PITR, and eventual cleanup after the last owner disappears. FAIL includes guessed column matching, silent casts, lost target data, false snapshot/PITR success, partial merge, stale ownership, or premature/leaked generation cleanup.
Please record the tested build/commit, environment, schema scenarios, concurrency setup, and terminal catalog/data results. This feature should remain open after QA if product/reporter acceptance or additional regression coverage is still required; QA PASS alone is not permission for mechanical closure.
Ariznawlll commentedon Aug 26, 2026
测试版本
main1891117aedce0419a81630b3011906b560b93d0amo-tester通过 MySQL 协议执行。该组使用-n忽略仅显示长度的 JDBC metadata 差异,仍逐行比较 SQL 结果与错误断言。原问题验证
复现 issue 中
CREATE TABLE a(id INT PRIMARY KEY, f0 DOUBLE)→DATA BRANCH CREATE TABLE b FROM a→ALTER TABLE b ADD COLUMN f1 DOUBLE DEFAULT 0.0→DATA BRANCH DIFF/MERGE的兼容 schema-evolution 路径。当前 main 的 DIFF 与 MERGE 均可完成,并保留共同列的数据语义。本轮回放四个已有 Data Branch BVT 文件,合计
TOTAL 736, SUCCESS 736, FAILED 0:branch_edge_cases211 条、branch_matrix_coverage108 条、diff_schema_evolve278 条、merge_schema_evolve139 条。Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
不适用。本轮为部署后的公开 SQL 验收;未使用 injection。实现 PR 的 UT/race/embedded 覆盖由研发交接评论记录,本次没有把它们替代为黑盒验收。
回归测试
ALTER ADD COLUMN后的 DIFF/MERGE schema-evolve 流程;因此未把 big-data 验收记为已完成,也未生成非真实环境的 golden。测试证据
已完成验证
main的原问题路径、Happy/Unhappy BVT 均已完成(736/736);未发现 DIFF/MERGE schema-evolve 的 SQL 错误、错误数据、panic 或原子性问题。待补充验收项
ALTER TABLE ... ADD COLUMN,再验证DIFF/MERGE、共同列回写、target-only 默认列和清理。该流程尚未在真实 big-data 环境跑过,因此尚无真实环境生成的 golden。feat(frontend): support schema evolution in data branch diff/merge (m…
feat(frontend): support schema evolution in data branch diff/merge (m…
feat(frontend): support schema evolution in data branch diff/merge (m…
Ariznawlll commentedon Sep 18, 2026
测试补充(100M schema evolution 阶段进度)
测试版本
main4ff27bb9b35c43c1b0961bb9a01bf8fc0b6a2171已完成验证
本地黑盒 10,000 行 schema-evolution
ALTER TABLE ... ADD COLUMN前后执行INSERT / UPDATE / DELETE。0。不兼容 schema 与原子性
INT → BIGINT类型漂移、删除 base 列、无 PK/fake-PK 配合 target-only 列均被拒绝。当前 main 回归
736/736:diff_schema_evolve278、branch_edge_cases211、branch_matrix_coverage108、merge_schema_evolve139。100M 核心数据链路
Actions #35198000419 已实际执行 100M schema-evolution SQL:
该轮业务 SQL 和数据正确性校验均已执行;末尾清理断言仍按 ALTER 后的 current rel_id 查询,未覆盖完整 generation lineage。
清理校验补充
清理断言已改为同时记录 branch root rel_id 和 ALTER 后 current rel_id,并校验:
0100测试资产 commit:
9d24ecdaa439f64173a94e50216e4d0d83486815本轮待验证
修正后的最终复跑 Actions #35208061617 在环境创建阶段因 TKE CPU/内存不足,Pod 持续 Pending,未进入 SQL 执行;这次未产生新的功能结果。
现有测试资源可用后,将重新执行同一 100M case,补齐修正后 cleanup golden 的真实 TKE 结果,再发布完整测试结论。
Ariznawlll commentedon Sep 18, 2026
测试版本
main4ff27bb9b35c43c1b0961bb9a01bf8fc0b6a2171原问题验证
在 1 亿行基表上创建 Data Branch;branch 侧执行 common-column 更新、
ALTER ADD COLUMN feature_tag、target-only 列更新、删除和插入,再执行DATA BRANCH DIFF与MERGE。Happy Path 覆盖
4,000,000,覆盖 pre-ALTER 与 post-ALTER 的 common-column 修改、target-only 列修改、删除和插入。100,000,000,payload 不一致行数为0。0,确认 branch 与基表数据收敛。Unhappy Path 覆盖
feature_tag不向基表传播:基表同名列计数为0。0、logical tombstone=1、current ALTER lineage=0、branch protection snapshot=0。白盒验证
不适用。本次验证通过公开 SQL 接口覆盖 schema evolution、DIFF / MERGE 与清理结果,未使用故障注入或内部 mock。
回归测试
563db1b22366cca5883a68a7149f51c55243d568。nonsys_data_branch_100m.sql,由main的 Snapshot Backup Restore nightly 中DATA BRANCH 100Mjob 执行;未新增 4.2-dev 入口。测试证据
测试结论
测试通过。