Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.apache.paimon.manifest.ManifestFileMeta;
import org.apache.paimon.operation.ManifestFileMerger;
import org.apache.paimon.options.Options;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.stats.SimpleStats;
import org.apache.paimon.types.IntType;
import org.apache.paimon.types.RowType;
Expand Down Expand Up @@ -294,7 +294,7 @@ private ManifestFile createManifestFile() {
null);
return new ManifestFile.Factory(
fileIO,
new SchemaManager(fileIO, tablePath),
new FileSystemSchemaManager(fileIO, tablePath),
PARTITION_TYPE,
FileFormat.fromIdentifier("avro", new Options()),
"zstd",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.paimon.partition.Partition;
import org.apache.paimon.partition.PartitionStatistics;
import org.apache.paimon.rest.responses.GetTagResponse;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaChange;
import org.apache.paimon.schema.SchemaManager;
Expand Down Expand Up @@ -886,7 +887,8 @@ protected List<String> listTablesInFileSystem(Path databasePath) throws IOExcept
}

protected boolean tableExistsInFileSystem(Path tablePath, String branchName) {
SchemaManager schemaManager = new SchemaManager(fileIO(tablePath), tablePath, branchName);
SchemaManager schemaManager =
new FileSystemSchemaManager(fileIO(tablePath), tablePath, branchName);

// in order to improve the performance, check the schema-0 firstly.
boolean schemaZeroExists = schemaManager.schemaExists(0);
Expand All @@ -900,7 +902,7 @@ protected boolean tableExistsInFileSystem(Path tablePath, String branchName) {

public Optional<TableSchema> tableSchemaInFileSystem(Path tablePath, String branchName) {
Optional<TableSchema> schema =
new SchemaManager(fileIO(tablePath), tablePath, branchName).latest();
new FileSystemSchemaManager(fileIO(tablePath), tablePath, branchName).latest();
if (!DEFAULT_MAIN_BRANCH.equals(branchName)) {
schema =
schema.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.paimon.fs.FileIO;
import org.apache.paimon.fs.Path;
import org.apache.paimon.operation.Lock;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaChange;
import org.apache.paimon.schema.SchemaManager;
Expand Down Expand Up @@ -151,7 +152,7 @@ public <T> T runWithLock(Identifier identifier, Callable<T> callable) throws Exc

private SchemaManager schemaManager(Identifier identifier) {
Path path = getTableLocation(identifier);
return new SchemaManager(fileIO, path, identifier.getBranchNameOrDefault());
return new FileSystemSchemaManager(fileIO, path, identifier.getBranchNameOrDefault());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.options.Options;
import org.apache.paimon.partition.PartitionPredicate;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.table.FileStoreTable;
Expand Down Expand Up @@ -1957,7 +1958,7 @@ private boolean isSameFormatVersion(int baseFormatVersion) {

private class SchemaCache {

SchemaManager schemaManager = new SchemaManager(table.fileIO(), table.location());
SchemaManager schemaManager = new FileSystemSchemaManager(table.fileIO(), table.location());
Map<Long, IcebergSchema> schemas = new HashMap<>();

private IcebergSchema get(long schemaId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.paimon.manifest.ManifestEntry;
import org.apache.paimon.options.Options;
import org.apache.paimon.reader.RecordReader;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.SchemaManager;
import org.apache.paimon.schema.TableSchema;
import org.apache.paimon.table.FileStoreTable;
Expand Down Expand Up @@ -75,7 +76,8 @@ public FileIndexProcessor(FileStoreTable table) {
this.pathFactory = table.store().pathFactory();
this.pathFactories = new DataFilePathFactories(pathFactory);
this.schemaInfoCache =
new SchemaCache(fileIndexOptions, new SchemaManager(fileIO, table.location()));
new SchemaCache(
fileIndexOptions, new FileSystemSchemaManager(fileIO, table.location()));
this.sizeInMeta = table.coreOptions().fileIndexInManifestThreshold();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.paimon.operation.Lock;
import org.apache.paimon.options.CatalogOptions;
import org.apache.paimon.options.Options;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaChange;
import org.apache.paimon.schema.SchemaManager;
Expand Down Expand Up @@ -668,7 +669,7 @@ protected void renameTableImpl(Identifier fromTable, Identifier toTable) {
}

Path fromPath = getTableLocation(fromTable);
if (!new SchemaManager(fileIO, fromPath).listAllIds().isEmpty()) {
if (!new FileSystemSchemaManager(fileIO, fromPath).listAllIds().isEmpty()) {
// Rename the file system's table directory. Maintain consistency between tables in
// the file system and tables in the Hive Metastore.
Path toPath = getTableLocation(toTable);
Expand Down Expand Up @@ -975,7 +976,7 @@ private Map<String, String> collectTableProperties(TableSchema tableSchema) {
}

private SchemaManager getSchemaManager(Identifier identifier) {
return new SchemaManager(fileIO, getTableLocation(identifier));
return new FileSystemSchemaManager(fileIO, getTableLocation(identifier));
}

private Map<String, String> fetchProperties(String databaseName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.apache.paimon.rest.responses.GetTableResponse;
import org.apache.paimon.rest.responses.GetTagResponse;
import org.apache.paimon.rest.responses.GetViewResponse;
import org.apache.paimon.schema.FileSystemSchemaManager;
import org.apache.paimon.schema.Schema;
import org.apache.paimon.schema.SchemaChange;
import org.apache.paimon.schema.SchemaManager;
Expand Down Expand Up @@ -1411,7 +1412,7 @@ private Schema inferSchemaIfExternalPaimonTable(Schema schema) throws Exception
if (TableType.TABLE.equals(tableType) && Objects.nonNull(externalLocation)) {
Path externalPath = new Path(externalLocation);
SchemaManager schemaManager =
new SchemaManager(fileIOFromOptions(externalPath), externalPath);
new FileSystemSchemaManager(fileIOFromOptions(externalPath), externalPath);
Optional<TableSchema> latest = schemaManager.latest();
if (latest.isPresent()) {
// Note we just validate schema here, will not create a new table
Expand Down
Loading
Loading