QuestionQ166

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which code block returns a new DataFrame in which the managerName column is the all-uppercase version of the managerName column in DataFrame storesDF? Assume that DataFrame storesDF is the only defined language variable.

Explanation

Spark withColumn returns a new DataFrame and replaces an existing column with the same name. col("managerName") creates the Column expression for managerName, and upper(...) converts that string expression to uppercase.

Learn more

Community Discussion

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