Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Mar 2, 2024
1 parent e0cfbcb commit f68f0c4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.paimon.fs.FileIO;
import org.apache.paimon.fs.Path;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.table.FileStoreTable;
import org.apache.paimon.table.FileStoreTableFactory;

Expand All @@ -32,6 +33,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.SortedMap;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -191,6 +193,13 @@ public List<TableBranch> branches() {
List<TableBranch> branches = new ArrayList<>();
for (Pair<Path, Long> path : paths) {
String branchName = path.getLeft().getName().substring(BRANCH_PREFIX.length());
Optional<TableSchema> tableSchema = schemaManager.latest(branchName);
if (!tableSchema.isPresent()) {
// Support empty branch.
branches.add(new TableBranch(branchName, null, null, path.getValue()));
continue;
}
System.out.println(tableSchema);
FileStoreTable branchTable =
FileStoreTableFactory.create(
fileIO, new Path(getBranchPath(tablePath, branchName)));
Expand Down

0 comments on commit f68f0c4

Please sign in to comment.