Câu 94: 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 from DataFrame storesDF where column storeId is of the type string. Identify the error. Code block:storesDF.withColumn(“storeId”, cast(col(“storeId”), StringType()))
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 from DataFrame storesDF where column storeId is of the type string. Identify the error. Code block:storesDF.withColumn(“storeId”, cast(col(“storeId”), StringType()))
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. Calls to withColumn() cannot create a new column of the same name on which it is operating.
- B. DataFrame columns cannot be converted to a new type inside of a call to withColumn().
- C. The call to StringType should not be followed by parentheses.
- D. The column name storeId inside the col() operation should not be quoted.
- E. The cast() operation is a method in the Column class rather than a standalone function. — đáp án hiện tại
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.