public class CalciteSchema extends Object
Wrapper around user-defined schema used internally.
| Modifier and Type | Class and Description |
|---|---|
static class |
CalciteSchema.Entry
Entry in a schema, such as a table or sub-schema.
|
static class |
CalciteSchema.FunctionEntry
Membership of a function in a schema.
|
static class |
CalciteSchema.FunctionEntryImpl
Implementation of
CalciteSchema.FunctionEntry
where all properties are held in fields. |
static class |
CalciteSchema.LatticeEntry
Membership of a lattice in a schema.
|
static class |
CalciteSchema.LatticeEntryImpl
Implementation of
CalciteSchema.LatticeEntry
where all properties are held in fields. |
static class |
CalciteSchema.TableEntry
Membership of a table in a schema.
|
static class |
CalciteSchema.TableEntryImpl
Implementation of
CalciteSchema.TableEntry
where all properties are held in fields. |
| Modifier and Type | Field and Description |
|---|---|
String |
name |
Schema |
schema |
NavigableMap<String,CalciteSchema.TableEntry> |
tableMap
Tables explicitly defined in this schema.
|
| Constructor and Description |
|---|
CalciteSchema(CalciteSchema parent,
Schema schema,
String name) |
| Modifier and Type | Method and Description |
|---|---|
CalciteSchema |
add(String name,
Schema schema)
Adds a child schema of this schema.
|
CalciteSchema.TableEntry |
add(String tableName,
Table table)
Defines a table within this schema.
|
CalciteSchema.TableEntry |
add(String tableName,
Table table,
com.google.common.collect.ImmutableList<String> sqls)
Defines a table within this schema.
|
static CalciteRootSchema |
createRootSchema(boolean addMetadataSchema)
Creates a root schema.
|
static CalciteSchema |
from(SchemaPlus plus) |
NavigableSet<String> |
getFunctionNames()
Returns the list of function names in this schema, both implicit and
explicit, never null.
|
Collection<Function> |
getFunctions(String name,
boolean caseSensitive)
Returns a collection of all functions, explicit and implicit, with a given
name.
|
NavigableMap<String,CalciteSchema.LatticeEntry> |
getLatticeMap()
Returns a collection of lattices.
|
String |
getName() |
List<? extends List<String>> |
getPath()
Returns the default path resolving functions from this schema.
|
CalciteSchema |
getSubSchema(String schemaName,
boolean caseSensitive) |
NavigableMap<String,CalciteSchema> |
getSubSchemaMap()
Returns a collection of sub-schemas, both explicit (defined using
add(String, org.apache.calcite.schema.Schema)) and implicit
(defined using Schema.getSubSchemaNames()
and Schema.getSubSchema(String)). |
Pair<String,Table> |
getTable(String tableName,
boolean caseSensitive)
Returns a table with the given name.
|
Pair<String,Table> |
getTableBasedOnNullaryFunction(String tableName,
boolean caseSensitive)
Returns a tables derived from explicit and implicit functions
that take zero parameters.
|
Pair<String,Table> |
getTableBySql(String sql)
Returns a table that materializes the given SQL statement.
|
NavigableSet<String> |
getTableNames()
Returns the set of all table names.
|
NavigableMap<String,Table> |
getTablesBasedOnNullaryFunctions()
Returns tables derived from explicit and implicit functions
that take zero parameters.
|
List<String> |
path(String name)
Returns the path of an object in this schema.
|
SchemaPlus |
plus() |
CalciteRootSchema |
root() |
public final Schema schema
public final String name
public final NavigableMap<String,CalciteSchema.TableEntry> tableMap
schema.public CalciteSchema(CalciteSchema parent, Schema schema, String name)
public static CalciteRootSchema createRootSchema(boolean addMetadataSchema)
addMetadataSchema argument is
true a "metadata" schema containing definitions of tables, columns etc. is
added to root schema.public CalciteSchema.TableEntry add(String tableName, Table table)
public CalciteSchema.TableEntry add(String tableName, Table table, com.google.common.collect.ImmutableList<String> sqls)
public CalciteRootSchema root()
public final CalciteSchema getSubSchema(String schemaName, boolean caseSensitive)
public CalciteSchema add(String name, Schema schema)
public final Pair<String,Table> getTableBySql(String sql)
public final Pair<String,Table> getTable(String tableName, boolean caseSensitive)
public String getName()
public SchemaPlus plus()
public static CalciteSchema from(SchemaPlus plus)
public List<? extends List<String>> getPath()
The path consists is a list of lists of strings. Each list of strings represents the path of a schema from the root schema. For example, [[], [foo], [foo, bar, baz]] represents three schemas: the root schema "/" (level 0), "/foo" (level 1) and "/foo/bar/baz" (level 3).
public NavigableMap<String,CalciteSchema> getSubSchemaMap()
add(String, org.apache.calcite.schema.Schema)) and implicit
(defined using Schema.getSubSchemaNames()
and Schema.getSubSchema(String)).public NavigableMap<String,CalciteSchema.LatticeEntry> getLatticeMap()
All are explicit (defined using add(String, Lattice)).
public NavigableSet<String> getTableNames()
public Collection<Function> getFunctions(String name, boolean caseSensitive)
public NavigableSet<String> getFunctionNames()
public NavigableMap<String,Table> getTablesBasedOnNullaryFunctions()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.