matrixorigin / matrixorigin/matrixone

[Feature Request]: snapshot usability: diff

Open
#22,560 1 comment 0 reactions 1 assignee Claimed by @gouhongshen View on GitHub
ai-heavy kind/feature
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Is there an existing issue for the same feature request?

- [x] I have checked the existing issues.

### Is your feature request related to a problem?

```Markdown
Add a new command.

Snapshot diff t1 { snapshot } t2 { snapshot}

T1 t2 may or may not be the same table. But they must have same schema, same primary key.

Returns a table, so this may actually better be a table function. Select * from Snapshot_diff(t1, s1, t2, s2) diff;

Returns a table, with all columns from
t1, plus a extra column saying -, +. Just as diff

Also a command

Snapshot diff3 t1 { snapshot } t2 { snapshot}

Diff3 returns diff from a common base. The extra column could be,
-1, rows deleted in T1 but not in T2
-2, rows deleted in T2 but not in t1
+1, rows inserted in T1 but not in T2
+2. Rows inserted in T2 but not in T1

Note that we do not need to specify the common base. It is computed
```

### Describe the feature you'd like

If t1 and t2 has clone lineage, diff and diff3 should be fast as common blocks can be skipped.

### Describe implementation you've considered

_No response_

### Documentation, Adoption, Use Case, Migration Strategy

```Markdown

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.