Databricks Certified Associate Developer for Apache Spark — Question 215

The code block shown below contains an error. The code block is intended to print the schema of DataFrame storesDF. Identify the error.
Code block:
storesDF.printSchema

Answer options

Correct answer: E

Explanation

The correct answer is E because the printSchema method must be called with parentheses to execute it properly. Options A, C, and D are incorrect as they misidentify the nature of the printSchema method. Option B is also incorrect because wrapping the line in str() is not relevant to the issue at hand.