nerdexam
Databricks

DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK · Question #169

Which of the following code blocks returns a DataFrame with column storeSlogan where single quotes in column storeSlogan in DataFrame storesDF have been replaced with double quotes? A sample of DataFr

Sign in or unlock DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK to reveal the answer and full explanation for question #169. The question stem and answer options stay visible for context.

Working with DataFrames

Question

Which of the following code blocks returns a DataFrame with column storeSlogan where single quotes in column storeSlogan in DataFrame storesDF have been replaced with double quotes? A sample of DataFrame storesDF is below:

Exhibit

DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK question #169 exhibit

Options

  • AstoresDF.withColumn("storeSlogan", col("storeSlogan").regexp_replace("'" """))
  • BstoresDF.withColumn("storeSlogan", regexp_replace(col("storeSlogan"), "'"))
  • CstoresDF.withColumn("storeSlogan", regexp_replace(col("storeSlogan"), "'", """))
  • DstoresDF.withColumn("storeSlogan", regexp_replace("storeSlogan", "'", """))
  • EstoresDF.withColumn("storeSlogan", regexp_extract(col("storeSlogan"), "'", """))

Unlock DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK to see the answer

You've previewed enough free DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK questions. Unlock DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#DataFrame Transformations#Spark SQL Functions#String Manipulation
Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Practice