Class AbstractSchema
- All Implemented Interfaces:
Schema
- Direct Known Subclasses:
CassandraSchema
,CloneSchema
,CsvSchema
,DruidSchema
,ElasticsearchSchema
,GeodeSchema
,GeodeSimpleSchema
,InnodbSchema
,JdbcCatalogSchema
,MongoSchema
,PigSchema
,ReflectiveSchema
,SplunkSchema
,TpcdsSchema
,TpchSchema
Schema
.
Behavior is as follows:
- The schema has no tables unless you override
getTableMap()
. - The schema has no functions unless you override
getFunctionMultimap()
. - The schema has no sub-schemas unless you override
getSubSchemaMap()
. - The schema is mutable unless you override
isMutable()
. - The name and parent schema are as specified in the constructor arguments.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.calcite.schema.Schema
Schema.TableType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExpression
(@Nullable SchemaPlus parentSchema, String name) Returns the expression by which this schema can be referenced in generated code.Returns a multi-map of functions in this schema by name.Returns the names of the functions in this schema.final Collection<Function>
getFunctions
(String name) Returns a list of functions in this schema with the given name, or an empty list if there is no such function.final @Nullable Schema
getSubSchema
(String name) Returns a sub-schema with a given name, or null.Returns a map of sub-schemas in this schema by name.Returns the names of this schema's child schemas.final @Nullable Table
Returns a table with a given name, or null if not found.Returns a map of tables in this schema by name.Returns the names of the tables in this schema.@Nullable RelProtoDataType
Returns a type with a given name, or null if not found.protected Map<String,
RelProtoDataType> Returns a map of types in this schema by name.Returns the names of the types in this schema.boolean
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 asSchema.getTable(String)
.snapshot
(SchemaVersion version) Returns the snapshot of this schema as of the specified time.
-
Constructor Details
-
AbstractSchema
public AbstractSchema()
-
-
Method Details
-
isMutable
public boolean isMutable()Description copied from interface:Schema
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 asSchema.getTable(String)
.Even if this method returns true, the maps are not modified. Calcite stores the defined objects in a wrapper object.
-
snapshot
Description copied from interface:Schema
Returns the snapshot of this schema as of the specified time. The contents of the schema snapshot should not change over time. -
getExpression
Description copied from interface:Schema
Returns the expression by which this schema can be referenced in generated code.- Specified by:
getExpression
in interfaceSchema
- Parameters:
parentSchema
- Parent schemaname
- Name of this schema- Returns:
- Expression by which this schema can be referenced in generated code
-
getTableMap
Returns a map of tables in this schema by name.The implementations of
getTableNames()
andgetTable(String)
depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.- Returns:
- Map of tables in this schema by name
-
getTableNames
Description copied from interface:Schema
Returns the names of the tables in this schema.- Specified by:
getTableNames
in interfaceSchema
- Returns:
- Names of the tables in this schema
-
getTable
Description copied from interface:Schema
Returns a table with a given name, or null if not found. -
getTypeMap
Returns a map of types in this schema by name.The implementations of
getTypeNames()
andgetType(String)
depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.- Returns:
- Map of types in this schema by name
-
getType
Description copied from interface:Schema
Returns a type with a given name, or null if not found. -
getTypeNames
Description copied from interface:Schema
Returns the names of the types in this schema.- Specified by:
getTypeNames
in interfaceSchema
- Returns:
- Names of the tables in this schema
-
getFunctionMultimap
Returns a multi-map of functions in this schema by name. It is a multi-map because functions are overloaded; there may be more than one function in a schema with a given name (as long as they have different parameter lists).The implementations of
getFunctionNames()
andSchema.getFunctions(String)
depend on this map. The default implementation of this method returns the empty multi-map. Override this method to change their behavior.- Returns:
- Multi-map of functions in this schema by name
-
getFunctions
Description copied from interface:Schema
Returns a list of functions in this schema with the given name, or an empty list if there is no such function.- Specified by:
getFunctions
in interfaceSchema
- Parameters:
name
- Name of function- Returns:
- List of functions with given name, or empty list
-
getFunctionNames
Description copied from interface:Schema
Returns the names of the functions in this schema.- Specified by:
getFunctionNames
in interfaceSchema
- Returns:
- Names of the functions in this schema
-
getSubSchemaMap
Returns a map of sub-schemas in this schema by name.The implementations of
getSubSchemaNames()
andgetSubSchema(String)
depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.- Returns:
- Map of sub-schemas in this schema by name
-
getSubSchemaNames
Description copied from interface:Schema
Returns the names of this schema's child schemas.- Specified by:
getSubSchemaNames
in interfaceSchema
- Returns:
- Names of this schema's child schemas
-
getSubSchema
Description copied from interface:Schema
Returns a sub-schema with a given name, or null.- Specified by:
getSubSchema
in interfaceSchema
- Parameters:
name
- Sub-schema name- Returns:
- Sub-schema with a given name, or null
-