---
title: id (StreamingQuery)
description: "StreamingQuery.id property in PySpark: Returns the unique ID of this query that persists across restarts from checkpoint data."
canonical_url: https://docs.databricks.com/aws/en/pyspark/reference/classes/streamingquery/id
---

# id (StreamingQuery)

Returns the unique ID of this query that persists across restarts from checkpoint data. The ID is generated when a query is started for the first time, and is the same every time it is restarted from checkpoint data. There can only be one query with the same ID active in a Spark cluster.

## Returns

`str`

## Examples

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