LeetQuiz Logo
Privacy Policy•contact@leetquiz.com
© 2025 LeetQuiz All rights reserved.
Databricks Certified Associate Developer for Apache Spark

Databricks Certified Associate Developer for Apache Spark

Get started today

Ultimate access to all questions.


Comments

Loading comments...

The code block shown below contains an error. The code block is intended to create the Scala UDF assessPerformanceUDF() and apply it to the integer column customerSatisfaction in DataFrame storesDF. Identify the error.

Code block:

val assessPerformanceUDF = udf( (score: Int) => {
    if (score > 8) "High"
    else if (score > 5) "Medium"
    else "Low"
})

storesDF.withColumn("performance", assessPerformanceUDF(customers1t1sfaction))
val assessPerformanceUDF = udf( (score: Int) => {
    if (score > 8) "High"
    else if (score > 5) "Medium"
    else "Low"
})

storesDF.withColumn("performance", assessPerformanceUDF(customers1t1sfaction))

Exam-Like
Quiz related visual




Powered ByGPT-5