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

Certified Associate Developer for Apache Spark Exam - Question 101


The code block shown below contains an error. The code block is intended to return a collection of summary statistics for column sqft in Data Frame storesDF. Identify the error.

Code block:

storesDF.describes(col(“sgft”))

Show Answer
Correct Answer: E

The error in the code block is that the describe() operation does not accept a Column object as an argument. Instead, you should specify the column name as a string directly. The corrected code should be storesDF.describe('sqft').

Discussion

2 comments
Sign in to comment
Sowwy1Option: E
Apr 2, 2024

I think it's E. It should be storesDF.describe("sqft")

SaiPavan10Option: E
Apr 4, 2024

E is the right choice.