Append Column to Row in Spark
<p>I have a <code>DataFrame</code> which I want to extend by a new column. Creating a new <code>DateFrame</code> from <code>Row</code>s is explained <a href="http://spark.apache.org/docs/latest/sql-programming-guide.html#programmatically-specifying-the-schema" rel="nofollow">here</a>. </p>

<p>My current strategy is to construct new <code>Row</code>s with the RowFactory from the <code>Row</code>s that are passed into my map invoked by <code>DataFrame.javaRDD().map(...)</code> but I fear that this might create unnecessary costs. </p>

<p>So I wonder if instead of creating new <code>Row</code>s, can I just extend the existing <code>Row</code>s by appending the new field. The <code>Row</code> interface doesn't seem to allow that.</p>

<p><a href="https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala" rel="nofollow">code of Row</a></p>