Certified Associate Developer for Apache Spark Exam QuestionsBrowse all questions from this exam

Certified Associate Developer for Apache Spark Exam - Question 40


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

Show Answer
Correct Answer: E

The printSchema member of DataFrame is a method and needs to be followed by parentheses to indicate that it's a method call. Therefore, the correct code block should be storesDF.printSchema().

Discussion

1 comment
Sign in to comment
4be8126Option: E
May 1, 2023

E. The printSchema member of DataFrame is an operation and needs to be followed by parentheses. The correct code block should be storesDF.printSchema() with parentheses to indicate that it's a method call.