DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #122
Which of the following will occur if there are more slots than there are tasks?
The correct answer is A. The Spark job will likely not run as efficiently as possible. When more slots exist than tasks, some slots remain idle, meaning computational resources are wasted and the job runs less efficiently than it could.
Question
Which of the following will occur if there are more slots than there are tasks?
Options
- AThe Spark job will likely not run as efficiently as possible.
- BThe Spark application will fail - there must be at least as many tasks as there are slots.
- CSome executors will shut down and allocate all slots on larger executors first.
- DMore tasks will be automatically generated to ensure all slots are being used.
- EThe Spark job will use just one single slot to perform all tasks.
How the community answered
(24 responses)- A92% (22)
- B4% (1)
- C4% (1)
Why each option
When more slots exist than tasks, some slots remain idle, meaning computational resources are wasted and the job runs less efficiently than it could.
Slots represent the concurrent execution capacity of executors. If the number of available slots exceeds the number of tasks in a stage, some slots sit idle throughout that stage's execution. This means the cluster is underutilized and the job does not achieve maximum parallelism or efficiency.
Spark does not require tasks to match or exceed slot count - having fewer tasks than slots is valid and simply results in idle slots.
Spark does not dynamically shut down executors or rebalance slots in response to a task-to-slot imbalance during a job.
Spark does not auto-generate additional tasks to fill idle slots - the number of tasks is determined by the number of partitions.
Spark does not collapse execution to a single slot when slots exceed tasks - it still uses as many slots as there are tasks.
Concept tested: Spark slots, tasks, and resource utilization
Source: https://spark.apache.org/docs/latest/cluster-overview.html
Topics
Community Discussion
No community discussion yet for this question.