I think Broadcast variables deserve some explanation in order to better understand how this mechanism works:
The Broadcast variable allows you to store a read - only variable cached on each machine, rather than delivering a copy of it with tasks. It can be used, for example, to give each node a copy of a large input dataset in an efficient manner.
You can check additional information at Spark Broadcast Variables
After creating the broadcast variable in Spark, you will get a wrapper around v (access via calling broadcastVar.value() ), so when using singleton mode, a single point reference will be used for the wrapper, and not the actual value, etc., a singleton template can have much less impact anyway.
You can also use the same cover link throughout the life of your spark.
Since this is a reference to a read-only variable, these parameters will exhibit similar behavior.
source share