title: Caching a PySpark Dataframe
body: <p>Suppose we have a PySpark dataframe <code>df</code> with ~10M rows. Also let the columns be <code>[col_a, col_b]</code>. Which would be faster:</p>
  <pre><code>df_test = df.sample(0.1)
  for i in range(10):
    df_sample = df_test.select(df.col_a).distinct().take(10)
  </code></pre>
  <p>or</p>
  <pre><code>df_test = df.sample(0.1)
  df_test = df_test.cache()
  for i in range(10):
    df_sample = df_test.select(df.col_a).distinct().take(10) 
  </code></pre>
  <p>Would caching <code>df_test</code> make sense here?</p>