
Ultimate access to all questions.
Which of the following code blocks correctly creates a Python UDF assessPerformanceUDF() from the integer-returning Python function assessPerformance() and applies it to the column customerSatisfaction in DataFrame storesDF?
A
assessPerformanceUDF = udf(assessPerformance, IntegerType) storesDF.withColumn("result", assessPerformanceUDF(col("customerSatisfaction")))
B
assessPerformanceUDF = udf(assessPerformance, IntegerType()) storesDF.withColumn("result", assessPerformanceUDF(col("customerSatisfaction")))
C
assessPerformanceUDF - udf(assessPerformance) storesDF.withColumn("result", assessPerformance(col("customerSatisfaction")))
D
assessPerformanceUDF = udf(assessPerformance) storesDF.withColumn("result", assessPerformanceUDF(col("customerSatisfaction")))
E
assessPerformanceUDF = udf(assessPerformance, IntegerType()) storesDF.withColumn("result", assessPerformance(col("customerSatisfaction")))