---
title: runId (StreamingQuery)
description: "StreamingQuery.runId property in PySpark: Returns the unique ID of this query that does not persist across restarts. Every query that is started (or restarted from checkpoint) will have a different runId."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/streamingquery/runId
---

# runId (StreamingQuery)

Returns the unique ID of this query that does not persist across restarts. Every query that is started (or restarted from checkpoint) will have a different `runId`.

## Returns

`str`

## Examples

```python
sdf = spark.readStream.format("rate").load()
sq = sdf.writeStream.format('memory').queryName('this_query').start()
sq.runId
# '...'
sq.stop()
```
