@Internal public class StreamStatementSetImpl extends StatementSetImpl<StreamTableEnvironmentImpl> implements StreamStatementSet
StreamStatementSet
.operations, tableEnvironment
Modifier | Constructor and Description |
---|---|
protected |
StreamStatementSetImpl(StreamTableEnvironmentImpl tableEnvironment) |
Modifier and Type | Method and Description |
---|---|
StreamStatementSet |
addInsert(String targetPath,
Table table)
Adds a statement that the pipeline defined by the given
Table object should be
written to a table (backed by a DynamicTableSink ) that was registered under the
specified path. |
StreamStatementSet |
addInsert(String targetPath,
Table table,
boolean overwrite)
Adds a statement that the pipeline defined by the given
Table object should be
written to a table (backed by a DynamicTableSink ) that was registered under the
specified path. |
StreamStatementSet |
addInsert(TableDescriptor targetDescriptor,
Table table)
Adds a statement that the pipeline defined by the given
Table object should be
written to a table (backed by a DynamicTableSink ) expressed via the given TableDescriptor . |
StreamStatementSet |
addInsert(TableDescriptor targetDescriptor,
Table table,
boolean overwrite)
Adds a statement that the pipeline defined by the given
Table object should be
written to a table (backed by a DynamicTableSink ) expressed via the given TableDescriptor . |
StreamStatementSet |
addInsertSql(String statement)
Adds an
INSERT INTO SQL statement. |
void |
attachAsDataStream()
Optimizes all statements as one entity and adds them as transformations to the underlying
StreamExecutionEnvironment . |
execute, explain, getJsonPlan
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, explain
protected StreamStatementSetImpl(StreamTableEnvironmentImpl tableEnvironment)
public StreamStatementSet addInsertSql(String statement)
StatementSet
INSERT INTO
SQL statement.addInsertSql
in interface StreamStatementSet
addInsertSql
in interface StatementSet
addInsertSql
in class StatementSetImpl<StreamTableEnvironmentImpl>
public StreamStatementSet addInsert(String targetPath, Table table)
StatementSet
Table
object should be
written to a table (backed by a DynamicTableSink
) that was registered under the
specified path.
See the documentation of TableEnvironment.useDatabase(String)
or TableEnvironment.useCatalog(String)
for the rules on the path resolution.
addInsert
in interface StreamStatementSet
addInsert
in interface StatementSet
addInsert
in class StatementSetImpl<StreamTableEnvironmentImpl>
public StreamStatementSet addInsert(String targetPath, Table table, boolean overwrite)
StatementSet
Table
object should be
written to a table (backed by a DynamicTableSink
) that was registered under the
specified path.
See the documentation of TableEnvironment.useDatabase(String)
or TableEnvironment.useCatalog(String)
for the rules on the path resolution.
addInsert
in interface StreamStatementSet
addInsert
in interface StatementSet
addInsert
in class StatementSetImpl<StreamTableEnvironmentImpl>
overwrite
- Indicates whether existing data should be overwritten.public StreamStatementSet addInsert(TableDescriptor targetDescriptor, Table table)
StatementSet
Table
object should be
written to a table (backed by a DynamicTableSink
) expressed via the given TableDescriptor
.
The given descriptor
is registered as an inline (i.e. anonymous)
temporary catalog table (see TableEnvironment.createTemporaryTable(String,
TableDescriptor)
. Then a statement is added to the statement set that inserts the Table
object's pipeline into that temporary table.
This method allows to declare a Schema
for the sink descriptor. The declaration is
similar to a CREATE TABLE
DDL in SQL and allows to:
DataType
It is possible to declare a schema without physical/regular columns. In this case, those columns will be automatically derived and implicitly put at the beginning of the schema declaration.
Examples:
StatementSet stmtSet = tEnv.createStatementSet();
Table sourceTable = tEnv.from("SourceTable");
TableDescriptor sinkDescriptor = TableDescriptor.forConnector("blackhole")
.schema(Schema.newBuilder()
// …
.build())
.build();
stmtSet.addInsert(sinkDescriptor, sourceTable);
addInsert
in interface StreamStatementSet
addInsert
in interface StatementSet
addInsert
in class StatementSetImpl<StreamTableEnvironmentImpl>
public StreamStatementSet addInsert(TableDescriptor targetDescriptor, Table table, boolean overwrite)
StatementSet
Table
object should be
written to a table (backed by a DynamicTableSink
) expressed via the given TableDescriptor
.
The given descriptor
is registered as an inline (i.e. anonymous)
temporary catalog table (see TableEnvironment.createTemporaryTable(String,
TableDescriptor)
. Then a statement is added to the statement set that inserts the Table
object's pipeline into that temporary table.
This method allows to declare a Schema
for the sink descriptor. The declaration is
similar to a CREATE TABLE
DDL in SQL and allows to:
DataType
It is possible to declare a schema without physical/regular columns. In this case, those columns will be automatically derived and implicitly put at the beginning of the schema declaration.
Examples:
StatementSet stmtSet = tEnv.createStatementSet();
Table sourceTable = tEnv.from("SourceTable");
TableDescriptor sinkDescriptor = TableDescriptor.forConnector("blackhole")
.schema(Schema.newBuilder()
// …
.build())
.build();
stmtSet.addInsert(sinkDescriptor, sourceTable, true);
addInsert
in interface StreamStatementSet
addInsert
in interface StatementSet
addInsert
in class StatementSetImpl<StreamTableEnvironmentImpl>
overwrite
- Indicates whether existing data should be overwritten.public void attachAsDataStream()
StreamStatementSet
StreamExecutionEnvironment
.
Use StreamExecutionEnvironment.execute()
to execute them.
The added statements will be cleared after calling this method.
attachAsDataStream
in interface StreamStatementSet
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.