title: Return Seq[Row] from Spark-Scala UDF
body: <p>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:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.UnsupportedOperationException: Schema for type org.apache.spark.sql.Row is not supported</p>
  </blockquote>
  
  <pre><code>def testUdf = udf((testInput: Row) =&gt; {
    val firstObject = testInput.getAs[Row]("Object1")
    val secondObject = testInput.getAs[Row]("Object2")
    val returnObject = Seq[firstObject,secondObject]
  
    returnObject
  })
  </code></pre>
  
  <p>Could you please tell me what I am doing wrong. Thanks.</p>