@ThreadSafe public class SchemaManager extends Object implements Serializable
| Constructor and Description |
|---|
SchemaManager(FileIO fileIO,
Path tableRoot) |
SchemaManager(FileIO fileIO,
Path tableRoot,
String branch)
Specify the default branch for data writing.
|
public SchemaManager copyWithBranch(String branchName)
public Optional<TableSchema> latest()
public long earliestCreationTime()
public List<TableSchema> listAll()
public List<TableSchema> schemasWithId(List<Long> schemaIds)
public List<TableSchema> listWithRange(Optional<Long> optionalMaxSchemaId, Optional<Long> optionalMinSchemaId)
public TableSchema createTable(Schema schema) throws Exception
Exceptionpublic TableSchema createTable(Schema schema, boolean externalTable) throws Exception
Exceptionpublic TableSchema commitChanges(SchemaChange... changes) throws Exception
SchemaChanges.Exceptionpublic TableSchema commitChanges(List<SchemaChange> changes) throws Catalog.TableNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
SchemaChanges.public TableSchema generateTableSchema(TableSchema oldTableSchema, List<SchemaChange> changes, LazyField<Boolean> hasSnapshots) throws Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
public void applyMove(List<DataField> newFields, SchemaChange.Move move)
public boolean mergeSchema(RowType rowType, boolean allowExplicitCast)
@VisibleForTesting public boolean commit(TableSchema newSchema) throws Exception
Exceptionpublic TableSchema schema(long id)
public boolean schemaExists(long id)
public Path schemaDirectory()
@VisibleForTesting public Path toSchemaPath(long schemaId)
public List<Path> schemaPaths(java.util.function.Predicate<Long> predicate) throws IOException
IOExceptionpublic void deleteSchema(long schemaId)
schemaId - the schema id to delete.public static void checkAlterTableOption(String key, @Nullable String oldValue, String newValue, boolean fromDynamicOptions)
public static void checkResetTableOption(String key)
public static void checkAlterTablePath(String key)
public static Identifier identifierFromPath(String tablePath, boolean ignoreIfUnknownDatabase)
public static Identifier identifierFromPath(String tablePath, boolean ignoreIfUnknownDatabase, @Nullable String branchName)
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.