title: Pass a ArrayType column to UDF in Spark Scala
body: <p>I have a column in my Spark  dataframe in Scala that was generated as a result of aggregration of multiple columns using</p>
  <pre><code> agg(collect_list(struct(col(abc), col(aaa)).as(def)
  </code></pre>
  <p>I want to pass this column to a UDF for further processing to work on one one of the index in this aggregated column.</p>
  <p>When I pass argument to my UDF as:</p>
  <pre><code>.withColumn(def, remove
              (col(xyz), col(def)))
  </code></pre>
  <p>UDF- Type as Seq[Row]:
  val removeUnstableActivations: UserDefinedFunction = udf((xyz: java.util.Date, def: Seq[Row])</p>
  <p>I get the error:</p>
  <pre><code>Exception encountered when invoking run on a nested suite - Schema for type org.apache.spark.sql.Row is not supported
  </code></pre>
  <p>How should I pass this columns and what should be the datatype of the column in UDF?</p>