@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 SchemaManager withLock(@Nullable Lock lock)
public Optional<TableSchema> latest()
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
Exception
public TableSchema createTable(Schema schema, boolean ignoreIfExistsSame) throws Exception
Exception
public TableSchema commitChanges(SchemaChange... changes) throws Exception
SchemaChange
s.Exception
public TableSchema commitChanges(List<SchemaChange> changes) throws Catalog.TableNotExistException, Catalog.ColumnAlreadyExistException, Catalog.ColumnNotExistException
SchemaChange
s.public void applyMove(List<DataField> newFields, SchemaChange.Move move)
public boolean mergeSchema(RowType rowType, boolean allowExplicitCast)
public TableSchema schema(long id)
public boolean schemaExists(long id)
public static TableSchema fromPath(FileIO fileIO, Path path)
public Path schemaDirectory()
@VisibleForTesting public Path toSchemaPath(long schemaId)
public List<Path> schemaPaths(java.util.function.Predicate<Long> predicate) throws IOException
IOException
public 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–2024 The Apache Software Foundation. All rights reserved.