Calcite - (Planner) Rule (RelOptRule)

Card Puncher Data Processing


A rule is used to modified a relational expression (ie query plan)

They are used by the planner to:

relational algebra expressions (ie query plan).

Every rule extends RelOptRule (and are used by the planner (RelOptPlanner)).


Two types of rules:


  • Converters rule implement Converter and convert from one convention to an another.
  • Converter rules applied via convert

A ConverterRule converts between calling conventions.


  • indicates what system will actually execute the query by assigning a particular call.

Calcite Converter Rule


A rule that match a subtree of a relational algebra expression and replace it with a different subtree. ie it is a rule to transform an relational expression to another.

Example: exchange the order of Filter and a Project nodes.

Match: Transformer Rules are matched to elements of a query plan using pattern matching. onMatch is called for matched rules

Calcite Transpose Rule



Documentation / Reference

Discover More
Card Puncher Data Processing
Calcite (Farrago, Optiq)

Calcite is a Java SQL Processing engine where the data storage is developed in plugin. Calcite is an open source cost based query optimizer and query execution framework. SQL Parser SQL Validation...
Card Puncher Data Processing
Calcite - Field

in calcite. You can reference a field (cell) by name or ordinal. Ordinals are zero-based. Each operator guarantees the order in which its output fields occur. For example, Project returns the fields...
Card Puncher Data Processing
Calcite - Optimizer (RelOptCluster)

The optimizer is a program that takes a relational expression (query plan) and rewrites it with optimization rules. The output is still a relational expression and is generally called the physical plan....
Card Puncher Data Processing
Calcite - Planner (RelOptPlanner)

org/apache/calcite/plan/package-infoPlan provides an optimizer interface (ie Defines interfaces for constructing rule-based optimizers of relational expressions) Frameworks...

Share this page:
Follow us:
Task Runner