Câu 60: 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 where column managerName from DataFrame storesDF is split at the space character into column managerFirstName and column managerLastName. Identify the error. A sample of DataFrame storesDF is displayed below: Code block:…
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 where column managerName from DataFrame storesDF is split at the space character into column managerFirstName and column managerLastName. Identify the error. A sample of DataFrame storesDF is displayed below: Code block:storesDF.withColumn("managerFirstName", col("managerName").split(" ").getItem(0)).withColumn("managerLastName", col("managerName").split(" ").getItem(1))
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.
- A. The index values of 0 and 1 are not correct – they should be 1 and 2, respectively.
- B. The index values of 0 and 1 should be provided as second arguments to the split() operation rather than indexing the result.
- C. The split() operation comes from the imported functions object. It accepts a string column name and split character as arguments. It is not a method of a Column object.
- D. The split() operation comes from the imported functions object. It accepts a Column object and split character as arguments. It is not a method of a Column object. — đáp án hiện tại
- E. The withColumn operation cannot be called twice in a row.
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.