pyspark.sql.streaming.StreamingQuery.stop

StreamingQuery.stop() → None[source]

Stop this streaming query.

New in version 2.0.0.

Changed in version 3.5.0: Supports Spark Connect.

Examples

>>> sdf = spark.readStream.format("rate").load()
>>> sq = sdf.writeStream.format('memory').queryName('this_query').start()
>>> sq.isActive
True

Stop streaming query

>>> sq.stop()
>>> sq.isActive
False