5

I'd like to use the explode function on a DF, I just write the code like the document:

    case class Url(url:String)
    val temp3 = temp2.explode($"urls"){
        case Row(urls:Array[String]) => urls.map(Url(_))
    }

However , it came out:

error: not found: value Row

The DF temp2 is like:

temp2.printSchema()
root
 |-- userid: string (nullable = true)
 |-- urls: array (nullable = true)
 |    |-- element: string (containsNull = true)

1 Answer 1

22

add the following import:

import org.apache.spark.sql.Row
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.