title: Extracting Column values and storing it in an Array
body: <p>I need to collect the columnn values and store it in form of an array from spark dataframe. Just like we do with pandas data frame using <code>.values</code> function</p>
  
  <p>I have tried using <code>.select().collect()</code> however it gives me empty rows</p>
  
  <pre class="lang-java prettyprint-override"><code>X = XVAr.values
  Y = DF.loc[:,'LTR'].values
  </code></pre>
  
  <p>the above is done for pandas dataframe i need to do the same in spark dataframe</p>
  
  <p>I expect an output in form of an array <code>[[5,6,4,3],[3,4,6,5]]</code></p>