StreamingQuery

org.apache.spark.sql.streaming.StreamingQuery

A handle to a query that is executing continuously in the background as new data arrives. Returned by DataStreamWriter#start and StreamingQueryManager.

Mirrors the public surface of org.apache.spark.sql.streaming.StreamingQuery over the Spark Connect protocol. Every method issues a StreamingQueryCommand to the server, identified by the query's id and runId, and reads the typed result back from the response stream.

Value parameters

id

the stable query id that persists across restarts from a checkpoint.

name

the user-specified query name, or null if none was set.

runId

the run id that is unique for each start or restart of the query.

spark

the session that owns this query.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def awaitTermination(): Boolean

Waits for the termination of this query, blocking the current thread until the query stops or fails.

Waits for the termination of this query, blocking the current thread until the query stops or fails.

Attributes

Returns

whether the query has terminated.

def awaitTermination(timeoutMs: Long): Boolean

Waits for the termination of this query, blocking the current thread until the query stops or fails, or until timeoutMs milliseconds have elapsed.

Waits for the termination of this query, blocking the current thread until the query stops or fails, or until timeoutMs milliseconds have elapsed.

Attributes

Returns

whether the query has terminated within the timeout.

Returns the StreamingQueryException that terminated this query, if the query failed, or None if the query is active or stopped normally.

Returns the StreamingQueryException that terminated this query, if the query failed, or None if the query is active or stopped normally.

Attributes

def explain(): Unit

Prints the (logical and physical) plans of this query to the console for debugging.

Prints the (logical and physical) plans of this query to the console for debugging.

Attributes

def explain(extended: Boolean): Unit

Prints the (logical and physical) plans of this query to the console for debugging.

Prints the (logical and physical) plans of this query to the console for debugging.

Value parameters

extended

whether to print the extended (more verbose) plan information.

Attributes

def isActive: Boolean

Returns whether the query is currently active (still running).

Returns whether the query is currently active (still running).

Attributes

def lastProgress: String

Returns the most recent progress update of this query as a JSON string, or null if no progress has been made yet.

Returns the most recent progress update of this query as a JSON string, or null if no progress has been made yet.

Attributes

def processAllAvailable(): Unit

Blocks until all available data in the source has been processed and committed to the sink. Intended for testing with bounded sources.

Blocks until all available data in the source has been processed and committed to the sink. Intended for testing with bounded sources.

Attributes

def recentProgress: Array[String]

Returns an array of the most recent progress updates for this query, as JSON strings, ordered from oldest to newest.

Returns an array of the most recent progress updates for this query, as JSON strings, ordered from oldest to newest.

Attributes

Returns the current status of the query as a StreamingQueryStatus describing whether data is available, a trigger is active, and the query is running.

Returns the current status of the query as a StreamingQueryStatus describing whether data is available, a trigger is active, and the query is running.

Attributes

def stop(): Unit

Stops the execution of this query if it is running.

Stops the execution of this query if it is running.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Concrete fields

val id: String
val name: String
val runId: String