@Internal
public interface Planner
getParser() - transforms a SQL string into a Table API specific
objects e.g. tree of Operations
ModifyOperation 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
QueryOperations 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,
ExplainDetail... extraDetails)
Returns the AST of the specified Table API and SQL queries and the execution plan to compute
the result of the given collection of
QueryOperations. |
String |
explainJsonPlan(String jsonPlan,
ExplainDetail... extraDetails)
Returns the execution plan for the given json plan.
|
String |
getJsonPlan(List<ModifyOperation> modifyOperations)
Get the json plan of the given
ModifyOperations. |
Parser |
getParser()
Retrieves a
Parser that provides methods for parsing a SQL string. |
List<org.apache.flink.api.dag.Transformation<?>> |
translate(List<ModifyOperation> modifyOperations)
Converts a relational tree of
ModifyOperations into a set of runnable Transformations. |
List<org.apache.flink.api.dag.Transformation<?>> |
translateJsonPlan(String jsonPlan)
Converts a json plan into a set of runnable
Transformations. |
Parser getParser()
Parser that provides methods for parsing a SQL string.ParserList<org.apache.flink.api.dag.Transformation<?>> translate(List<ModifyOperation> modifyOperations)
ModifyOperations into a set of runnable Transformations.
This method accepts a list of ModifyOperations 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.Transformations.String explain(List<Operation> operations, ExplainDetail... extraDetails)
QueryOperations.operations - The collection of relational queries for which the AST and execution plan
will be returned.extraDetails - The extra explain details which the explain result should include, e.g.
estimated cost, changelog mode for streaming, displaying execution plan in json format@Experimental String getJsonPlan(List<ModifyOperation> modifyOperations)
ModifyOperations.
The json plan is the string json representation of an optimized ExecNode plan for the given statement. An ExecNode plan can be serialized to json plan, and a json plan can be deserialized to an ExecNode plan.
NOTES: Only the Blink planner supports this method.
NOTES:: This is an experimental feature now.
modifyOperations - the ModifyOperations to generate json plan.@Experimental String explainJsonPlan(String jsonPlan, ExplainDetail... extraDetails)
NOTES: Only the Blink planner supports this method.
NOTES:: This is an experimental feature now.
jsonPlan - The json plan to be explained.extraDetails - The extra explain details which the explain result should include, e.g.
estimated cost, changelog mode for streaming@Experimental List<org.apache.flink.api.dag.Transformation<?>> translateJsonPlan(String jsonPlan)
Transformations.
The json plan is the string json representation of an optimized ExecNode plan for the given statement. An ExecNode plan can be serialized to json plan, and a json plan can be deserialized to an ExecNode plan.
NOTES: Only the Blink planner supports this method.
NOTES:: This is an experimental feature now.
jsonPlan - The json plan to be translated.Transformations.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.