public class AbstractSchema extends java.lang.Object implements Schema
Schema
.
Behavior is as follows:
getTableMap()
.getFunctionMultimap()
.getSubSchemaMap()
.isMutable()
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractSchema.Factory
Schema factory that creates an
AbstractSchema . |
Schema.TableType
Constructor and Description |
---|
AbstractSchema() |
Modifier and Type | Method and Description |
---|---|
Expression |
getExpression(SchemaPlus parentSchema,
java.lang.String name)
Returns the expression by which this schema can be referenced in generated
code.
|
protected com.google.common.collect.Multimap<java.lang.String,Function> |
getFunctionMultimap()
Returns a multi-map of functions in this schema by name.
|
java.util.Set<java.lang.String> |
getFunctionNames()
Returns the names of the functions in this schema.
|
java.util.Collection<Function> |
getFunctions(java.lang.String name)
Returns a list of functions in this schema with the given name, or
an empty list if there is no such function.
|
Schema |
getSubSchema(java.lang.String name)
Returns a sub-schema with a given name, or null.
|
protected java.util.Map<java.lang.String,Schema> |
getSubSchemaMap()
Returns a map of sub-schemas in this schema by name.
|
java.util.Set<java.lang.String> |
getSubSchemaNames()
Returns the names of this schema's child schemas.
|
Table |
getTable(java.lang.String name)
Returns a table with a given name, or null if not found.
|
protected java.util.Map<java.lang.String,Table> |
getTableMap()
Returns a map of tables in this schema by name.
|
java.util.Set<java.lang.String> |
getTableNames()
Returns the names of the tables in this schema.
|
RelProtoDataType |
getType(java.lang.String name)
Returns a type with a given name, or null if not found.
|
protected java.util.Map<java.lang.String,RelProtoDataType> |
getTypeMap()
Returns a map of types in this schema by name.
|
java.util.Set<java.lang.String> |
getTypeNames()
Returns the names of the types in this schema.
|
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) . |
Schema |
snapshot(SchemaVersion version)
Returns the snapshot of this schema as of the specified time.
|
public boolean isMutable()
Schema
Schema.getTable(String)
.
Even if this method returns true, the maps are not modified. Calcite stores the defined objects in a wrapper object.
public Schema snapshot(SchemaVersion version)
Schema
public Expression getExpression(SchemaPlus parentSchema, java.lang.String name)
Schema
getExpression
in interface Schema
parentSchema
- Parent schemaname
- Name of this schemaprotected java.util.Map<java.lang.String,Table> getTableMap()
The implementations of getTableNames()
and getTable(String)
depend on this map.
The default implementation of this method returns the empty map.
Override this method to change their behavior.
public final java.util.Set<java.lang.String> getTableNames()
Schema
getTableNames
in interface Schema
public final Table getTable(java.lang.String name)
Schema
protected java.util.Map<java.lang.String,RelProtoDataType> getTypeMap()
The implementations of getTypeNames()
and getType(String)
depend on this map.
The default implementation of this method returns the empty map.
Override this method to change their behavior.
public RelProtoDataType getType(java.lang.String name)
Schema
public java.util.Set<java.lang.String> getTypeNames()
Schema
getTypeNames
in interface Schema
protected com.google.common.collect.Multimap<java.lang.String,Function> getFunctionMultimap()
The implementations of getFunctionNames()
and Schema.getFunctions(String)
depend on this map.
The default implementation of this method returns the empty multi-map.
Override this method to change their behavior.
public final java.util.Collection<Function> getFunctions(java.lang.String name)
Schema
getFunctions
in interface Schema
name
- Name of functionpublic final java.util.Set<java.lang.String> getFunctionNames()
Schema
getFunctionNames
in interface Schema
protected java.util.Map<java.lang.String,Schema> getSubSchemaMap()
The implementations of getSubSchemaNames()
and getSubSchema(String)
depend on this map.
The default implementation of this method returns the empty map.
Override this method to change their behavior.
public final java.util.Set<java.lang.String> getSubSchemaNames()
Schema
getSubSchemaNames
in interface Schema
public final Schema getSubSchema(java.lang.String name)
Schema
getSubSchema
in interface Schema
name
- Sub-schema nameCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.