Databricks Certified Associate Developer for Apache Spark — Question 159
The code block shown below should print the schema of DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.
Code block:
__1__.__2__(__3__)
Answer options
- A. 1. storesDF 2. schema 3. Nothing
- B. 1. storesDF 2. str 3. schema
- C. 1. storesDF 2. printSchema 3. True
- D. 1. storesDF 2. printSchema 3. Nothing
- E. 1. storesDF 2. printSchema 3. "all"
Correct answer: D
Explanation
The correct answer is D because 'printSchema' is the method used to display the schema of a DataFrame in Spark, and 'Nothing' is the appropriate argument to indicate that no additional details are required. The other options either use incorrect method names or inappropriate arguments that do not align with the function's requirements.