Skip to content

Commit

Permalink
add SchemaCache to FileStoreTable
Browse files Browse the repository at this point in the history
  • Loading branch information
wg1026688210 committed Mar 4, 2024
1 parent c75e1d8 commit 0aa4f0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -97,6 +100,7 @@ protected AbstractFileStoreTable(
}
this.tableSchema = tableSchema;
this.catalogEnvironment = catalogEnvironment;
this.schemaCache = new SchemaCache();
}

@Override
Expand Down Expand Up @@ -259,7 +263,7 @@ public FileStoreTable copyWithLatestSchema() {
}

protected SchemaManager schemaManager() {
return new SchemaManager(fileIO(), path);
return new SchemaManager(fileIO(), path, schemaCache);
}

@Override
Expand Down

0 comments on commit 0aa4f0b

Please sign in to comment.