title: Using hash mod to sample a dataframe
body: <p>I have a dataframe with a field transactionId and I want to sample on this 
  field. I'm wanting to sample on the hash of the field because the sampled data will be join to the sample of another sampled dataframe and I want tohave the same ids in both samples. Problem is I'm getting stuck on how to hash and mod within a filter, having tried various versions of this</p>
  
  <pre><code>scala&gt; val dfSampled = df.filter($"transactionId".hashCode() % 10 == 0)
      &lt;console&gt;:27: error: overloaded method value filter with alternatives:
      (conditionExpr: String)org.apache.spark.sql.DataFrame &lt;and&gt;
      (condition: org.apache.spark.sql.Column)org.apache.spark.sql.DataFrame
      cannot be applied to (Boolean)
              val dfSampled = df.filter($"transactionId".hashCode() % 10 == 0)
                                ^
  </code></pre>
  
  <p>`</p>
  
  <p>Can anyone give me some advice</p>