How it works...

In this example, we started with three sets of number Arrays (odd, even, and their combo) and then proceeded to pass them as parameters into the set operation API. We covered how to use intersection(), union(), subtract(), distinct(), and cartesian() RDD operators.

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.