Interface StatementSet
- All Superinterfaces:
Compilable,Executable,Explainable<StatementSet>
- All Known Implementing Classes:
StatementSetImpl
StatementSet accepts pipelines defined by DML statements or Table objects. The
planner can optimize all added statements together and then submit them as one job.
The added statements will be cleared when calling the execute() method.
-
Method Summary
Modifier and TypeMethodDescriptionadd(TablePipeline tablePipeline) Adds aTablePipeline.Shorthand forstatementSet.add(table.insertInto(targetPath)).Shorthand forstatementSet.add(table.insertInto(targetPath, overwrite)).addInsert(TableDescriptor targetDescriptor, Table table) Shorthand forstatementSet.add(table.insertInto(targetDescriptor)).addInsert(TableDescriptor targetDescriptor, Table table, boolean overwrite) Shorthand forstatementSet.add(table.insertInto(targetDescriptor, overwrite)).addInsertSql(String statement) Adds anINSERT INTOSQL statement.Compiles this object into aCompiledPlanthat can be executed as one job.execute()Executes this object.Methods inherited from interface org.apache.flink.table.api.Explainable
explain, explain, printExplain
-
Method Details
-
add
Adds aTablePipeline. -
addInsertSql
Adds anINSERT INTOSQL statement. -
addInsert
Shorthand forstatementSet.add(table.insertInto(targetPath)).- See Also:
-
addInsert
Shorthand forstatementSet.add(table.insertInto(targetPath, overwrite)). -
addInsert
Shorthand forstatementSet.add(table.insertInto(targetDescriptor)). -
addInsert
Shorthand forstatementSet.add(table.insertInto(targetDescriptor, overwrite)). -
execute
TableResult execute()Executes this object.By default, all DML operations are executed asynchronously. Use
TableResult.await()orTableResult.getJobClient()to monitor the execution. SetTableConfigOptions.TABLE_DML_SYNCfor always synchronous execution.This method executes all statements as one job.
The added statements will be cleared after calling this method.
- Specified by:
executein interfaceExecutable
-
compilePlan
Compiles this object into aCompiledPlanthat can be executed as one job.Compiled plans can be persisted and reloaded across Flink versions. They describe static pipelines to ensure backwards compatibility and enable stateful streaming job upgrades. See
CompiledPlanand the website documentation for more information.Note: The compiled plan feature is not supported in batch mode.
This method compiles all statements into a
CompiledPlanthat can be executed as one job.- Specified by:
compilePlanin interfaceCompilable- Throws:
org.apache.flink.table.api.TableException- if any of the statements is invalid or if the plan cannot be persisted.
-