public interface SchemaPlus extends Schema
Schema interface.
Given a user-defined schema that implements the Schema interface,
Calcite creates a wrapper that implements the SchemaPlus interface.
This provides extra functionality, such as access to tables that have been
added explicitly.
A user-defined schema does not need to implement this interface, but by the time a schema is passed to a method in a user-defined schema or user-defined table, it will have been wrapped in this interface.
Schema.TableType| Modifier and Type | Method and Description |
|---|---|
void |
add(String name,
Function function)
Adds a function to this schema.
|
void |
add(String name,
Lattice lattice)
Adds a lattice to this schema.
|
SchemaPlus |
add(String name,
Schema schema)
Adds a schema as a sub-schema of this schema, and returns the wrapped
object.
|
void |
add(String name,
Table table)
Adds a table to this schema.
|
String |
getName()
Returns the name of this schema.
|
SchemaPlus |
getParentSchema()
Returns the parent schema, or null if this schema has no parent.
|
SchemaPlus |
getSubSchema(String name)
Returns a sub-schema with a given name, or null.
|
boolean |
isCacheEnabled() |
boolean |
isMutable()
Returns whether the user is allowed to create new tables, functions
and sub-schemas in this schema, in addition to those returned automatically
by methods such as
Schema.getTable(String). |
void |
setCacheEnabled(boolean cache) |
void |
setPath(com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<String>> path) |
<T> T |
unwrap(Class<T> clazz)
Returns an underlying object.
|
contentsHaveChangedSince, getExpression, getFunctionNames, getFunctions, getSubSchemaNames, getTable, getTableNamesSchemaPlus getParentSchema()
String getName()
The name must not be null, and must be unique within its parent. The root schema is typically named "".
SchemaPlus getSubSchema(String name)
SchemagetSubSchema in interface Schemaname - Sub-schema nameSchemaPlus add(String name, Schema schema)
boolean isMutable()
SchemaSchema.getTable(String).
Even if this method returns true, the maps are not modified. Calcite stores the defined objects in a wrapper object.
<T> T unwrap(Class<T> clazz)
void setPath(com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<String>> path)
void setCacheEnabled(boolean cache)
boolean isCacheEnabled()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.