Class JdbcConvention
- java.lang.Object
-
- org.apache.calcite.plan.Convention.Impl
-
- org.apache.calcite.adapter.jdbc.JdbcConvention
-
- All Implemented Interfaces:
Convention
,RelTrait
public class JdbcConvention extends Convention.Impl
Calling convention for relational operations that occur in a JDBC database.The convention is a slight misnomer. The operations occur in whatever data-flow architecture the database uses internally. Nevertheless, the result pops out in JDBC.
This is the only convention, thus far, that is not a singleton. Each instance contains a JDBC schema (and therefore a data source). If Calcite is working with two different databases, it would even make sense to convert from "JDBC#A" convention to "JDBC#B", even though we don't do it currently. (That would involve asking database B to open a database link to database A.)
As a result, converter rules from and two this convention need to be instantiated, at the start of planning, for each JDBC database in play.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.plan.Convention
Convention.Impl
-
-
Field Summary
Fields Modifier and Type Field Description static double
COST_MULTIPLIER
Cost of a JDBC node versus implementing an equivalent node in a "typical" calling convention.SqlDialect
dialect
Expression
expression
-
Fields inherited from interface org.apache.calcite.plan.Convention
NONE
-
-
Constructor Summary
Constructors Constructor Description JdbcConvention(SqlDialect dialect, Expression expression, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JdbcConvention
of(SqlDialect dialect, Expression expression, java.lang.String name)
void
register(RelOptPlanner planner)
Registers a trait instance with the planner.-
Methods inherited from class org.apache.calcite.plan.Convention.Impl
canConvertConvention, getInterface, getName, getTraitDef, satisfies, toString, useAbstractConvertersForConversion
-
-
-
-
Field Detail
-
COST_MULTIPLIER
public static final double COST_MULTIPLIER
Cost of a JDBC node versus implementing an equivalent node in a "typical" calling convention.- See Also:
- Constant Field Values
-
dialect
public final SqlDialect dialect
-
expression
public final Expression expression
-
-
Constructor Detail
-
JdbcConvention
public JdbcConvention(SqlDialect dialect, Expression expression, java.lang.String name)
-
-
Method Detail
-
of
public static JdbcConvention of(SqlDialect dialect, Expression expression, java.lang.String name)
-
register
public void register(RelOptPlanner planner)
Description copied from interface:RelTrait
Registers a trait instance with the planner.This is an opportunity to add rules that relate to that trait. However, typical implementations will do nothing.
- Specified by:
register
in interfaceRelTrait
- Overrides:
register
in classConvention.Impl
- Parameters:
planner
- Planner
-
-