nerdexam
DatabricksDatabricks

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

DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Question #107: Real Exam Question with Answer & Explanation

The correct answer is E: storesDF.withColumn("division", col("division").substr(l, 2)). See the full explanation below for the reasoning.

Perform DataFrame Transformations

Question

Which of the following code blocks returns a new DataFrame where column division is the first two characters of column division in DataFrame storesDF?

Options

  • AstoresDF.withColumn("division", substr(col("division"), 0, 2))
  • BstoresDF.withColumn("division", susbtr(col("division"), 1, 2))
  • CstoresDF,withColumn("division", col("division").substr(0, 3))
  • DstoresDF.withColumn("division", col("division").substr(0, 2))
  • EstoresDF.withColumn("division", col("division").substr(l, 2))

Topics

#DataFrame Transformations#String Functions#PySpark#Column Operations

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK PracticeBrowse All DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Questions