Calcite - Schema

Card Puncher Data Processing

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, 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





Discover More
Card Puncher Data Processing
Calcite - Getting Started (from Sql to Resultset)

A getting started page that shows a query planning process (ie from sql to resultset process) gerardnico/calcite/blob/master/src/test/java/com/gerardnico/calcite/CalciteFrameworksTest.javaCalciteFrameworksTest.java...
Card Puncher Data Processing
Calcite - Model

A model is a file representation of a catalog A model defines: schemas - schema Table...



Share this page:
Follow us:
Task Runner