-
Notifications
You must be signed in to change notification settings - Fork 843
feat: initial support for table branching and tagging #19035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
drmingdrmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drmingdrmer reviewed 35 of 143 files at r1.
Reviewable status: 35 of 143 files reviewed, all discussions resolved (waiting on @dantengsky and @SkyFan2002)
7cbe99c to
6bea34e
Compare
drmingdrmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drmingdrmer reviewed 4 of 143 files at r1, 8 of 34 files at r2, all commit messages.
Reviewable status: 41 of 143 files reviewed, all discussions resolved (waiting on @dantengsky and @SkyFan2002)
drmingdrmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drmingdrmer reviewed 3 of 11 files at r3, all commit messages.
Reviewable status: 43 of 149 files reviewed, all discussions resolved (waiting on @dantengsky and @SkyFan2002)
|
wait pr #19106 merged |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
This PR introduces Git-like branching and tagging for Databend's Fuse tables, inspired by Apache Iceberg. Users can create independent branches for development/testing and read-only tags for marking important snapshots.
1. Core Concepts
Branch
Tag
2. SQL Syntax
2.1 Creating Branches or Tags
Parameters:
BRANCH | TAG: Specify whether to create a branch or tagAT: Specify the point in time to base the creation on (optional, defaults to current snapshot)SNAPSHOT: Based on a specific snapshot IDTIMESTAMP: Based on a specific timestampSTREAM: Based on the current position of a StreamOFFSET: Based on a relative time offsetBRANCH: Based on the current state of another branchTAG: Based on a tagRETAIN: Set the retention period for the branch|tag (optional, defaults to none)Examples:
2.2 Dropping Branches or Tags
Note: Drop operations are irreversible. Use with caution.
Examples:
2.3 Querying Branch Data
3. Data Structure Design
4. Storage Layout
_ss/directory_refs/<ref_id>/directories5. Vacuum and GC Integration
NOTE: If a branch or tag has expired, it will be cleaned up during vacuum and purge.
5.1 Tag Processing
Tags are read-only with a single snapshot
5.2 Branch Processing
Branches need snapshot cleanup
ByTimePeriodfirst.ByNumOfSnapshotsToKeepis only used when no snapshots are expired by time.Tests
Type of change
This change is