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

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

The code block shown below contains an error. The code block is intended to return a new DataFrame with the mean of column sqft from DataFrame storesDF in column sqftMean. Identify the error. Code block:storesDF.agg(mean("sqft").alias("sqftMean"))

Nội dung câu hỏi

The code block shown below contains an error. The code block is intended to return a new DataFrame with the mean of column sqft from DataFrame storesDF in column sqftMean. Identify the error. Code block:storesDF.agg(mean("sqft").alias("sqftMean"))

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 argument to the mean() operation should be a Column abject rather than a string column name. — đáp án hiện tại
  2. B. The argument to the mean() operation should not be quoted.
  3. C. The mean() operation is not a standalone function – it’s a method of the Column object.
  4. D. The agg() operation is not appropriate here – the withColumn() operation should be used instead.
  5. E. The only way to compute a mean of a column is with the mean() method from a DataFrame.

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ề