title: How to add a new column with maximum value?
body: <p>I have a Dataframe with 2 columns <code>tag</code> and <code>value</code>.</p>
  
  <p>I want to add a new column that contains the <code>max</code> of <code>value</code> column. (It will be the same value for every row).</p>
  
  <p>I tried to do something as follows, but it didn't work.</p>
  
  <pre><code>val df2 = df.withColumn("max",max($"value"))
  </code></pre>
  
  <p>How to add the <code>max</code> column to the dataset?</p>