SubtractReturn an RDD with the elements from ' this ' is not in ' other '.
def subtract (other:rdd[t]): Rdd[t]def subtract (other:rdd[t], numpartitions:int): Rdd[t]def subtract (other:rdd[t], p:p Artitioner): Rdd[t]
Val A = sc.parallelize (15= sc.parallelize (13== Array (45)
intersectionReturn the intersection of this RDD and another one. The output won't contain any duplicate elements, even if the-input RDDs did.
intersection
NULL ): Rdd[t]def intersection (Other:rdd[t]): Rdd[t]
Val x = sc.parallelize (1= sc.parallelize (28== Array (4682375)
CartesianReturn the Cartesian product of this rdd and another one, that's, the RDD of all pairs of elements (a, b) where a was in ' This ' and B are in ' other '.
Cartesian product
Val x = sc.parallelize (List (1,2,3)) Val y= Sc.parallelize (List (6,7,8) ) X.cartesian (y). Collect array[(int, int)]= Array (1,6), (1,7), (1,8), (2,6), (3,6), (2,7), (2,8), (3,7), (3,8))
The Subtract&intersection&cartesian of the common methods of RDD