title: Convert Arrays into Spark DataSet in Scala
body: <p>I'm trying to create a DataSet from 4 arrays. I have arrays like this :</p>
  
  <pre><code>// Array 1
  val rawValues = rawData.select(collect_list("rawValue")).first().getList[Double](0).asScala.toArray
  
  // Array 2 
  var trendValues = Array[Double]()
  
  // Array 3 
  var seasonalValues = Array[Double]()
  
  // Array 4     
  var remainder = Array[Double]()
  </code></pre>
  
  <p>I have populated last 3 arrays based upon some computations (not included here) on the first Array. All the 4 arrays are of equal size and to populate the first array, another dataset's column-rawValue is converted into an Array as shown above.</p>
  
  <p>After doing all the computations, I want to create a DataSet which is having 4 separate columns and every column is representing above 4 separate arrays.</p>
  
  <p>So, basically how can I create a Dataset from arrays? I'm struggling in doing the same.</p>
  
  <p>Please help.</p>