QuestionQ56

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

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

Code block:

storesDF.describes(col(“sgft”))  
Explanation

Spark’s Scala Dataset.describe method accepts a variable number of column-name strings (String*) and computes basic statistics for the named numeric or string columns. A Column object returned by col(...) is not a valid argument; the intended invocation is storesDF.describe("sqft").

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!