title: Scala-java.lang.ArrayIndexOutOfBoundsException: 1
body: <p>I am trying to create a Row[RDD]</p>
  
  <pre><code>val RowRDD =sc.textFile("InputFile.csv").map(x=&gt;x.split(" ")).map(p=&gt;Row(p(1),p(2)))
  </code></pre>
  
  <p>InputFile.csv is </p>
  
  <pre><code>spark 5 1
  hadoop 7 1
  flink 10 1
  </code></pre>
  
  <p>However,as I am running my application,the error says</p>
  
  <pre><code>java.lang.ArrayIndexOutOfBoundsException: 1
  </code></pre>
  
  <p>It is obvious that the 'InputFile.csv' has 3 rows,why is there an error? </p>