nerdexam
DatabricksDatabricks

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

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

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

Reading and Writing Data with Spark DataFrames

Question

The code block shown below contains an error. The code block is intended to read JSON at the file path filePath into a DataFrame with the specified schema schema. Identify the error. Code block: spark.read.schema("schema").format("json").load(filePath)

Options

  • AThe schema operation from read takes a schema object rather than a string - the argument should
  • BThere is no load() operation for DataFrameReader - it should be replaced with the json() operation.
  • CThe spark.read operation should be followed by parentheses in order to return a
  • DThere is no read property of spark - spark should be replaced with DataFrame.
  • EThe schema operation from read takes a column rather than a string - the argument should be

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

#PySpark DataFrame#Data Ingestion#Schema Definition#DataFrameReader
Full DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK PracticeBrowse All DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Questions