Class StatementSetImpl<E extends TableEnvironmentInternal>
- java.lang.Object
-
- org.apache.flink.table.api.internal.StatementSetImpl<E>
-
- All Implemented Interfaces:
Compilable
,Executable
,Explainable<StatementSet>
,StatementSet
- Direct Known Subclasses:
StreamStatementSetImpl
@Internal public class StatementSetImpl<E extends TableEnvironmentInternal> extends Object implements StatementSet
Implementation forStatementSet
.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ModifyOperation>
operations
protected E
tableEnvironment
-
Constructor Summary
Constructors Modifier Constructor Description protected
StatementSetImpl(E tableEnvironment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatementSet
add(TablePipeline tablePipeline)
Adds aTablePipeline
.StatementSet
addInsert(String targetPath, Table table)
Shorthand forstatementSet.add(table.insertInto(targetPath))
.StatementSet
addInsert(String targetPath, Table table, boolean overwrite)
Shorthand forstatementSet.add(table.insertInto(targetPath, overwrite))
.StatementSet
addInsert(TableDescriptor targetDescriptor, Table table)
Shorthand forstatementSet.add(table.insertInto(targetDescriptor))
.StatementSet
addInsert(TableDescriptor targetDescriptor, Table table, boolean overwrite)
Shorthand forstatementSet.add(table.insertInto(targetDescriptor, overwrite))
.StatementSet
addInsertSql(String statement)
Adds anINSERT INTO
SQL statement.CompiledPlan
compilePlan()
Compiles this object into aCompiledPlan
that can be executed as one job.TableResult
execute()
Executes this object.String
explain(ExplainFormat format, ExplainDetail... extraDetails)
Returns the AST of this object and the execution plan to compute the result of the given statement.List<ModifyOperation>
getOperations()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.api.Explainable
explain, printExplain
-
-
-
-
Field Detail
-
tableEnvironment
protected final E extends TableEnvironmentInternal tableEnvironment
-
operations
protected final List<ModifyOperation> operations
-
-
Constructor Detail
-
StatementSetImpl
protected StatementSetImpl(E tableEnvironment)
-
-
Method Detail
-
getOperations
@VisibleForTesting public List<ModifyOperation> getOperations()
-
add
public StatementSet add(TablePipeline tablePipeline)
Description copied from interface:StatementSet
Adds aTablePipeline
.- Specified by:
add
in interfaceStatementSet
-
addInsertSql
public StatementSet addInsertSql(String statement)
Description copied from interface:StatementSet
Adds anINSERT INTO
SQL statement.- Specified by:
addInsertSql
in interfaceStatementSet
-
addInsert
public StatementSet addInsert(String targetPath, Table table)
Description copied from interface:StatementSet
Shorthand forstatementSet.add(table.insertInto(targetPath))
.- Specified by:
addInsert
in interfaceStatementSet
- See Also:
StatementSet.add(TablePipeline)
,Table.insertInto(String)
-
addInsert
public StatementSet addInsert(String targetPath, Table table, boolean overwrite)
Description copied from interface:StatementSet
Shorthand forstatementSet.add(table.insertInto(targetPath, overwrite))
.- Specified by:
addInsert
in interfaceStatementSet
- See Also:
StatementSet.add(TablePipeline)
,Table.insertInto(String, boolean)
-
addInsert
public StatementSet addInsert(TableDescriptor targetDescriptor, Table table)
Description copied from interface:StatementSet
Shorthand forstatementSet.add(table.insertInto(targetDescriptor))
.- Specified by:
addInsert
in interfaceStatementSet
- See Also:
StatementSet.add(TablePipeline)
,Table.insertInto(TableDescriptor)
-
addInsert
public StatementSet addInsert(TableDescriptor targetDescriptor, Table table, boolean overwrite)
Description copied from interface:StatementSet
Shorthand forstatementSet.add(table.insertInto(targetDescriptor, overwrite))
.- Specified by:
addInsert
in interfaceStatementSet
- See Also:
StatementSet.add(TablePipeline)
,Table.insertInto(TableDescriptor, boolean)
-
explain
public String explain(ExplainFormat format, ExplainDetail... extraDetails)
Description copied from interface:Explainable
Returns the AST of this object and the execution plan to compute the result of the given statement.- Specified by:
explain
in interfaceExplainable<E extends TableEnvironmentInternal>
- Parameters:
format
- The output format of explained planextraDetails
- The extra explain details which the result of this method should include, e.g. estimated cost, changelog mode for streaming- Returns:
- AST and the execution plan.
-
execute
public TableResult execute()
Description copied from interface:StatementSet
Executes this object.By default, all DML operations are executed asynchronously. Use
TableResult.await()
orTableResult.getJobClient()
to monitor the execution. SetTableConfigOptions.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.
- Specified by:
execute
in interfaceExecutable
- Specified by:
execute
in interfaceStatementSet
-
compilePlan
@Experimental public CompiledPlan compilePlan()
Description copied from interface:StatementSet
Compiles this object into aCompiledPlan
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.- Specified by:
compilePlan
in interfaceCompilable
- Specified by:
compilePlan
in interfaceStatementSet
-
-