scala - how to add a new column to Dataframe depending on the values of another one? : <p>I've created a dataframe with info about sales. Now I want to add a column (<code>metric1</code>) with booleans to the dataframe which values will depend on the <code>sl.review</code> field: if <code>sl.review</code> contains an empty string, then <code>metric1</code> will be false and <code>true</code> otherwise if there is a review in <code>sl.review</code>.        </p>

<pre><code>val salesDf: DataFrame = salesRawDf.select($"stores", explode($"sales").as("sl"))
      .select($"stores.id", $"stores.name", $"sl.id", $"sl.current_sales", $"sl.review")
</code></pre>

<p>How is it possible to achieve with DataFrame? I've read this related <a href="https://stackoverflow.com/questions/29909448/add-new-column-in-dataframe-base-on-existing-column">question</a> but still can't figure out how to implement this in my case.</p>
