Exam Certified Associate Developer for Apache Spark All QuestionsBrowse all questions from this 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__))

    Correct Answer: D

Discussion
cookiemonster42Option: D

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

azure_bimonsterOption: D

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