Calcite - Schema

About

A schema is a tree of schema and tables. It's a component of the catalog

The root is called the RootSchema

Example

Sql

select * from schema.table

Definition

Model

For the schema definition in a model, see schemas -

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, org/apache/calcite/adapter/jdbc/JdbcSchema

{
    "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

org/apache/calcite/schema/Schema

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


Powered by ComboStrap