title: Getting the number of rows in a Spark dataframe without counting
body: <p>I am applying many transformations on a Spark DataFrame (filter, groupBy, join). I want to have the number of rows in the DataFrame after each transformation.</p>
  
  <p>I am currently counting the number of rows using the function count() after each transformation, but this triggers an action each time which is not really optimized.</p>
  
  <p>I was wondering if there is any way of knowing the number of rows without having to trigger another action than the original job.</p>