pyspark.sql.streaming.DataStreamWriter.queryName

DataStreamWriter.queryName(queryName: str) → pyspark.sql.streaming.readwriter.DataStreamWriter[source]

Specifies the name of the StreamingQuery that can be started with start(). This name must be unique among all the currently active queries in the associated SparkSession.

New in version 2.0.0.

Changed in version 3.5.0: Supports Spark Connect.

Parameters
queryNamestr

unique name for the query

Notes

This API is evolving.

Examples

>>> import time
>>> df = spark.readStream.format("rate").load()
>>> q = df.writeStream.queryName("streaming_query").format("console").start()
>>> q.stop()
>>> q.name
'streaming_query'