title: How to get the size of result generated using concat_ws?
body: <p>I am performing <code>groupBy</code> on COL1 and getting the concatenated list of COL2 using <code>concat_ws</code>. How can I get the count of values in that list? Here's my code:</p>
  
  <pre><code>Dataset&lt;Row&gt; ds = df.groupBy("COL1").agg(org.apache.spark.sql.functions
      .concat_ws(",",org.apache.spark.sql.functions.collect_list("COL2")).as("sample"));
  </code></pre>