StreamingQuery Class

Definition

A handle to a query that is executing continuously in the background as new data arrives.

public sealed class StreamingQuery
type StreamingQuery = class
Public NotInheritable Class StreamingQuery
Inheritance
StreamingQuery

Properties

Id

Returns the unique id of this query that persists across restarts from checkpoint data. That is, this id is generated when a query is started for the first time, and will be the same every time it is restarted from checkpoint data. Also see RunId.

Name

Returns the user-specified name of the query, or null if not specified.

RunId

Returns the unique id of this run of the query. That is, every start/restart of a query will generated a unique runId. Therefore, every time a query is restarted from checkpoint, it will have the same Id but different RunIds.

Methods

AwaitTermination()

Waits for the termination of this query, either by Stop() or by an exception.

AwaitTermination(Int64)

Returns true if this query is terminated within the timeout in milliseconds.

Exception()

The StreamingQueryException if the query was terminated by an exception, null otherwise.

Explain(Boolean)

Prints the physical plan to the console for debugging purposes.

IsActive()

Returns true if this query is actively running.

ProcessAllAvailable()

Blocks until all available data in the source has been processed and committed to the sink. This method is intended for testing. Note that in the case of continually arriving data, this method may block forever. Additionally, this method is only guaranteed to block until data that has been synchronously appended data to a org.apache.spark.sql.execution.streaming.Source prior to invocation. (i.e. getOffset must immediately reflect the addition).

Stop()

Stops the execution of this query if it is running. This method blocks until the threads performing execution stop.

Applies to