@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.
|
Modifier and Type | Method and Description |
---|---|
void |
applyMove(List<DataField> newFields,
SchemaChange.Move move) |
static void |
checkAlterTableOption(String key,
String oldValue,
String newValue,
boolean fromDynamicOptions) |
static void |
checkAlterTablePath(String key) |
static void |
checkResetTableOption(String key) |
boolean |
commit(TableSchema newSchema) |
TableSchema |
commitChanges(List<SchemaChange> changes)
Update
SchemaChange s. |
TableSchema |
commitChanges(SchemaChange... changes)
Update
SchemaChange s. |
SchemaManager |
copyWithBranch(String branchName) |
TableSchema |
createTable(Schema schema) |
TableSchema |
createTable(Schema schema,
boolean externalTable) |
void |
deleteSchema(long schemaId)
Delete schema with specific id.
|
long |
earliestCreationTime() |
static Identifier |
identifierFromPath(String tablePath,
boolean ignoreIfUnknownDatabase) |
static Identifier |
identifierFromPath(String tablePath,
boolean ignoreIfUnknownDatabase,
String branchName) |
Optional<TableSchema> |
latest() |
List<TableSchema> |
listAll() |
List<Long> |
listAllIds()
List all schema IDs.
|
List<TableSchema> |
listWithRange(Optional<Long> optionalMaxSchemaId,
Optional<Long> optionalMinSchemaId) |
boolean |
mergeSchema(RowType rowType,
boolean allowExplicitCast) |
TableSchema |
schema(long id)
Read schema for schema id.
|
Path |
schemaDirectory() |
boolean |
schemaExists(long id)
Check if a schema exists.
|
List<Path> |
schemaPaths(java.util.function.Predicate<Long> predicate) |
List<TableSchema> |
schemasWithId(List<Long> schemaIds) |
Path |
toSchemaPath(long schemaId) |
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
Exception
public TableSchema createTable(Schema schema, boolean externalTable) 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)
@VisibleForTesting public boolean commit(TableSchema newSchema) throws Exception
Exception
public 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
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–2025 The Apache Software Foundation. All rights reserved.