pyspark.sql.streaming.StreamingQueryManager.get

StreamingQueryManager.get(id: str)pyspark.sql.streaming.StreamingQuery[source]

Returns an active query from this SQLContext or throws exception if an active query with this name doesn’t exist.

New in version 2.0.0.

Examples

>>> sq = sdf.writeStream.format('memory').queryName('this_query').start()
>>> sq.name
'this_query'
>>> sq = spark.streams.get(sq.id)
>>> sq.isActive
True
>>> sq = sqlContext.streams.get(sq.id)
>>> sq.isActive
True
>>> sq.stop()