StatementSet#

StatementSet#

A 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.

StatementSet.add_insert_sql(stmt)

add insert statement to the set.

StatementSet.add_insert(...[, 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 or expressed via the given TableDescriptor.

StatementSet.explain(*extra_details)

returns the AST and the execution plan of all statements and Tables.

StatementSet.execute()

execute all statements and Tables as a batch.

TableResult#

A TableResult is the representation of the statement execution result.

TableResult.get_job_client()

For DML and DQL statement, return the JobClient which associates the submitted Flink job.

TableResult.wait([timeout_ms])

Wait if necessary for at most the given time (milliseconds) for the data to be ready.

TableResult.get_table_schema()

Get the schema of result.

TableResult.get_result_kind()

Return the ResultKind which represents the result type.

TableResult.collect()

Get the result contents as a closeable row iterator.

TableResult.print()

Print the result contents as tableau form to client console.

ResultKind#

ResultKind defines the types of the result.

SUCCESS:

The statement (e.g. DDL, USE) executes successfully, and the result only contains a simple “OK”.

SUCCESS_WITH_CONTENT:

The statement (e.g. DML, DQL, SHOW) executes successfully, and the result contains important content.

ResultKind.SUCCESS

ResultKind.SUCCESS_WITH_CONTENT