Spark request max count
<p>I'm a beginner on spark and I try to make a request allow me to retrieve the most visited web pages.</p>

<p>My request is the following</p>

<pre><code>mostPopularWebPageDF = logDF.groupBy("webPage").agg(functions.count("webPage").alias("cntWebPage")).agg(functions.max("cntWebPage")).show()
</code></pre>

<p>With this request I retrieve only a dataframe with the max count but I want to retrieve a dataframe with this score and the  web page that holds this score</p>

<p>Something like that:</p>

<pre><code>webPage            max(cntWebPage)
google.com         2
</code></pre>

<p>How can I fix my problem?</p>

<p>Thanks a lot.</p>