| [ Web Proxy ] |
| Viewing: https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/../api/pyspark.Broadcast.html | [Back] [Original] |
Site Navigation
Site Navigation
Section Navigation
A broadcast variable created with SparkContext.broadcast().
Access its value through value.
Examples
>>> b = spark.sparkContext.broadcast([1, 2, 3, 4, 5])
>>> b.value
[1, 2, 3, 4, 5]
>>> spark.sparkContext.parallelize([0, 0]).flatMap(lambda x: b.value).collect()
[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
>>> b.unpersist()
>>> large_broadcast = spark.sparkContext.broadcast(range(10000))
Methods
|
Destroy all data and metadata related to this broadcast variable. |
|
Write a pickled representation of value to the open file or socket. |
|
Read a pickled representation of value from the open file or socket. |
|
Read the pickled representation of an object from the open file and return the reconstituted object hierarchy specified therein. |
|
Delete cached copies of this broadcast on the executors. |
Attributes
Return the broadcasted value |
Copyright @ 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.
Created using Sphinx 4.5.0.
Built with the PyData Sphinx Theme 0.13.3.
| Web Proxy Viewer | New URL | Original Page |