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

Certified Associate Developer for Apache Spark Exam - Question 103


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__

Show Answer
Correct Answer: E

To print the schema of a DataFrame in Spark, you use the DataFrame's 'printSchema' method without any arguments. This method prints the schema of the DataFrame, including column names and types. Therefore, the code block should be filled with 'storesDF.printSchema'.

Discussion

5 comments
Sign in to comment
cookiemonster42Option: B
Aug 2, 2023

should be B for printSchema() is should be DataFrame.printSchema() with parenthesis

newusername
Nov 9, 2023

interesting case, either the answer E is indeed not complete () is missing or it is B, though B doesn't print schema but returns schema object

GluemrOption: E
Jan 17, 2024

E is correct. This question is for scala not python

Sowwy1Option: B
Apr 2, 2024

I think it's B.

SaiPavan10Option: E
Apr 4, 2024

It is df.printSchema().

SaiPavan10Option: B
Apr 4, 2024

B & E results an output. But using df.schema gives you the schema in more detail, df.printSchema just gives the columns that are present in the dataframe. df.printSchema() gives the detailed schema.