diff --git a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java index b4c0dbdd3977c..2b90fef613766 100644 --- a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java +++ b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaManager.java @@ -88,8 +88,7 @@ public SchemaManager(FileIO fileIO, Path tableRoot) { this(fileIO, tableRoot, new SchemaCache()); } - @VisibleForTesting - SchemaManager(FileIO fileIO, Path tableRoot, SchemaCache schemaCache) { + public SchemaManager(FileIO fileIO, Path tableRoot, SchemaCache schemaCache) { this.fileIO = fileIO; this.tableRoot = tableRoot; this.schemaCache = schemaCache; 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 bdc81f3c1d9ec..366668f9e482d 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 @@ -31,6 +31,7 @@ import org.apache.paimon.operation.FileStoreScan; import org.apache.paimon.options.Options; import org.apache.paimon.predicate.Predicate; +import org.apache.paimon.schema.SchemaCache; import org.apache.paimon.schema.SchemaManager; import org.apache.paimon.schema.SchemaValidation; import org.apache.paimon.schema.TableSchema; @@ -82,6 +83,8 @@ abstract class AbstractFileStoreTable implements FileStoreTable { protected final TableSchema tableSchema; protected final CatalogEnvironment catalogEnvironment; + protected final SchemaCache schemaCache; + protected AbstractFileStoreTable( FileIO fileIO, Path path, @@ -97,6 +100,7 @@ protected AbstractFileStoreTable( } this.tableSchema = tableSchema; this.catalogEnvironment = catalogEnvironment; + this.schemaCache = new SchemaCache(); } @Override @@ -259,7 +263,7 @@ public FileStoreTable copyWithLatestSchema() { } protected SchemaManager schemaManager() { - return new SchemaManager(fileIO(), path); + return new SchemaManager(fileIO(), path, schemaCache); } @Override