public interface Planner
Planner is NOT thread safe. However, it can be reused for different queries. The consumer of this interface is responsible for calling reset() after each use of Planner that corresponds to a different query.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases all internal resources utilized while this
Planner
exists. |
RelNode |
convert(SqlNode sql)
Converts a SQL parse tree into a tree of relational expressions.
|
RelTraitSet |
getEmptyTraitSet() |
RelDataTypeFactory |
getTypeFactory()
Returns the type factory.
|
SqlNode |
parse(String sql)
Parses and validates a SQL statement.
|
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.
|
SqlNode parse(String sql) throws SqlParseException
sql - The SQL statement to parse.SqlParseException - on parse errorSqlNode validate(SqlNode sqlNode) throws ValidationException
sqlNode - Root node of the SQL parse tree.ValidationException - if not validRelNode convert(SqlNode sql) throws RelConversionException
You must call validate(org.apache.calcite.sql.SqlNode) first.
sql - The root node of the SQL parse tree.RelConversionException - if the node
cannot be converted or has not been validatedRelDataTypeFactory getTypeFactory()
RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, RelNode rel) throws RelConversionException
ruleSetIndex - 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.RelConversionException - on conversion
errorvoid reset()
Planner to be used with a new query. This
should be called between each new query.void close()
Planner
exists. Once called, this Planner object is no longer valid.RelTraitSet getEmptyTraitSet()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.