title: How to remove records with their count per group below a threshold?
body: <p>Here's the DataFrame:</p>
  
  <pre><code>id | sector     | balance
  ---------------------------
  1  | restaurant | 20000
  2  | restaurant | 20000
  3  | auto       | 10000
  4  | auto       | 10000
  5  | auto       | 10000
  </code></pre>
  
  <p>How to find the count of each <code>sector</code> type and remove the records with <code>sector</code> type count below a specific <code>LIMIT</code>?</p>
  
  <p>The following:</p>
  
  <pre><code>dataFrame.groupBy(columnName).count()
  </code></pre>
  
  <p>gives me the number of times a value appears in that column.</p>
  
  <p>How to do it in Spark and Scala using DataFrame API?</p>