Skip to content

feat(data-branch): materialize diff output as table#25863

Draft
gouhongshen wants to merge 1 commit into
matrixorigin:mainfrom
gouhongshen:agent/data-branch-diff-output-as
Draft

feat(data-branch): materialize diff output as table#25863
gouhongshen wants to merge 1 commit into
matrixorigin:mainfrom
gouhongshen:agent/data-branch-diff-output-as

Conversation

@gouhongshen

Copy link
Copy Markdown
Contributor

Summary

Implements DATA BRANCH DIFF ... [COLUMNS (...)] OUTPUT AS <table>.

  • Materializes an ordinary persistent physical table, not a branch node or session temporary table.
  • Preserves requested visible-column order and types; adds source/flag metadata columns with collision-safe names.
  • Requires read access to both diff inputs and CREATE TABLE (or database-wide equivalent) on the destination database.
  • Rejects destination snapshots and leaves existing destination tables untouched.
  • Cleans up a partially materialized destination on failure with a bounded cleanup timeout.

User impact

Diff output can now be retained and queried across sessions. The result table has no mo_branch_metadata row and is never treated as a data branch.

Validation

  • mo-cgo-test -race -count=1 -timeout=240s ./pkg/frontend -run 'Test(DataBranchOutput|ValidateDataBranchDiffOutputAs)'
  • go test ./pkg/sql/parsers/dialect/mysql -run 'TestDataBranchDiff(Columns|OutputModes)' -count=1
  • make build
  • BVT: diff_17 73/73 and branch privilege 257/257.
  • Full git4data/branch/diff BVT: 1478/1478 passes with result-set metadata comparison disabled. Strict comparison reports 57 pre-existing metadata-only expectation mismatches in diff_8, diff_9, diff_12, diff_13, diff_14, and diff_16; every data row matches and the ordinary DIFF output path is unchanged. Those unrelated expected-result updates are intentionally excluded from this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants