About
A schema is a tree of schema and tables. It's a component of the catalog
The root is called the RootSchema
Articles Related
Example
Sql
select * from schema.table
Definition
Model
Type
In model is an (optional string, default map) that indicates the sub-type:
- map for Map Schema
- custom for Custom Schema
- jdbc for JDBC Schema
Jdbc
in model, apache/calcite/blob/master/core/src/main/java/org/apache/calcite/adapter/jdbc/JdbcSchema.java
{
"version": "1.0",
"defaultSchema": "FOODMART_CLONE",
"schemas": [{
"name": "FOODMART_CLONE",
"type": "custom",
"factory": "org.apache.calcite.adapter.jdbc.JdbcSchema$Factory",
"operand": {
"jdbcDriver": "com.mysql.jdbc.Driver",
"jdbcUrl": "jdbc:mysql://localhost/foodmart",
"jdbcUser": "foodmart",
"jdbcPassword": "foodmart"
}
}
]
}
Interface
apache/calcite/blob/master/core/src/main/java/org/apache/calcite/schema/Schema.java
public interface Schema {
Table getTable(String name);
Set<String> getTablesNames();
Schema getSubSchema(String name);
Set<String> getSubSchemaNames();
}
Table
A BindableTableScan does not require a schema as context