Câu 7: Databricks Certified Associate Developer for Apache Spark
Which of the following code blocks returns a new DataFrame with column storeDescription where the pattern "Description: " has been removed from the beginning of column storeDescription in DataFrame storesDF?A sample of DataFrame storesDF is below:
Nội dung câu hỏi
Which of the following code blocks returns a new DataFrame with column storeDescription where the pattern "Description: " has been removed from the beginning of column storeDescription in DataFrame storesDF?A sample of DataFrame storesDF is below:
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. storesDF.withColumn("storeDescription", regexp_replace(col("storeDescription"), "^Description: "))
- B. storesDF.withColumn("storeDescription", col("storeDescription").regexp_replace("^Description: ", ""))
- C. storesDF.withColumn("storeDescription", regexp_extract(col("storeDescription"), "^Description: ", ""))
- D. storesDF.withColumn("storeDescription", regexp_replace("storeDescription", "^Description: ", ""))
- E. storesDF.withColumn("storeDescription", regexp_replace(col("storeDescription"), "^Description: ", "")) — đá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.