StreamingQueryManager.
addListener
Register a StreamingQueryListener to receive up-calls for life cycle events of StreamingQuery.
StreamingQueryListener
StreamingQuery
New in version 3.4.0.
A StreamingQueryListener to receive up-calls for life cycle events of StreamingQuery.
Examples
>>> from pyspark.sql.streaming import StreamingQueryListener >>> class TestListener(StreamingQueryListener): ... def onQueryStarted(self, event): ... pass ... ... def onQueryProgress(self, event): ... pass ... ... def onQueryTerminated(self, event): ... pass >>> test_listener = TestListener()
Register streaming query listener
>>> spark.streams.addListener(test_listener)
Deregister streaming query listener
>>> spark.streams.removeListener(test_listener)