@PublicEvolving public interface StatementSet extends Explainable<StatementSet>, Compilable, Executable
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.
| Modifier and Type | Method and Description |
|---|---|
StatementSet |
add(TablePipeline tablePipeline)
Adds a
TablePipeline. |
StatementSet |
addInsert(String targetPath,
Table table)
Shorthand for
statementSet.add(table.insertInto(targetPath)). |
StatementSet |
addInsert(String targetPath,
Table table,
boolean overwrite)
Shorthand for
statementSet.add(table.insertInto(targetPath, overwrite)). |
StatementSet |
addInsert(TableDescriptor targetDescriptor,
Table table)
Shorthand for
statementSet.add(table.insertInto(targetDescriptor)). |
StatementSet |
addInsert(TableDescriptor targetDescriptor,
Table table,
boolean overwrite)
Shorthand for
statementSet.add(table.insertInto(targetDescriptor, overwrite)). |
StatementSet |
addInsertSql(String statement)
Adds an
INSERT INTO SQL statement. |
CompiledPlan |
compilePlan()
Compiles this object into a
CompiledPlan that can be executed as one job. |
TableResult |
execute()
Executes this object.
|
explain, printExplainStatementSet add(TablePipeline tablePipeline)
TablePipeline.StatementSet addInsertSql(String statement)
INSERT INTO SQL statement.StatementSet addInsert(String targetPath, Table table)
statementSet.add(table.insertInto(targetPath)).add(TablePipeline),
Table.insertInto(String)StatementSet addInsert(String targetPath, Table table, boolean overwrite)
statementSet.add(table.insertInto(targetPath, overwrite)).StatementSet addInsert(TableDescriptor targetDescriptor, Table table)
statementSet.add(table.insertInto(targetDescriptor)).StatementSet addInsert(TableDescriptor targetDescriptor, Table table, boolean overwrite)
statementSet.add(table.insertInto(targetDescriptor, overwrite)).TableResult execute()
By default, all DML operations are executed asynchronously. Use TableResult.await() or TableResult.getJobClient() to monitor the execution. Set
TableConfigOptions.TABLE_DML_SYNC for always synchronous execution.
This method executes all statements as one job.
The added statements will be cleared after calling this method.
execute in interface Executable@Experimental CompiledPlan compilePlan() throws org.apache.flink.table.api.TableException
CompiledPlan that 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
CompiledPlan and the website documentation for more information.
Note: The compiled plan feature is not supported in batch mode.
This method compiles all statements into a CompiledPlan that can be executed as
one job.
compilePlan in interface CompilableTableException - if any of the statements is invalid or if the plan cannot be
persisted.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.