I am using spark 1.6 and trying to get and cast a dataframe row value.
here is my problem : i have a row in my dataframe who have this kind of structure:
WrappedArray([List of String], [List of String])
I need tu use [List of String] in the WrappedArray , so i try to cast it with the this code :
val RDD= DF.map(
f => {
if(f.getAs("ListOfRficAction")!=null){
var listActions = f.getAs("ColumnName").asInstanceOf[WrappedArray[List[List[Any]]]] .map(m=>m:+f.getAs("AssetId").toString)
})
and i have the following error :
java.lang.ClassCastException: org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema cannot be cast to scala.collection.mutable.WrappedArray
Any idea of how i can cast it ?