How to get max length of string column from dataframe using scala?
<p>This can be a really simple question. I am using Spark 1.6 with scala </p>

<pre><code>var DF=hivecontext.sql("select name from myTable")
val name_max_len =DF.agg(max(length($"name"))) // did not work

println(name_max_len)
</code></pre>

<p>How can I get max length?</p>