Class Frameworks.StdFrameworkConfig
- java.lang.Object
-
- org.apache.calcite.tools.Frameworks.StdFrameworkConfig
-
- All Implemented Interfaces:
FrameworkConfig
- Enclosing class:
- Frameworks
static class Frameworks.StdFrameworkConfig extends java.lang.Object implements FrameworkConfig
An implementation ofFrameworkConfig
that uses standard Calcite classes to provide basic planner functionality.
-
-
Field Summary
Fields Modifier and Type Field Description private Context
context
private SqlRexConvertletTable
convertletTable
private RelOptCostFactory
costFactory
private SchemaPlus
defaultSchema
private boolean
evolveLattice
private RexExecutor
executor
private SqlOperatorTable
operatorTable
private SqlParser.Config
parserConfig
private com.google.common.collect.ImmutableList<Program>
programs
private SqlToRelConverter.Config
sqlToRelConverterConfig
private SqlStatisticProvider
statisticProvider
private com.google.common.collect.ImmutableList<RelTraitDef>
traitDefs
private RelDataTypeSystem
typeSystem
private RelOptTable.ViewExpander
viewExpander
-
Constructor Summary
Constructors Constructor Description StdFrameworkConfig(Context context, SqlRexConvertletTable convertletTable, SqlOperatorTable operatorTable, com.google.common.collect.ImmutableList<Program> programs, com.google.common.collect.ImmutableList<RelTraitDef> traitDefs, SqlParser.Config parserConfig, SqlToRelConverter.Config sqlToRelConverterConfig, SchemaPlus defaultSchema, RelOptCostFactory costFactory, RelDataTypeSystem typeSystem, RexExecutor executor, boolean evolveLattice, SqlStatisticProvider statisticProvider, RelOptTable.ViewExpander viewExpander)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
getContext()
Returns the PlannerContext that should be made available during planning by callingRelOptPlanner.getContext()
.SqlRexConvertletTable
getConvertletTable()
Returns the convertlet table that should be used when converting from SQL to row expressionsRelOptCostFactory
getCostFactory()
Returns the cost factory that should be used when creating the planner.SchemaPlus
getDefaultSchema()
Returns the default schema that should be checked before looking at the root schema.RexExecutor
getExecutor()
Returns the executor used to evaluate constant expressions.SqlOperatorTable
getOperatorTable()
Returns operator table that should be used to resolve functions and operators during query validation.SqlParser.Config
getParserConfig()
The configuration of SQL parser.com.google.common.collect.ImmutableList<Program>
getPrograms()
Returns a list of one or more programs used during the course of query evaluation.SqlToRelConverter.Config
getSqlToRelConverterConfig()
The configuration ofSqlToRelConverter
.SqlStatisticProvider
getStatisticProvider()
Returns the source of statistics about tables and columns to be used by the lattice suggester to deduce primary keys, foreign keys, and the direction of relationships.com.google.common.collect.ImmutableList<RelTraitDef>
getTraitDefs()
Returns a list of trait definitions.RelDataTypeSystem
getTypeSystem()
Returns the type system.RelOptTable.ViewExpander
getViewExpander()
Returns a view expander.boolean
isEvolveLattice()
Returns whether the lattice suggester should try to widen a lattice when a new query arrives that doesn't quite fit, as opposed to creating a new lattice.
-
-
-
Field Detail
-
context
private final Context context
-
convertletTable
private final SqlRexConvertletTable convertletTable
-
operatorTable
private final SqlOperatorTable operatorTable
-
programs
private final com.google.common.collect.ImmutableList<Program> programs
-
traitDefs
private final com.google.common.collect.ImmutableList<RelTraitDef> traitDefs
-
parserConfig
private final SqlParser.Config parserConfig
-
sqlToRelConverterConfig
private final SqlToRelConverter.Config sqlToRelConverterConfig
-
defaultSchema
private final SchemaPlus defaultSchema
-
costFactory
private final RelOptCostFactory costFactory
-
typeSystem
private final RelDataTypeSystem typeSystem
-
executor
private final RexExecutor executor
-
evolveLattice
private final boolean evolveLattice
-
statisticProvider
private final SqlStatisticProvider statisticProvider
-
viewExpander
private final RelOptTable.ViewExpander viewExpander
-
-
Constructor Detail
-
StdFrameworkConfig
StdFrameworkConfig(Context context, SqlRexConvertletTable convertletTable, SqlOperatorTable operatorTable, com.google.common.collect.ImmutableList<Program> programs, com.google.common.collect.ImmutableList<RelTraitDef> traitDefs, SqlParser.Config parserConfig, SqlToRelConverter.Config sqlToRelConverterConfig, SchemaPlus defaultSchema, RelOptCostFactory costFactory, RelDataTypeSystem typeSystem, RexExecutor executor, boolean evolveLattice, SqlStatisticProvider statisticProvider, RelOptTable.ViewExpander viewExpander)
-
-
Method Detail
-
getParserConfig
public SqlParser.Config getParserConfig()
Description copied from interface:FrameworkConfig
The configuration of SQL parser.- Specified by:
getParserConfig
in interfaceFrameworkConfig
-
getSqlToRelConverterConfig
public SqlToRelConverter.Config getSqlToRelConverterConfig()
Description copied from interface:FrameworkConfig
The configuration ofSqlToRelConverter
.- Specified by:
getSqlToRelConverterConfig
in interfaceFrameworkConfig
-
getDefaultSchema
public SchemaPlus getDefaultSchema()
Description copied from interface:FrameworkConfig
Returns the default schema that should be checked before looking at the root schema. Returns null to only consult the root schema.- Specified by:
getDefaultSchema
in interfaceFrameworkConfig
-
getExecutor
public RexExecutor getExecutor()
Description copied from interface:FrameworkConfig
Returns the executor used to evaluate constant expressions.- Specified by:
getExecutor
in interfaceFrameworkConfig
-
getPrograms
public com.google.common.collect.ImmutableList<Program> getPrograms()
Description copied from interface:FrameworkConfig
Returns a list of one or more programs used during the course of query evaluation.The common use case is when there is a single program created using
Programs.of(RuleSet)
andPlanner.transform(int, org.apache.calcite.plan.RelTraitSet, org.apache.calcite.rel.RelNode)
will only be called once.However, consumers may also create programs not based on rule sets, register multiple programs, and do multiple repetitions of
Planner.transform(int, org.apache.calcite.plan.RelTraitSet, org.apache.calcite.rel.RelNode)
planning cycles using different indices.The order of programs provided here determines the zero-based indices of programs elsewhere in this class.
- Specified by:
getPrograms
in interfaceFrameworkConfig
-
getCostFactory
public RelOptCostFactory getCostFactory()
Description copied from interface:FrameworkConfig
Returns the cost factory that should be used when creating the planner. If null, use the default cost factory for that planner.- Specified by:
getCostFactory
in interfaceFrameworkConfig
-
getTraitDefs
public com.google.common.collect.ImmutableList<RelTraitDef> getTraitDefs()
Description copied from interface:FrameworkConfig
Returns a list of trait definitions.If the list is not null, the planner first de-registers any existing
RelTraitDef
s, then registers theRelTraitDef
s in this list.The order of
RelTraitDef
s in the list matters if the planner is VolcanoPlanner. The planner callsRelTraitDef.convert(org.apache.calcite.plan.RelOptPlanner, org.apache.calcite.rel.RelNode, T, boolean)
in the order of this list. The most important trait comes first in the list, followed by the second most important one, etc.- Specified by:
getTraitDefs
in interfaceFrameworkConfig
-
getConvertletTable
public SqlRexConvertletTable getConvertletTable()
Description copied from interface:FrameworkConfig
Returns the convertlet table that should be used when converting from SQL to row expressions- Specified by:
getConvertletTable
in interfaceFrameworkConfig
-
getContext
public Context getContext()
Description copied from interface:FrameworkConfig
Returns the PlannerContext that should be made available during planning by callingRelOptPlanner.getContext()
.- Specified by:
getContext
in interfaceFrameworkConfig
-
getOperatorTable
public SqlOperatorTable getOperatorTable()
Description copied from interface:FrameworkConfig
Returns operator table that should be used to resolve functions and operators during query validation.- Specified by:
getOperatorTable
in interfaceFrameworkConfig
-
getTypeSystem
public RelDataTypeSystem getTypeSystem()
Description copied from interface:FrameworkConfig
Returns the type system.- Specified by:
getTypeSystem
in interfaceFrameworkConfig
-
isEvolveLattice
public boolean isEvolveLattice()
Description copied from interface:FrameworkConfig
Returns whether the lattice suggester should try to widen a lattice when a new query arrives that doesn't quite fit, as opposed to creating a new lattice.- Specified by:
isEvolveLattice
in interfaceFrameworkConfig
-
getStatisticProvider
public SqlStatisticProvider getStatisticProvider()
Description copied from interface:FrameworkConfig
Returns the source of statistics about tables and columns to be used by the lattice suggester to deduce primary keys, foreign keys, and the direction of relationships.- Specified by:
getStatisticProvider
in interfaceFrameworkConfig
-
getViewExpander
public RelOptTable.ViewExpander getViewExpander()
Description copied from interface:FrameworkConfig
Returns a view expander.- Specified by:
getViewExpander
in interfaceFrameworkConfig
-
-