pyspark.sql.streaming.StreamingQuery.runId

property StreamingQuery.runId

Returns the unique id of this query that does not persist across restarts. That is, every query that is started (or restarted from checkpoint) will have a different runId.

New in version 2.1.0.

Returns
str

The unique id of query that does not persist across restarts.

Examples

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

Get the unique id of this query that does not persist across restarts

>>> sq.runId 
'...'
>>> sq.stop()