Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Apache Spark Interview Questions and Answers

Question: What is the Broadcast variable in Spark and when is it used?
Answer: A Broadcast variable is a read-only variable cached on each worker node. It is used to efficiently distribute large read-only data structures, such as lookup tables, to all tasks in a Spark job.

Example:

val broadcastVar = sc.broadcast(Array(1, 2, 3))
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook