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)
add the following import:
import org.apache.spark.sql.Row
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With