Package org.apache.calcite.schema
Interface SchemaFactory
-
- All Known Implementing Classes:
AbstractSchema.Factory
,CassandraSchemaFactory
,CloneSchema.Factory
,CsvSchemaFactory
,DruidSchemaFactory
,ElasticsearchSchemaFactory
,FileSchemaFactory
,GeodeSchemaFactory
,GeodeSimpleSchemaFactory
,JdbcSchema.Factory
,MongoSchemaFactory
,PigSchemaFactory
,ReflectiveSchema.Factory
,TpcdsSchemaFactory
,TpchSchemaFactory
public interface SchemaFactory
Factory forSchema
objects.A schema factory allows you to include a custom schema in a model file. For example, here is a model that contains a custom schema whose tables read CSV files. (See the example CSV adapter for more details about this particular adapter.)
{ "version": "1.0", "defaultSchema": "SALES", "schemas": [ { "name": "SALES", "type": "custom", "factory": "org.apache.calcite.adapter.csv.CsvSchemaFactory", "mutable": true, "operand": { directory: "target/test-classes/sales" }, "tables": [ { "name": "FEMALE_EMPS", "type": "view", "sql": "SELECT * FROM emps WHERE gender = 'F'" } ] } ] }
If you do not wish to allow model authors to add additional tables (including views) to an instance of your schema, specify 'mutable: false'.
A class that implements SchemaFactory specified in a schema must have a public default constructor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Schema
create(SchemaPlus parentSchema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand)
Creates a Schema.
-
-
-
Method Detail
-
create
Schema create(SchemaPlus parentSchema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand)
Creates a Schema.- Parameters:
parentSchema
- Parent schemaname
- Name of this schemaoperand
- The "operand" JSON property- Returns:
- Created schema
-
-