Package org.apache.calcite.adapter.druid
Class DruidSchema
- java.lang.Object
-
- org.apache.calcite.schema.impl.AbstractSchema
-
- org.apache.calcite.adapter.druid.DruidSchema
-
- All Implemented Interfaces:
Schema
public class DruidSchema extends AbstractSchema
Schema mapped onto a Druid instance.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.schema.impl.AbstractSchema
AbstractSchema.Factory
-
Nested classes/interfaces inherited from interface org.apache.calcite.schema.Schema
Schema.TableType
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
coordinatorUrl
private boolean
discoverTables
private java.util.Map<java.lang.String,Table>
tableMap
(package private) java.lang.String
url
-
Constructor Summary
Constructors Constructor Description DruidSchema(java.lang.String url, java.lang.String coordinatorUrl, boolean discoverTables)
Creates a Druid schema.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.String,Table>
getTableMap()
Returns a map of tables in this schema by name.private Table
table(java.lang.String tableName, DruidConnectionImpl connection)
-
Methods inherited from class org.apache.calcite.schema.impl.AbstractSchema
getExpression, getFunctionMultimap, getFunctionNames, getFunctions, getSubSchema, getSubSchemaMap, getSubSchemaNames, getTable, getTableNames, getType, getTypeMap, getTypeNames, isMutable, snapshot
-
-
-
-
Field Detail
-
url
final java.lang.String url
-
coordinatorUrl
final java.lang.String coordinatorUrl
-
discoverTables
private final boolean discoverTables
-
tableMap
private java.util.Map<java.lang.String,Table> tableMap
-
-
Constructor Detail
-
DruidSchema
public DruidSchema(java.lang.String url, java.lang.String coordinatorUrl, boolean discoverTables)
Creates a Druid schema.- Parameters:
url
- URL of query REST service, e.g. "http://localhost:8082"coordinatorUrl
- URL of coordinator REST service, e.g. "http://localhost:8081"discoverTables
- If true, ask Druid what tables exist; if false, only create tables explicitly in the model
-
-
Method Detail
-
getTableMap
protected java.util.Map<java.lang.String,Table> getTableMap()
Description copied from class:AbstractSchema
Returns a map of tables in this schema by name.The implementations of
AbstractSchema.getTableNames()
andAbstractSchema.getTable(String)
depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.- Overrides:
getTableMap
in classAbstractSchema
- Returns:
- Map of tables in this schema by name
-
table
private Table table(java.lang.String tableName, DruidConnectionImpl connection)
-
-