Skip to content

Add support for table level branching #25152

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Feb 26, 2025

Description

Syntax proposal: https://docs.google.com/document/d/1jEF4IkWu-2Gzk5ii2Nb0exuEnAUeo98UbiM3i0xtgWQ/edit?usp=sharing

This PR supports @ syntax in INSERT, DELETE, UPDATE, MERGE statements:

    | INSERT INTO qualifiedName ('@' branch=identifier)?
       columnAliases? rootQuery                                        #insertInto
    | DELETE FROM qualifiedName ('@' branch=identifier)?
         (WHERE booleanExpression)?                                    #delete
    | UPDATE qualifiedName ('@' branch=identifier)?
        SET updateAssignment (',' updateAssignment)*
        (WHERE where=booleanExpression)?                               #update
    | MERGE INTO
        qualifiedName ('@' branch=identifier)? (AS? alias=identifier)?
        USING relation ON expression mergeCase+                        #merge

Also, add new syntax to manage branches:

    | CREATE (OR REPLACE)? BRANCH (IF NOT EXISTS)? identifier
        (WITH properties)? IN TABLE qualifiedName                      #createBranch
    | DROP BRANCH (IF EXISTS)? identifier
        IN TABLE qualifiedName                                         #dropBranch
    | ALTER BRANCH source=identifier IN TABLE qualifiedName
        FAST FORWARD TO target=identifier                              #fastForwardBranch
    | SHOW BRANCHES IN TABLE qualifiedName                             #showBranchs

Relates to #12844

Release notes

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Feb 26, 2025
@github-actions github-actions bot added iceberg Iceberg connector hive Hive connector labels Feb 26, 2025
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch 5 times, most recently from 8322da8 to 03d2d0d Compare February 26, 2025 13:36
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch from 03d2d0d to 8eee28a Compare March 11, 2025 03:41
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch 11 times, most recently from 96303ed to 611d6cd Compare April 6, 2025 08:08
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch from 611d6cd to 4c6df1f Compare April 7, 2025 11:03
@ebyhr ebyhr changed the title Add support for branching in engine and Iceberg Add support for branching Apr 7, 2025
@ebyhr ebyhr changed the title Add support for branching Add support for table level branching Apr 14, 2025
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch from 4c6df1f to 3c0abd6 Compare April 14, 2025 04:40
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch from 3c0abd6 to 0b7aa49 Compare April 15, 2025 08:29
@ebyhr ebyhr force-pushed the ebi/iceberg-branching-v3 branch from 0b7aa49 to 91bc773 Compare April 17, 2025 06:46
@harksin
Copy link
Contributor

harksin commented Apr 21, 2025

awesome PR!
iceberg branching will be so usefull.
Any plan to be embed this in an upcomming release or is it too early ?

(WITH properties)? IN TABLE qualifiedName #createBranch
| DROP BRANCH (IF EXISTS)? identifier
IN TABLE qualifiedName #dropBranch
| ALTER BRANCH source=identifier IN TABLE qualifiedName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALTER BRANCH source=identifier IN TABLE qualifiedName
        FAST FORWARD TO target=identifier                              #fastForwardBranch

When we want the changes from the branch experiment in main does this correspond to

ALTER BRANCH main IN TABLE test-table
        FAST FORWARD TO experiment

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

3 participants