CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 36: Databricks Certified Associate Developer for Apache Spark

The code block shown below contains an error. The code block is intended to create a Python UDF assessPerformanceUDF() using the integer-returning Python function assessPerformance() and apply it to column customerSatisfaction in DataFrame storesDF. Identify the error. Code block:assessPerformanceUDF – udf(assessPerfo…

Nội dung câu hỏi

The code block shown below contains an error. The code block is intended to create a Python UDF assessPerformanceUDF() using the integer-returning Python function assessPerformance() and apply it to column customerSatisfaction in DataFrame storesDF. Identify the error. Code block:assessPerformanceUDF – udf(assessPerformance)storesDF.withColumn("result", assessPerformanceUDF(col("customerSatisfaction")))

Các lựa chọn

Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.

  1. A. The assessPerformance() operation is not properly registered as a UDF.
  2. B. The withColumn() operation is not appropriate here – UDFs should be applied by iterating over rows instead.
  3. C. UDFs can only be applied vie SQL and not through the DataFrame API.
  4. D. The return type of the assessPerformanceUDF() is not specified in the udf() operation. — đáp án hiện tại
  5. E. The assessPerformance() operation should be used on column customerSatisfaction rather than the assessPerformanceUDF() operation.

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề