Class DruidSchemaCatalog
java.lang.Object
org.apache.druid.sql.calcite.schema.DruidSchemaCatalog
The Druid 'catalog', containing information about all Druid schemas which are available. This packages both the 'root
level' Calcite
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 Summary
ConstructorsConstructorDescriptionDruidSchemaCatalog(org.apache.calcite.schema.SchemaPlus rootSchema, Map<String, NamedSchema> schemas) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetNamedSchema(String schemaName) Get aNamedSchemabyNamedSchema.getSchemaName()Get allNamedSchemawhich belong to the Druid cataloggetResourceType(String schema, String resourceName) Given the name of aNamedSchemaand the name of a table or function that belongs to that schema, return the appropriate value to use forResource.getType()during authorizationorg.apache.calcite.schema.SchemaPlusRoot calcite schema, used to plan and execute queriesorg.apache.calcite.schema.SchemaPlusgetSubSchema(String name) Get a specificSchemaPlusbyNamedSchema.getSchemaName()Get all sub-schemas defined onrootSchemainthashCode()toString()
-
Constructor Details
-
DruidSchemaCatalog
public DruidSchemaCatalog(org.apache.calcite.schema.SchemaPlus rootSchema, Map<String, NamedSchema> schemas)
-
-
Method Details
-
getRootSchema
public org.apache.calcite.schema.SchemaPlus getRootSchema()Root calcite schema, used to plan and execute queries -
getNamedSchemas
Get allNamedSchemawhich belong to the Druid catalog -
getNamedSchema
Get aNamedSchemabyNamedSchema.getSchemaName() -
getSubSchema
Get a specificSchemaPlusbyNamedSchema.getSchemaName() -
getSubSchemaNames
Get all sub-schemas defined onrootSchema -
getResourceType
Given the name of aNamedSchemaand the name of a table or function that belongs to that schema, return the appropriate value to use forResource.getType()during authorization -
equals
-
hashCode
public int hashCode() -
toString
-