Which of the following code blocks creates and registers a SQL UDF named "ASSESS_PERFORMANCE" using the Scala function assessPerformance() and applies it to column customerSatisfaction in table stores?
A.
spark.udf.register("ASSESS_PERFORMANCE", assessPerformance) spark.sql("SELECT customerSatisfaction, ASSESS_PERFORMANCE(customerSatisfaction) AS result FROM stores")
B.
spark.udf.register("ASSESS_PERFORMANCE", assessPerformance)
C.
spark.udf.register("ASSESS_PERFORMANCE", assessPerformance) spark.sql("SELECT customerSatisfaction, assessPerformance(customerSatisfaction) AS result FROM stores")
D.
spark.udf.register("ASSESS_PERFORMANCE", assessPerformance) storesDF.withColumn("result", assessPerformance(col("customerSatisfaction")))
E.
spark.udf.register("ASSESS_PERFORMANCE", assessPerformance) storesDF.withColumn("result", ASSESS_PERFORMANCE(col("customerSatisfaction")))
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
nadegetiedjo
7 months agocarlosmps
5 months agoSowwy1
7 months, 3 weeks ago