title: Spark's dataframe count() function taking very long
body: <p>In my code, I have a sequence of dataframes where I want to filter out the dataframe's which are empty. I'm doing something like:</p>
  
  <pre><code>Seq(df1, df2).map(df =&gt; df.count() &gt; 0)
  </code></pre>
  
  <p>However, this is taking <strong>extremely long</strong> and is consuming around 7 minutes for approximately 2 dataframe's of 100k rows each. </p>
  
  <p>My question: Why is Spark's implementation of count() is slow. Is there a work-around?</p>