QuestionQ27

VerifiedDeveloping Apache Spark™ DataFrame/DataSet API Applications

Which of the following code blocks returns a new DataFrame in which column division contains the first two characters of column division in DataFrame storesDF?

Explanation

withColumn creates a new DataFrame with the specified column replaced, and Column.substr produces a substring Column. Using a length of 2 extracts two characters from the beginning of each division value.

Learn more

Community Discussion

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