I am using Spark with Scala to do some data processing. I have XML data mapped to dataframe. I am passing a Row as parameter to the UDF and trying to extract two complex types objects as a list. Spark is giving me following error:
Exception in thread "main" java.lang.UnsupportedOperationException: Schema for type org.apache.spark.sql.Row is not supported
def testUdf = udf((testInput: Row) => {
val firstObject = testInput.getAs[Row]("Object1")
val secondObject = testInput.getAs[Row]("Object2")
val returnObject = Seq[firstObject,secondObject]
returnObject
})
Could you please tell me what I am doing wrong. Thanks.