title: Split a dataset in training and test in one line in scala spark
body: <p>That's not a very important point, I know, but I would like to know if I can save two lines of code.</p>
  
  <p>I have a dataset inputData that I want to split in two parts. I'm using the method randomSplit of the dataset class. However, I am forced to use three lines of code for doing this:</p>
  
  <pre><code>    val sets = inputData.randomSplit(Array[Double](0.7, 0.3), 18)
      val training = sets(0)
      val test = sets(1)
  </code></pre>
  
  <p>Ideally, I would like to do something like</p>
  
  <pre><code>    val (training, test) = inputData.randomSplit(Array[Double](0.7, 0.3), 18)
  </code></pre>
  
  <p>but this code does not compile due to an Error: </p>
  
  <pre><code>Error:(146, 13) constructor cannot be instantiated to expected type;
  found   : (T1, T2)
  required: Array[org.apache.spark.sql.Dataset[org.apache.spark.sql.Row]]
  </code></pre>
  
  <p>Is it possible to achieve what I want?</p>