Skip to content

Commit

Permalink
optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Apr 8, 2024
1 parent dbcaf76 commit 5f3b2c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public interface Table extends Serializable {
@Experimental
void createBranch(String branchName);

/** Create a branch from given tag. */
/** Create a branch from given snapshot. */
@Experimental
void createBranch(String branchName, long snapshotId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ public void createBranch(String branchName) {
"Branch name cannot be pure numeric string but is '%s'.",
branchName);
try {
fileIO.mkdirs(branchPath(branchName));
TableSchema latestSchema = schemaManager.latest().get();
fileIO.copyFileUtf8(
schemaManager.toSchemaPath(latestSchema.id()),
schemaManager.branchSchemaPath(branchName, latestSchema.id()));
} catch (IOException e) {
throw new RuntimeException(
String.format(
Expand Down

0 comments on commit 5f3b2c7

Please sign in to comment.