@Evolving public interface SupportsSchemas
Modifier and Type | Method and Description |
---|---|
Schema |
alterSchema(java.lang.String schemaName,
SchemaChange... changes)
Apply the metadata change to a schema in the catalog.
|
Schema |
createSchema(java.lang.String schemaName,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Creates a schema in the catalog based on the provided details.
|
boolean |
dropSchema(java.lang.String schemaName,
boolean cascade)
Drop a schema from the catalog.
|
java.lang.String[] |
listSchemas()
List schemas under the entity.
|
Schema |
loadSchema(java.lang.String schemaName)
Load metadata properties for a schema.
|
default boolean |
schemaExists(java.lang.String schemaName)
Check if a schema exists.
|
java.lang.String[] listSchemas() throws NoSuchCatalogException
If an entity such as a table, view exists, its parent schemas must also exist and must be returned by this discovery method. For example, if table a.b.t exists, this method invoked as listSchemas(a) must return [b] in the result array
NoSuchCatalogException
- If the catalog does not exist.default boolean schemaExists(java.lang.String schemaName)
If an entity such as a table, view exists, its parent namespaces must also exist. For example, if table a.b.t exists, this method invoked as schemaExists(a.b) must return true.
schemaName
- The name of the schema.Schema createSchema(java.lang.String schemaName, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchCatalogException, SchemaAlreadyExistsException
This method returns the schema as defined by the user without applying all defaults. If you
need the schema with default values applied, use the loadSchema(String)
method after
creation.
schemaName
- The name of the schema.comment
- The comment of the schema.properties
- The properties of the schema.NoSuchCatalogException
- If the catalog does not exist.SchemaAlreadyExistsException
- If the schema already exists.Schema loadSchema(java.lang.String schemaName) throws NoSuchSchemaException
schemaName
- The name of the schema.NoSuchSchemaException
- If the schema does not exist (optional).Schema alterSchema(java.lang.String schemaName, SchemaChange... changes) throws NoSuchSchemaException
schemaName
- The name of the schema.changes
- The metadata changes to apply.NoSuchSchemaException
- If the schema does not exist.boolean dropSchema(java.lang.String schemaName, boolean cascade) throws NonEmptySchemaException
If the catalog implementation does not support this operation, it may throw UnsupportedOperationException
.
schemaName
- The name of the schema.cascade
- If true, recursively drop all objects within the schema.NonEmptySchemaException
- If the schema is not empty and cascade is false.