Class 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.

    • 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
    • Constructor Detail

      • JdbcConvention

        public JdbcConvention​(SqlDialect dialect,
                              Expression expression,
                              java.lang.String name)
    • Method Detail

      • 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 interface RelTrait
        Overrides:
        register in class Convention.Impl
        Parameters:
        planner - Planner