title: Converting String RDD to Int RDD
body: <p>I am new to scala..I want to know when processing large datasets with scala in spark is it possible to read as int RDD  instead of String RDD</p>
  
  <p>I tried the below:</p>
  
  <pre><code>val intArr = sc
                .textFile("Downloads/data/train.csv")
                .map(line=&gt;line.split(","))
                .map(_.toInt)
  </code></pre>
  
  <p>But I am getting the error:</p>
  
  <blockquote>
    <p>error: value toInt is not a member of <code>Array[String]</code></p>
  </blockquote>
  
  <p>I need to convert to int rdd because down the line i need to do the below</p>
  
  <pre><code>val vectors = intArr.map(p =&gt; Vectors.dense(p))
  </code></pre>
  
  <p>which requires the type to be integer</p>
  
  <p>Any kind of help is truly appreciated..thanks in advance</p>