public class DruidSchemaCatalog extends Object
SchemaPlus and a map of the NamedSchema which were used to populate it, keyed by
NamedSchema.getSchemaName().
The rootSchema is a top level Calcite schema, which contains all NamedSchema.getSchema() and
InformationSchema added as sub-schemas, and this class provides convenience methods to do things like
fetch a specific SchemaPlus by name or list the set of all schemas available, and is used during query
planning and execution.
namedSchemas contains all NamedSchema, which should be everything except InformationSchema.
These are used primarily for getResourceType(String, String), which given the name of a table or function
that belongs to some NamedSchema, lookup the most appropriate value to use for
Resource.getType() to use for authorization.| Constructor and Description |
|---|
DruidSchemaCatalog(org.apache.calcite.schema.SchemaPlus rootSchema,
Map<String,NamedSchema> schemas) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
NamedSchema |
getNamedSchema(String schemaName)
Get a
NamedSchema by NamedSchema.getSchemaName() |
Map<String,NamedSchema> |
getNamedSchemas()
Get all
NamedSchema which belong to the Druid catalog |
String |
getResourceType(String schema,
String resourceName)
Given the name of a
NamedSchema and the name of a table or function that belongs to that schema, return
the appropriate value to use for Resource.getType() during authorization |
org.apache.calcite.schema.SchemaPlus |
getRootSchema()
Root calcite schema, used to plan and execute queries
|
org.apache.calcite.schema.SchemaPlus |
getSubSchema(String name)
Get a specific
SchemaPlus by NamedSchema.getSchemaName() |
Set<String> |
getSubSchemaNames()
Get all sub-schemas defined on
rootSchema |
int |
hashCode() |
String |
toString() |
public DruidSchemaCatalog(org.apache.calcite.schema.SchemaPlus rootSchema,
Map<String,NamedSchema> schemas)
public org.apache.calcite.schema.SchemaPlus getRootSchema()
public Map<String,NamedSchema> getNamedSchemas()
NamedSchema which belong to the Druid catalogpublic NamedSchema getNamedSchema(String schemaName)
NamedSchema by NamedSchema.getSchemaName()public org.apache.calcite.schema.SchemaPlus getSubSchema(String name)
SchemaPlus by NamedSchema.getSchemaName()public Set<String> getSubSchemaNames()
rootSchema@Nullable public String getResourceType(String schema, String resourceName)
NamedSchema and the name of a table or function that belongs to that schema, return
the appropriate value to use for Resource.getType() during authorizationCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.