
Ultimate access to all questions.
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))
