DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-0 practice question 20 of 25

Which of the following statements about broadcast variables is correct?

Full set: 180 questions
Answer options
A: Broadcast variables are serialized with every single task.
B: Broadcast variables are commonly used for tables that do not fit into memory.
C: Broadcast variables are immutable. Correct answer
D: Broadcast variables are occasionally dynamically updated on a per-task basis.
E: Broadcast variables are local to the worker node and not shared across the cluster.
Correct Answer:
C. Broadcast variables are immutable.
Explanation

Broadcast variables are local to the worker node and not shared across the cluster. This is wrong because broadcast variables are meant to be shared across the cluster. As such, they are never just local to the worker node, but available to all worker nodes. Broadcast variables are commonly used for tables that do not fit into memory. This is wrong because broadcast variables can only be broadcast because they are small and do fit into memory. Broadcast variables are serialized with every single task. This is wrong because they are cached on every machine in the cluster, precisely avoiding to have to be serialized with every single task. Broadcast variables are occasionally dynamically updated on a per-task basis. This is wrong because broadcast variables are immutable – they are never updated. More info: Spark – The Definitive Guide, Chapter 14

Scroll to Top