Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 70


The code block shown below should return a new DataFrame where single quotes in column storeSlogan have been replaced with double quotes. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

A sample of DataFrame storesDF is below:

Code block:

storesDF.__1__(__2__, __3__(__4__, __5__, __6__))

Show Answer
Correct Answer: D

Discussion

2 comments
Sign in to comment
cookiemonster42Option: D
Jul 31, 2023

D is correct, we need a replacement function with first argument "'"

azure_bimonsterOption: D
Feb 9, 2024

To me it would like this: storesDF.withColumn("storeSlogan", regexp_replace(col("storeSlogan"), " ' ", "\""))