Why should collect() be used cautiously in Spark?
- A It pulls the entire dataset to the driver, which can exhaust its memory
- B It is slower than count
- C It modifies the data
- D It requires a shuffle
Answer
It pulls the entire dataset to the driver, which can exhaust its memory
Writing results to storage or using take() for inspection avoids concentrating a distributed dataset on a single node.





