public class PlannerImpl extends Object implements Planner, RelOptTable.ViewExpander
Planner.| Modifier and Type | Class and Description |
|---|---|
class |
PlannerImpl.ViewExpanderImpl
Deprecated.
Now
PlannerImpl implements RelOptTable.ViewExpander
directly. |
| Constructor and Description |
|---|
PlannerImpl(FrameworkConfig config)
Creates a planner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases all internal resources utilized while this
Planner
exists. |
RelNode |
convert(SqlNode sql) |
RelRoot |
expandView(RelDataType rowType,
String queryString,
List<String> schemaPath,
@Nullable List<String> viewPath)
Returns a relational expression that is to be substituted for an access
to a SQL view.
|
RelTraitSet |
getEmptyTraitSet() |
JavaTypeFactory |
getTypeFactory()
Returns the type factory.
|
SqlNode |
parse(Reader reader)
Parses and validates a SQL statement.
|
RelRoot |
rel(SqlNode sql)
Converts a SQL parse tree into a tree of relational expressions.
|
void |
reset()
Resets this
Planner to be used with a new query. |
RelNode |
transform(int ruleSetIndex,
RelTraitSet requiredOutputTraits,
RelNode rel)
Converts one relational expression tree into another relational expression
based on a particular rule set and requires set of traits.
|
SqlNode |
validate(SqlNode sqlNode)
Validates a SQL statement.
|
Pair<SqlNode,RelDataType> |
validateAndGetType(SqlNode sqlNode)
Validates a SQL statement.
|
public PlannerImpl(FrameworkConfig config)
Frameworks.getPlanner(org.apache.calcite.tools.FrameworkConfig) instead.public RelTraitSet getEmptyTraitSet()
getEmptyTraitSet in interface Plannerpublic void close()
PlannerPlanner
exists. Once called, this Planner object is no longer valid.close in interface AutoCloseableclose in interface Plannerpublic void reset()
PlannerPlanner to be used with a new query. This
should be called between each new query.public SqlNode parse(Reader reader) throws SqlParseException
Plannerparse in interface Plannerreader - A reader which will provide the SQL statement to parse.SqlParseException - on parse error@EnsuresNonNull(value="validator") public SqlNode validate(SqlNode sqlNode) throws ValidationException
Plannervalidate in interface PlannersqlNode - Root node of the SQL parse tree.ValidationException - if not validpublic Pair<SqlNode,RelDataType> validateAndGetType(SqlNode sqlNode) throws ValidationException
PlannervalidateAndGetType in interface PlannersqlNode - Root node of the SQL parse tree.ValidationException - if not validpublic RelRoot rel(SqlNode sql)
PlannerYou must call Planner.validate(org.apache.calcite.sql.SqlNode) first.
public RelRoot expandView(RelDataType rowType, String queryString, List<String> schemaPath, @Nullable List<String> viewPath)
RelOptTable.ViewExpanderexpandView in interface RelOptTable.ViewExpanderrowType - Row type of the viewqueryString - Body of the viewschemaPath - Path of a schema wherein to find referenced tablesviewPath - Path of the view, ending with its name; may be nullpublic JavaTypeFactory getTypeFactory()
PlannergetTypeFactory in interface Plannerpublic RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, RelNode rel)
Plannertransform in interface PlannerruleSetIndex - The RuleSet to use for conversion purposes. Note that
this is zero-indexed and is based on the list and order
of RuleSets provided in the construction of this
Planner.requiredOutputTraits - The set of RelTraits required of the root node
at the termination of the planning cycle.rel - The root of the RelNode tree to convert.Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.