StreamingQueryManager
Manages all active StreamingQuery instances associated with a SparkSession. Use spark.streams to access this.
Syntax
Python
# Access through SparkSession
spark.streams
Properties
Property | Description |
|---|---|
Returns a list of all active streaming queries associated with this |
Methods
Method | Description |
|---|---|
Returns an active query by its unique ID. | |
Waits until any active query terminates, or until the timeout expires. | |
Forgets past terminated queries so that | |
Registers a | |
Deregisters a |
Examples
Python
sdf = spark.readStream.format("rate").load()
sq = sdf.writeStream.format('memory').queryName('this_query').start()
sqm = spark.streams
[q.name for q in sqm.active]
# ['this_query']
sqm.awaitAnyTermination(5)
# True
sq.stop()
sqm.resetTerminated()