Can not convert RDD to sequence <p>I have a variable <code>rawData</code> of type <code>DataFrame</code>. I want to get all the elements of a column and convert them to a Scala <code>Seq</code>.</p> <pre><code>val res = rawData.map(x =&gt; x(0)).toSeq </code></pre> <p>However, I am getting the following error:</p> <pre><code>Error:(114, 40) value toSeq is not a member of org.apache.spark.rdd.RDD[Any] val res = rawData.map(x =&gt; x(0)).toSeq </code></pre> <p>So <code>rawData.map(x =&gt; x(0))</code> is of type <code>RDD[Any]</code>. How can I convert that to a <code>Seq</code>?</p>