title: Spark dataframe filter
body: <pre><code>val df = sc.parallelize(Seq((1,"Emailab"), (2,"Phoneab"), (3, "Faxab"),(4,"Mail"),(5,"Other"),(6,"MSL12"),(7,"MSL"),(8,"HCP"),(9,"HCP12"))).toDF("c1","c2")
  
  +---+-------+
  | c1|     c2|
  +---+-------+
  |  1|Emailab|
  |  2|Phoneab|
  |  3|  Faxab|
  |  4|   Mail|
  |  5|  Other|
  |  6|  MSL12|
  |  7|    MSL|
  |  8|    HCP|
  |  9|  HCP12|
  +---+-------+
  </code></pre>
  
  <p>I want to filter out records which have first 3 characters of column 'c2' either 'MSL' or 'HCP'.</p>
  
  <p>So the output should be  like below.</p>
  
  <pre><code>+---+-------+
  | c1|     c2|
  +---+-------+
  |  1|Emailab|
  |  2|Phoneab|
  |  3|  Faxab|
  |  4|   Mail|
  |  5|  Other|
  +---+-------+
  </code></pre>
  
  <p>Can any one please help on this?</p>
  
  <p>I knew that <code>df.filter($"c2".rlike("MSL"))</code> -- This is for selecting the records but how to exclude the records. ?</p>
  
  <p>Version: Spark 1.6.2
  Scala : 2.10</p>