QuestionQ237

VerifiedUsing Spark SQL

Which of the following code blocks registers a SQL UDF named ASSESS_PERFORMANCE using the Scala function assessPerformance() and uses it on the customerSatisfaction column in the stores table?

Explanation

Spark registers Scala UDFs with spark.udf.register(name, function). Once registered, the function is available to Spark SQL under that registered name, so the SQL expression must call ASSESS_PERFORMANCE(customerSatisfaction) while selecting from stores.

Learn more

Community Discussion

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