Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to broadcast a read-only variable in PySpark?
A)
broadcast()
B)
rdd.broadcast()
C)
spark.broadcast()
D)
sc.broadcast()

Correct Answer :   sc.broadcast()


Explanation : sc.broadcast() is used to broadcast a read-only variable in PySpark. It broadcasts the variable to all nodes in a Spark cluster so that it can be accessed efficiently by tasks. Other broadcasting operations in PySpark include accumulators and counters.

Advertisement