@Internal public interface Planner
getParser()
- transforms a SQL string into a Table API specific objects
e.g. tree of Operation
sModifyOperation
into a runnable form (Transformation
)The Planner is execution agnostic. It is up to the
TableEnvironment
to ensure that if any of the
QueryOperation
pull any runtime configuration, all those configurations are
equivalent. Example: If some of the QueryOperation
s scan DataStreams, all
those DataStreams must come from the same StreamExecutionEnvironment, because the result
of translate(List)
will strip any execution configuration from
the DataStream information.
All Tables referenced in either Parser.parse(String)
or
translate(List)
should be previously registered in a
CatalogManager
, which will be provided during
instantiation of the Planner
.
Modifier and Type | Method and Description |
---|---|
String |
explain(List<Operation> operations,
boolean extended)
Returns the AST of the specified Table API and SQL queries and the execution plan
to compute the result of the given collection of
QueryOperation s. |
String[] |
getCompletionHints(String statement,
int position)
Returns completion hints for the given statement at the given cursor position.
|
Parser |
getParser()
Retrieves a
Parser that provides methods for parsing a SQL string. |
List<Transformation<?>> |
translate(List<ModifyOperation> modifyOperations)
Converts a relational tree of
ModifyOperation s into a set of runnable
Transformation s. |
Parser getParser()
Parser
that provides methods for parsing a SQL string.Parser
List<Transformation<?>> translate(List<ModifyOperation> modifyOperations)
ModifyOperation
s into a set of runnable
Transformation
s.
This method accepts a list of ModifyOperation
s to allow reusing common
subtrees of multiple relational queries. Each query's top node should be a ModifyOperation
in order to pass the expected properties of the output Transformation
such as
output mode (append, retract, upsert) or the expected output type.
modifyOperations
- list of relational operations to plan, optimize and convert in a
single run.Transformation
s.String explain(List<Operation> operations, boolean extended)
QueryOperation
s.operations
- The collection of relational queries for which the AST
and execution plan will be returned.extended
- if the plan should contain additional properties such as
e.g. estimated cost, traitsString[] getCompletionHints(String statement, int position)
statement
- Partial or slightly incorrect SQL statementposition
- cursor positionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.