DatabricksDatabricks
DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #128
DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Question #128: Real Exam Question with Answer & Explanation
The correct answer is E: storesDF.collect.foreach(row => assessPerformance(row)). See the full explanation below for the reasoning.
Working with Apache Spark DataFrames
Question
Which of the following code blocks applies the function assessPerformance() to each row of DataFrame storesDF?
Options
- AstoresDF.collect.foreach(assessPerformance(row))
- BstoresDF.collect().apply(assessPerformance)
- CstoresDF.collect.apply(row => assessPerformance(row))
- DstoresDF.collect.map(assessPerformance(row))
- EstoresDF.collect.foreach(row => assessPerformance(row))
Topics
#Spark DataFrame Actions#Scala Collection Methods#Lambda Expressions#Driver Program Operations
Community Discussion
No community discussion yet for this question.