pyspark.Broadcast.destroy

Broadcast.destroy(blocking: bool = False) → None[source]

Destroy all data and metadata related to this broadcast variable. Use this with caution; once a broadcast variable has been destroyed, it cannot be used again.

Changed in version 3.0.0: Added optional argument blocking to specify whether to block until all blocks are deleted.

Parameters
blockingbool, optional, default False

Whether to block until unpersisting has completed.

Examples

>>> b = spark.sparkContext.broadcast([1, 2, 3, 4, 5])

Destroy all data and metadata related to this broadcast variable

>>> b.destroy()