pyspark.sql.streaming.StreamingQuery.name

property StreamingQuery.name

Returns the user-specified name of the query, or null if not specified. This name can be specified in the org.apache.spark.sql.streaming.DataStreamWriter as dataframe.writeStream.queryName(“query”).start(). This name, if set, must be unique across all active queries.

New in version 2.0.0.

Changed in version 3.5.0: Supports Spark Connect.

Returns
str

The user-specified name of the query, or null if not specified.

Examples

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

Get the user-specified name of the query, or null if not specified.

>>> sq.name
'this_query'
>>> sq.stop()