QuestionQ128

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks calls the assessPerformance() function for each row in the storesDF DataFrame?

Explanation

Spark collect() returns all DataFrame rows as an array on the driver. Scala’s foreach applies its supplied function to every array element, and row => assessPerformance(row) invokes assessPerformance once for each row.

Learn more

Community Discussion

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