thebluephantom thebluephantom - 1 year ago 257
Scala Question

SPARK SCALA contain vs. not contain

I can filter - as per below - tuples in RDD. But what about the "not contains"? Cannot find the syntax for this. Assuming it is possible and am not using a data frame. Cannot see from regex and filter examples. Thanks in advance.

val z = y.filter(x => x._1 contains ".")

Answer Source

It's just the negation of the contains filter :

val z = y.filter(x => !(x._1 contains "."))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download