This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 53c0f3d71 [core] Rename merge_branch to fast_forward (#3643)
53c0f3d71 is described below

commit 53c0f3d71802bcf30494afff7a44775fcb56ae59
Author: TaoZex <[email protected]>
AuthorDate: Mon Jul 1 20:31:56 2024 +0800

    [core] Rename merge_branch to fast_forward (#3643)
---
 docs/content/flink/procedures.md                   |  8 ++---
 docs/content/maintenance/manage-branches.md        | 10 +++---
 docs/content/spark/procedures.md                   |  6 ++--
 .../paimon/privilege/PrivilegedFileStoreTable.java |  4 +--
 .../paimon/table/AbstractFileStoreTable.java       |  4 +--
 .../org/apache/paimon/table/ReadonlyTable.java     |  4 +--
 .../main/java/org/apache/paimon/table/Table.java   |  2 +-
 .../org/apache/paimon/utils/BranchManager.java     |  6 ++--
 .../paimon/table/FileStoreTableTestBase.java       | 18 +++++-----
 ...rgeBranchAction.java => FastForwardAction.java} |  8 ++---
 ...nFactory.java => FastForwardActionFactory.java} | 14 ++++----
 ...nchProcedure.java => FastForwardProcedure.java} | 10 +++---
 .../services/org.apache.paimon.factories.Factory   |  4 +--
 .../paimon/flink/action/BranchActionITCase.java    | 42 +++++++++++-----------
 .../org/apache/paimon/spark/SparkProcedures.java   |  4 +--
 ...nchProcedure.java => FastForwardProcedure.java} | 18 +++++-----
 .../spark/procedure/MergeBranchProcedureTest.scala | 10 +++---
 17 files changed, 85 insertions(+), 87 deletions(-)

diff --git a/docs/content/flink/procedures.md b/docs/content/flink/procedures.md
index 242b8403c..3adccb7ab 100644
--- a/docs/content/flink/procedures.md
+++ b/docs/content/flink/procedures.md
@@ -337,17 +337,17 @@ All available procedures are listed below.
       </td>
    </tr>
    <tr>
-      <td>merge_branch</td>
+      <td>fast_forward</td>
       <td>
-         CALL [catalog.]sys.merge_branch('identifier', 'branchName')
+         CALL [catalog.]sys.fast_forward('identifier', 'branchName')
       </td>
       <td>
-         To merge a branch to main branch. Arguments:
+         To fast_forward a branch to main branch. Arguments:
             <li>identifier: the target table identifier. Cannot be empty.</li>
             <li>branchName: name of the branch to be merged.</li>
       </td>
       <td>
-         CALL sys.merge_branch('default.T', 'branch1')
+         CALL sys.fast_forward('default.T', 'branch1')
       </td>
    </tr>
    </tbody>
diff --git a/docs/content/maintenance/manage-branches.md 
b/docs/content/maintenance/manage-branches.md
index 2e9dead9b..ccd2402a1 100644
--- a/docs/content/maintenance/manage-branches.md
+++ b/docs/content/maintenance/manage-branches.md
@@ -127,16 +127,16 @@ INSERT INTO t /*+ OPTIONS('branch' = 'branch1') */ SELECT 
...
 
 {{< /tabs >}}
 
-## Merge Branch
+## Fast Forward
 
-Merging the custom branch to main will delete all the snapshots, tags and 
schemas in the main branch that are created after the branch's initial tag. And 
copy snapshots, tags and schemas from the branch to the main branch.
+Fast-Forward the custom branch to main will delete all the snapshots, tags and 
schemas in the main branch that are created after the branch's initial tag. And 
copy snapshots, tags and schemas from the branch to the main branch.
 
-{{< tabs "merge-branch" >}}
+{{< tabs "fast_forward" >}}
 
 {{< tab "Flink" >}}
 
 ```sql
-CALL sys.merge_branch('default.T', 'branch1');
+CALL sys.fast_forward('default.T', 'branch1');
 ```
 
 {{< /tab >}}
@@ -148,7 +148,7 @@ Run the following command:
 ```bash
 <FLINK_HOME>/bin/flink run \
     /path/to/paimon-flink-action-{{< version >}}.jar \
-    merge_branch \
+    fast_forward \
     --warehouse <warehouse-path> \
     --database <database-name> \ 
     --table <table-name> \
diff --git a/docs/content/spark/procedures.md b/docs/content/spark/procedures.md
index 87bc6f64c..472dba569 100644
--- a/docs/content/spark/procedures.md
+++ b/docs/content/spark/procedures.md
@@ -175,14 +175,14 @@ This section introduce all available spark procedures 
about paimon.
       </td>
     </tr>
     <tr>
-      <td>merge_branch</td>
+      <td>fast_forward</td>
       <td>
-         To merge a branch to main branch. Arguments:
+         To fast_forward a branch to main branch. Arguments:
             <li>table: the target table identifier. Cannot be empty.</li>
             <li>branch: name of the branch to be merged.</li>
       </td>
       <td>
-          CALL sys.merge_branch(table => 'test_db.T', branch => 'test_branch')
+          CALL sys.fast_forward(table => 'test_db.T', branch => 'test_branch')
       </td>
     </tr>
    <tr>
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/privilege/PrivilegedFileStoreTable.java
 
b/paimon-core/src/main/java/org/apache/paimon/privilege/PrivilegedFileStoreTable.java
index 30f2288f8..d33e73b8f 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/privilege/PrivilegedFileStoreTable.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/privilege/PrivilegedFileStoreTable.java
@@ -205,9 +205,9 @@ public class PrivilegedFileStoreTable implements 
FileStoreTable {
     }
 
     @Override
-    public void mergeBranch(String branchName) {
+    public void fastForward(String branchName) {
         privilegeChecker.assertCanInsert(identifier);
-        wrapped.mergeBranch(branchName);
+        wrapped.fastForward(branchName);
     }
 
     @Override
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java 
b/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java
index 2a4a8e8c3..10bc386ca 100644
--- 
a/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java
+++ 
b/paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java
@@ -525,8 +525,8 @@ abstract class AbstractFileStoreTable implements 
FileStoreTable {
     }
 
     @Override
-    public void mergeBranch(String branchName) {
-        branchManager().mergeBranch(branchName);
+    public void fastForward(String branchName) {
+        branchManager().fastForward(branchName);
     }
 
     @Override
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/ReadonlyTable.java 
b/paimon-core/src/main/java/org/apache/paimon/table/ReadonlyTable.java
index c92f4ce5f..8989ab366 100644
--- a/paimon-core/src/main/java/org/apache/paimon/table/ReadonlyTable.java
+++ b/paimon-core/src/main/java/org/apache/paimon/table/ReadonlyTable.java
@@ -183,10 +183,10 @@ public interface ReadonlyTable extends InnerTable {
     }
 
     @Override
-    default void mergeBranch(String branchName) {
+    default void fastForward(String branchName) {
         throw new UnsupportedOperationException(
                 String.format(
-                        "Readonly Table %s does not support mergeBranch.",
+                        "Readonly Table %s does not support fastForward.",
                         this.getClass().getSimpleName()));
     }
 
diff --git a/paimon-core/src/main/java/org/apache/paimon/table/Table.java 
b/paimon-core/src/main/java/org/apache/paimon/table/Table.java
index aeca29d63..5f35c4be4 100644
--- a/paimon-core/src/main/java/org/apache/paimon/table/Table.java
+++ b/paimon-core/src/main/java/org/apache/paimon/table/Table.java
@@ -113,7 +113,7 @@ public interface Table extends Serializable {
 
     /** Merge a branch to main branch. */
     @Experimental
-    void mergeBranch(String branchName);
+    void fastForward(String branchName);
 
     /** Manually expire snapshots, parameters can be controlled independently 
of table options. */
     @Experimental
diff --git 
a/paimon-core/src/main/java/org/apache/paimon/utils/BranchManager.java 
b/paimon-core/src/main/java/org/apache/paimon/utils/BranchManager.java
index a2ae6d6f7..8cda5a4ed 100644
--- a/paimon-core/src/main/java/org/apache/paimon/utils/BranchManager.java
+++ b/paimon-core/src/main/java/org/apache/paimon/utils/BranchManager.java
@@ -222,10 +222,10 @@ public class BranchManager {
         }
     }
 
-    public void mergeBranch(String branchName) {
+    public void fastForward(String branchName) {
         checkArgument(
                 !branchName.equals(DEFAULT_MAIN_BRANCH),
-                "Branch name '%s' do not use in merge branch.",
+                "Branch name '%s' do not use in fast-forward.",
                 branchName);
         checkArgument(!StringUtils.isBlank(branchName), "Branch name '%s' is 
blank.", branchName);
         checkArgument(branchExists(branchName), "Branch name '%s' doesn't 
exist.", branchName);
@@ -291,7 +291,7 @@ public class BranchManager {
         } catch (IOException e) {
             throw new RuntimeException(
                     String.format(
-                            "Exception occurs when merge branch '%s' 
(directory in %s).",
+                            "Exception occurs when fast forward '%s' 
(directory in %s).",
                             branchName, branchPath(tablePath, branchName)),
                     e);
         }
diff --git 
a/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java 
b/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
index 9e0a7c224..53559b843 100644
--- 
a/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
+++ 
b/paimon-core/src/test/java/org/apache/paimon/table/FileStoreTableTestBase.java
@@ -1166,7 +1166,7 @@ public abstract class FileStoreTableTestBase {
     }
 
     @Test
-    public void testMergeBranch() throws Exception {
+    public void testfastForward() throws Exception {
         FileStoreTable table = createFileStoreTable();
         generateBranch(table);
         FileStoreTable tableBranch = createFileStoreTable(BRANCH_NAME);
@@ -1180,17 +1180,17 @@ public abstract class FileStoreTableTestBase {
                 
.containsExactlyInAnyOrder("0|0|0|binary|varbinary|mapKey:mapVal|multiset");
 
         // Test for unsupported branch name
-        assertThatThrownBy(() -> table.mergeBranch("test-branch"))
+        assertThatThrownBy(() -> table.fastForward("test-branch"))
                 .satisfies(
                         anyCauseMatches(
                                 IllegalArgumentException.class,
                                 "Branch name 'test-branch' doesn't exist."));
 
-        assertThatThrownBy(() -> table.mergeBranch("main"))
+        assertThatThrownBy(() -> table.fastForward("main"))
                 .satisfies(
                         anyCauseMatches(
                                 IllegalArgumentException.class,
-                                "Branch name 'main' do not use in merge 
branch."));
+                                "Branch name 'main' do not use in 
fast-forward."));
 
         // Write data to branch1
         try (StreamTableWrite write = tableBranch.newWrite(commitUser);
@@ -1217,10 +1217,10 @@ public abstract class FileStoreTableTestBase {
                                 BATCH_ROW_TO_STRING))
                 
.containsExactlyInAnyOrder("0|0|0|binary|varbinary|mapKey:mapVal|multiset");
 
-        // Merge branch1 to main branch
-        table.mergeBranch(BRANCH_NAME);
+        // Fast-forward branch1 to main branch
+        table.fastForward(BRANCH_NAME);
 
-        // After merge branch1, verify branch1 and the main branch have the 
same data
+        // After fast-forward branch1, verify branch1 and the main branch have 
the same data
         assertThat(
                         getResult(
                                 table.newRead(),
@@ -1279,8 +1279,8 @@ public abstract class FileStoreTableTestBase {
                         "0|0|0|binary|varbinary|mapKey:mapVal|multiset",
                         "2|20|200|binary|varbinary|mapKey:mapVal|multiset");
 
-        // Merge branch1 to main branch again
-        table.mergeBranch("branch1");
+        // Fast-forward branch1 to main branch again
+        table.fastForward("branch1");
 
         // Verify data in main branch is same to branch1
         assertThat(
diff --git 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchAction.java
 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardAction.java
similarity index 88%
rename from 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchAction.java
rename to 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardAction.java
index 405f80f8f..b13c004c0 100644
--- 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchAction.java
+++ 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardAction.java
@@ -20,11 +20,11 @@ package org.apache.paimon.flink.action;
 
 import java.util.Map;
 
-/** Merge branch action for Flink. */
-public class MergeBranchAction extends TableActionBase {
+/** Fast Forward action for Flink. */
+public class FastForwardAction extends TableActionBase {
     private final String branchName;
 
-    public MergeBranchAction(
+    public FastForwardAction(
             String warehouse,
             String databaseName,
             String tableName,
@@ -36,6 +36,6 @@ public class MergeBranchAction extends TableActionBase {
 
     @Override
     public void run() throws Exception {
-        table.mergeBranch(branchName);
+        table.fastForward(branchName);
     }
 }
diff --git 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchActionFactory.java
 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardActionFactory.java
similarity index 82%
rename from 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchActionFactory.java
rename to 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardActionFactory.java
index 0916079a7..b1e2228c6 100644
--- 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/MergeBranchActionFactory.java
+++ 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/FastForwardActionFactory.java
@@ -23,10 +23,10 @@ import org.apache.flink.api.java.tuple.Tuple3;
 import java.util.Map;
 import java.util.Optional;
 
-/** Factory to create {@link MergeBranchAction}. */
-public class MergeBranchActionFactory implements ActionFactory {
+/** Factory to create {@link FastForwardAction}. */
+public class FastForwardActionFactory implements ActionFactory {
 
-    public static final String IDENTIFIER = "merge_branch";
+    public static final String IDENTIFIER = "fast_forward";
 
     private static final String BRANCH_NAME = "branch_name";
 
@@ -43,20 +43,20 @@ public class MergeBranchActionFactory implements 
ActionFactory {
         Map<String, String> catalogConfig = optionalConfigMap(params, 
CATALOG_CONF);
         String branchName = params.get(BRANCH_NAME);
 
-        MergeBranchAction action =
-                new MergeBranchAction(
+        FastForwardAction action =
+                new FastForwardAction(
                         tablePath.f0, tablePath.f1, tablePath.f2, 
catalogConfig, branchName);
         return Optional.of(action);
     }
 
     @Override
     public void printHelp() {
-        System.out.println("Action \"merge_branch\" merge a branch by name.");
+        System.out.println("Action \"fast_forward\" fast_forward a branch by 
name.");
         System.out.println();
 
         System.out.println("Syntax:");
         System.out.println(
-                "  merge_branch --warehouse <warehouse_path> --database 
<database_name> "
+                "  fast_forward --warehouse <warehouse_path> --database 
<database_name> "
                         + "--table <table_name> --branch_name <branch_name>");
         System.out.println();
     }
diff --git 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/MergeBranchProcedure.java
 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/FastForwardProcedure.java
similarity index 86%
rename from 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/MergeBranchProcedure.java
rename to 
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/FastForwardProcedure.java
index e7eb3eb33..e77749f11 100644
--- 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/MergeBranchProcedure.java
+++ 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/FastForwardProcedure.java
@@ -25,15 +25,15 @@ import org.apache.paimon.table.Table;
 import org.apache.flink.table.procedure.ProcedureContext;
 
 /**
- * Merge branch procedure for given branch. Usage:
+ * Fast Forward procedure for given branch. Usage:
  *
  * <pre><code>
- *  CALL sys.merge_branch('tableId', 'branchName')
+ *  CALL sys.fast_forward('tableId', 'branchName')
  * </code></pre>
  */
-public class MergeBranchProcedure extends ProcedureBase {
+public class FastForwardProcedure extends ProcedureBase {
 
-    public static final String IDENTIFIER = "merge_branch";
+    public static final String IDENTIFIER = "fast_forward";
 
     @Override
     public String identifier() {
@@ -48,7 +48,7 @@ public class MergeBranchProcedure extends ProcedureBase {
     private String[] innerCall(String tableId, String branchName)
             throws Catalog.TableNotExistException {
         Table table = catalog.getTable(Identifier.fromString(tableId));
-        table.mergeBranch(branchName);
+        table.fastForward(branchName);
         return new String[] {"Success"};
     }
 }
diff --git 
a/paimon-flink/paimon-flink-common/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory
 
b/paimon-flink/paimon-flink-common/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory
index 6d6eb7aa2..d243aa3c9 100644
--- 
a/paimon-flink/paimon-flink-common/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory
+++ 
b/paimon-flink/paimon-flink-common/src/main/resources/META-INF/services/org.apache.paimon.factories.Factory
@@ -32,7 +32,7 @@ org.apache.paimon.flink.action.ExpirePartitionsActionFactory
 org.apache.paimon.flink.action.MarkPartitionDoneActionFactory
 org.apache.paimon.flink.action.CreateBranchActionFactory
 org.apache.paimon.flink.action.DeleteBranchActionFactory
-org.apache.paimon.flink.action.MergeBranchActionFactory
+org.apache.paimon.flink.action.FastForwardActionFactory
 
 ### procedure factories
 org.apache.paimon.flink.procedure.CompactDatabaseProcedure
@@ -59,5 +59,5 @@ 
org.apache.paimon.flink.procedure.privilege.DropPrivilegedUserProcedure
 org.apache.paimon.flink.procedure.privilege.GrantPrivilegeToUserProcedure
 org.apache.paimon.flink.procedure.privilege.RevokePrivilegeFromUserProcedure
 org.apache.paimon.flink.procedure.RepairProcedure
-org.apache.paimon.flink.procedure.MergeBranchProcedure
+org.apache.paimon.flink.procedure.FastForwardProcedure
 org.apache.paimon.flink.procedure.MarkPartitionDoneProcedure
diff --git 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
index abbddfe39..21a35964e 100644
--- 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
+++ 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/BranchActionITCase.java
@@ -259,7 +259,7 @@ class BranchActionITCase extends ActionITCaseBase {
     }
 
     @Test
-    void testMergeBranch() throws Exception {
+    void testFastForward() throws Exception {
         init(warehouse);
         RowType rowType =
                 RowType.of(
@@ -292,14 +292,14 @@ class BranchActionITCase extends ActionITCaseBase {
                 String.format("CALL sys.create_tag('%s.%s', 'tag3', 3)", 
database, tableName));
         assertThat(tagManager.tagExists("tag3")).isTrue();
 
-        // Create merge_branch_name branch
+        // Create branch_name branch
         BranchManager branchManager = table.branchManager();
         callProcedure(
                 String.format(
-                        "CALL sys.create_branch('%s.%s', 'merge_branch_name', 
'tag2')",
+                        "CALL sys.create_branch('%s.%s', 'branch_name', 
'tag2')",
                         database, tableName));
-        assertThat(branchManager.branchExists("merge_branch_name")).isTrue();
-        // Create merge_branch_name_action branch
+        assertThat(branchManager.branchExists("branch_name")).isTrue();
+        // Create branch_name_action branch
         createAction(
                         CreateBranchAction.class,
                         "create_branch",
@@ -310,26 +310,25 @@ class BranchActionITCase extends ActionITCaseBase {
                         "--table",
                         tableName,
                         "--branch_name",
-                        "merge_branch_name_action",
+                        "branch_name_action",
                         "--tag_name",
                         "tag3")
                 .run();
-        
assertThat(branchManager.branchExists("merge_branch_name_action")).isTrue();
+        assertThat(branchManager.branchExists("branch_name_action")).isTrue();
 
-        // Merge branch merge_branch_name
+        // Fast-forward branch branch_name
         callProcedure(
                 String.format(
-                        "CALL sys.merge_branch('%s.%s', 'merge_branch_name')",
-                        database, tableName));
+                        "CALL sys.fast_forward('%s.%s', 'branch_name')", 
database, tableName));
 
         // Check snapshot
         SnapshotManager snapshotManager = table.snapshotManager();
         assertThat(snapshotManager.snapshotExists(3)).isFalse();
 
-        // Merge branch merge_branch_name_action
+        // Fast-forward branch branch_name_action
         createAction(
-                        MergeBranchAction.class,
-                        "merge_branch",
+                        FastForwardAction.class,
+                        "fast_forward",
                         "--warehouse",
                         warehouse,
                         "--database",
@@ -337,7 +336,7 @@ class BranchActionITCase extends ActionITCaseBase {
                         "--table",
                         tableName,
                         "--branch_name",
-                        "merge_branch_name_action")
+                        "branch_name_action")
                 .run();
 
         // Check snapshot
@@ -347,7 +346,7 @@ class BranchActionITCase extends ActionITCaseBase {
         write = writeBuilder.newWrite();
         commit = writeBuilder.newCommit();
 
-        // Add data, forward to merge branch
+        // Add data, fast-forward branch
         for (long i = 4; i < 14; i++) {
             writeData(rowData(i, 
BinaryString.fromString(String.format("new.data_%s", i))));
         }
@@ -372,11 +371,10 @@ class BranchActionITCase extends ActionITCaseBase {
                         "+I[13, new.data_13]");
         Assert.assertEquals(expected, sortedActual);
 
-        // Merge branch merge_branch_name again
+        // Fast-forward branch branch_name again
         callProcedure(
                 String.format(
-                        "CALL sys.merge_branch('%s.%s', 'merge_branch_name')",
-                        database, tableName));
+                        "CALL sys.fast_forward('%s.%s', 'branch_name')", 
database, tableName));
 
         // Check main branch data
         result = readTableData(table);
@@ -384,10 +382,10 @@ class BranchActionITCase extends ActionITCaseBase {
         expected = Arrays.asList("+I[1, Hi]", "+I[2, Hello]");
         Assert.assertEquals(expected, sortedActual);
 
-        // Merge branch merge_branch_name_action again
+        // Fast-forward branch branch_name_action again
         createAction(
-                        MergeBranchAction.class,
-                        "merge_branch",
+                        FastForwardAction.class,
+                        "fast_forward",
                         "--warehouse",
                         warehouse,
                         "--database",
@@ -395,7 +393,7 @@ class BranchActionITCase extends ActionITCaseBase {
                         "--table",
                         tableName,
                         "--branch_name",
-                        "merge_branch_name_action")
+                        "branch_name_action")
                 .run();
 
         // Check main branch data
diff --git 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkProcedures.java
 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkProcedures.java
index d423e2045..36d508266 100644
--- 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkProcedures.java
+++ 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkProcedures.java
@@ -25,7 +25,7 @@ import 
org.apache.paimon.spark.procedure.DeleteBranchProcedure;
 import org.apache.paimon.spark.procedure.DeleteTagProcedure;
 import org.apache.paimon.spark.procedure.ExpirePartitionsProcedure;
 import org.apache.paimon.spark.procedure.ExpireSnapshotsProcedure;
-import org.apache.paimon.spark.procedure.MergeBranchProcedure;
+import org.apache.paimon.spark.procedure.FastForwardProcedure;
 import org.apache.paimon.spark.procedure.MigrateFileProcedure;
 import org.apache.paimon.spark.procedure.MigrateTableProcedure;
 import org.apache.paimon.spark.procedure.Procedure;
@@ -68,7 +68,7 @@ public class SparkProcedures {
         procedureBuilders.put("expire_snapshots", 
ExpireSnapshotsProcedure::builder);
         procedureBuilders.put("expire_partitions", 
ExpirePartitionsProcedure::builder);
         procedureBuilders.put("repair", RepairProcedure::builder);
-        procedureBuilders.put("merge_branch", MergeBranchProcedure::builder);
+        procedureBuilders.put("fast_forward", FastForwardProcedure::builder);
         procedureBuilders.put("reset_consumer", 
ResetConsumerProcedure::builder);
         return procedureBuilders.build();
     }
diff --git 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MergeBranchProcedure.java
 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/FastForwardProcedure.java
similarity index 83%
rename from 
paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MergeBranchProcedure.java
rename to 
paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/FastForwardProcedure.java
index ce2db3297..84a76fd79 100644
--- 
a/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/MergeBranchProcedure.java
+++ 
b/paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/FastForwardProcedure.java
@@ -29,13 +29,13 @@ import org.apache.spark.sql.types.StructType;
 import static org.apache.spark.sql.types.DataTypes.StringType;
 
 /**
- * Merge branch procedure for given branch. Usage:
+ * Fast-forward branch procedure for given branch. Usage:
  *
  * <pre><code>
- *  CALL sys.merge_branch('tableId', 'branchName')
+ *  CALL sys.fast_forward('tableId', 'branchName')
  * </code></pre>
  */
-public class MergeBranchProcedure extends BaseProcedure {
+public class FastForwardProcedure extends BaseProcedure {
 
     private static final ProcedureParameter[] PARAMETERS =
             new ProcedureParameter[] {
@@ -49,7 +49,7 @@ public class MergeBranchProcedure extends BaseProcedure {
                         new StructField("result", DataTypes.BooleanType, true, 
Metadata.empty())
                     });
 
-    protected MergeBranchProcedure(TableCatalog tableCatalog) {
+    protected FastForwardProcedure(TableCatalog tableCatalog) {
         super(tableCatalog);
     }
 
@@ -70,23 +70,23 @@ public class MergeBranchProcedure extends BaseProcedure {
         return modifyPaimonTable(
                 tableIdent,
                 table -> {
-                    table.mergeBranch(branch);
+                    table.fastForward(branch);
                     InternalRow outputRow = newInternalRow(true);
                     return new InternalRow[] {outputRow};
                 });
     }
 
     public static ProcedureBuilder builder() {
-        return new BaseProcedure.Builder<MergeBranchProcedure>() {
+        return new BaseProcedure.Builder<FastForwardProcedure>() {
             @Override
-            public MergeBranchProcedure doBuild() {
-                return new MergeBranchProcedure(tableCatalog());
+            public FastForwardProcedure doBuild() {
+                return new FastForwardProcedure(tableCatalog());
             }
         };
     }
 
     @Override
     public String description() {
-        return "MergeBranchProcedure";
+        return "FastForwardProcedure";
     }
 }
diff --git 
a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/MergeBranchProcedureTest.scala
 
b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/MergeBranchProcedureTest.scala
index 47fb86790..0b52a23ba 100644
--- 
a/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/MergeBranchProcedureTest.scala
+++ 
b/paimon-spark/paimon-spark-common/src/test/scala/org/apache/paimon/spark/procedure/MergeBranchProcedureTest.scala
@@ -22,9 +22,9 @@ import org.apache.paimon.spark.PaimonSparkTestBase
 
 import org.apache.spark.sql.Row
 
-class MergeBranchProcedureTest extends PaimonSparkTestBase {
+class FastForwardProcedureTest extends PaimonSparkTestBase {
 
-  test("Paimon procedure: merge branch test") {
+  test("Paimon procedure: fast forward test") {
     spark.sql(s"""
                  |CREATE TABLE T (id STRING, name STRING)
                  |USING PAIMON
@@ -48,7 +48,7 @@ class MergeBranchProcedureTest extends PaimonSparkTestBase {
       Row(true) :: Nil)
 
     checkAnswer(
-      spark.sql("CALL paimon.sys.merge_branch(table => 'test.T', branch => 
'test_branch')"),
+      spark.sql("CALL paimon.sys.fast_forward(table => 'test.T', branch => 
'test_branch')"),
       Row(true) :: Nil)
 
     spark.sql(s"INSERT INTO T VALUES ('5', 'e')")
@@ -58,11 +58,11 @@ class MergeBranchProcedureTest extends PaimonSparkTestBase {
       spark.sql("SELECT * FROM T"),
       Row("1", "a") :: Row("2", "b") :: Row("5", "e") :: Row("6", "f") :: Nil)
 
+    // fast_forward again
     checkAnswer(
-      spark.sql("CALL paimon.sys.merge_branch(table => 'test.T', branch => 
'test_branch')"),
+      spark.sql("CALL paimon.sys.fast_forward(table => 'test.T', branch => 
'test_branch')"),
       Row(true) :: Nil)
 
-    // merge_branch again
     checkAnswer(spark.sql("SELECT * FROM T"), Row("1", "a") :: Row("2", "b") 
:: Nil)
 
   }

Reply via email to