Interface Planner
-
@Internal public interface PlannerThis interface serves two purposes:- SQL parser via
getParser()- transforms a SQL string into a Table API specific objects e.g. tree ofOperations - relational planner - provides a way to plan, optimize and transform tree of
ModifyOperationinto a runnable form (Transformation)
The Planner is execution agnostic. It is up to the
TableEnvironmentto ensure that if any of theQueryOperationpull any runtime configuration, all those configurations are equivalent. Example: If some of theQueryOperations scan DataStreams, all those DataStreams must come from the same StreamExecutionEnvironment, because the result oftranslate(List)will strip any execution configuration from the DataStream information.All Tables referenced in either
Parser.parse(String)ortranslate(List)should be previously registered in aCatalogManager, which will be provided during instantiation of thePlanner. - SQL parser via
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InternalPlancompilePlan(List<ModifyOperation> modifyOperations)Stringexplain(List<Operation> operations, ExplainFormat format, 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 ofQueryOperations.StringexplainPlan(InternalPlan plan, ExplainDetail... extraDetails)ParsergetParser()Retrieves aParserthat provides methods for parsing a SQL string.InternalPlanloadPlan(PlanReference planReference)List<org.apache.flink.api.dag.Transformation<?>>translate(List<ModifyOperation> modifyOperations)Converts a relational tree ofModifyOperations into a set of runnableTransformations.List<org.apache.flink.api.dag.Transformation<?>>translatePlan(InternalPlan plan)
-
-
-
Method Detail
-
getParser
Parser getParser()
Retrieves aParserthat provides methods for parsing a SQL string.- Returns:
- initialized
Parser
-
translate
List<org.apache.flink.api.dag.Transformation<?>> translate(List<ModifyOperation> modifyOperations)
Converts a relational tree ofModifyOperations into a set of runnableTransformations.This method accepts a list of
ModifyOperations to allow reusing common subtrees of multiple relational queries. Each query's top node should be aModifyOperationin order to pass the expected properties of the outputTransformationsuch as output mode (append, retract, upsert) or the expected output type.- Parameters:
modifyOperations- list of relational operations to plan, optimize and convert in a single run.- Returns:
- list of corresponding
Transformations.
-
explain
String explain(List<Operation> operations, ExplainFormat format, 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 ofQueryOperations.- Parameters:
operations- The collection of relational queries for which the AST and execution plan will be returned.format- The output format of explained statement. See more details atExplainFormat.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
-
loadPlan
@Experimental InternalPlan loadPlan(PlanReference planReference) throws IOException
- Throws:
IOException
-
compilePlan
@Experimental InternalPlan compilePlan(List<ModifyOperation> modifyOperations)
-
translatePlan
@Experimental List<org.apache.flink.api.dag.Transformation<?>> translatePlan(InternalPlan plan)
-
explainPlan
@Experimental String explainPlan(InternalPlan plan, ExplainDetail... extraDetails)
-
-