
Answer-first summary for fast verification
Answer: The MEMORY_ONLY storage level will store as much data as possible in memory and will recompute any data that does not fit in memory as it's called. The MEMORY_AND_DISK storage level will store as much data as possible in memory and will store any data that does on fit in memory on disk and read it as it's called.
The MEMORY_ONLY storage level caches data in memory. If there's insufficient memory, it recomputes the remaining partitions on demand. MEMORY_AND_DISK also caches in memory first, but spills excess partitions to disk instead of recomputing. Options A and E incorrectly describe disk usage for MEMORY_ONLY or MEMORY_AND_DISK. Options B and C wrongly mention replication across two nodes, which is not part of the default storage levels. Option D correctly contrasts the two levels: MEMORY_ONLY recomputes when memory is full, while MEMORY_AND_DISK spills to disk.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
What are the key similarities and differences between the MEMORY_ONLY and MEMORY_AND_DISK storage levels in Spark?
A
The MEMORY_ONLY storage level will store as much data as possible in memory and will store any data that does on fit in memory on disk and read it as it's called. The MEMORY_AND_DISK storage level will store as much data as possible in memory and will recompute any data that does not fit in memory as it’s called.
B
The MEMORY_ONLY storage level will store as much data as possible in memory on two cluster nodes and will recompute any data that does not fit in memory as it’s called. The MEMORY_AND_DISK storage level will store as much data as possible in memory on two cluster nodes and will store any data that does on fit in memory on disk and read it as it's called.
C
The MEMORY_ONLY storage level will store as much data as possible in memory on two cluster nodes and will store any data that does on fit in memory on disk and read it as it's called. The MEMORY_AND_DISK storage level will store as much data as possible in memory on two cluster nodes and will recompute any data that does not fit in memory as it's called.
D
The MEMORY_ONLY storage level will store as much data as possible in memory and will recompute any data that does not fit in memory as it's called. The MEMORY_AND_DISK storage level will store as much data as possible in memory and will store any data that does on fit in memory on disk and read it as it's called.
E
The MEMORY_ONLY storage level will store as much data as possible in memory and will recompute any data that does not fit in memory as it’s called. The MEMORY_AND_DISK storage level will store half of the data in memory and store half of the memory on disk. This provides quick preview and better logical plan design.