title: Scala/Spark randomSplit
body: <p>I am trying to make a model using training and testing data. 
  I want to control in case of arguments: 
  1. If I get one argument (one file path) by console, I want to split the data.
  2. If I get two arguments (two file paths), one is the training and the other one the test data.
  3. Other case, take one by default.</p>
  
  <p>The problem is to define the variable before the condition. I don't know how it works the Some/Option/None sentence and I get and error some steps after this:</p>
  
  <pre><code>var dataTraining: Option[RDD[String]]=None
  var dataTesting: Option[RDD[String]]=None
  
  if(args.length==1){
        val data=sc.textFile(args(0))
        val splitData=data.randomSplit(Array(0.8,0.2),seed=11L)
        (dataTraining,DataTesting)=(Some(splitData(0)),Some(splitData(1)))
  }
  else if(args.length==2){
        dataTraining=Some(sc.textFile(args(0))
        dataTesting=Some(sc.textFile(args(1))
  }
  else{
        dataTraining=Some(sc.textFile("/ruta")
        dataTesting=Some(sc.textFile("/ruta2")
  }
  </code></pre>
  
  <p>I don't get any error here, but when I want to try to do: .map(_.split(',')), intellij can't reconice split function. Maybe the type of dataTraining/dataTesting is not the correct one.</p>
  
  <p>¿What is my mistake?</p>
  
  <p>Thank you so much!!</p>