How to filter out elements in RDD using list of exclusions (similar to isin)?

Viewed 2791

I am trying to filter the arraybuffer using elements in a list similar to isin in Dataframe.

val booksDF: DataFrame = ...
val Books_Category = List("A","B","C")
val action_books = booksDF.filter($"bk_category_cd" isin (Books_Category: _*))

How do I apply same filter using collection on an RDD?

1 Answers
Related