title: Spark simpler value_counts
body: <p>Something similar to <a href="https://stackoverflow.com/questions/35763284/spark-group-by-key-then-count-by-value">Spark - Group by Key then Count by Value</a> would allow me to emulate <code>df.series.value_counts()</code> the functionality of Pandas in Spark to:</p>
  
  <blockquote>
    <p>The resulting object will be in descending order so that the first
    element is the most frequently-occurring element. Excludes NA values
    by default. (<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html" rel="noreferrer">http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html</a>)</p>
  </blockquote>
  
  <p>I am curious if this can't be achieved nicer / simpler for data frames in Spark.</p>