QuestionQ158

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

The code block below must return a new 4-partition DataFrame from the 8-partition DataFrame storesDF without causing a shuffle. Choose the response that correctly fills the numbered blanks in the code block to accomplish this.

_1_._2_(_3_)  
Explanation

In Spark, coalesce(4) reduces an 8-partition DataFrame to four partitions without performing a shuffle. The argument specifies the desired number of partitions.

Community Discussion

No comments yet. Be the first to start the discussion!