Class: matlab.compiler.mlspark.RDD Package: matlab.compiler.mlspark
Return the set union of one RDD with another
result = union(obj1,obj2)
result = union(obj1,obj2) returns elements that are the set union of obj1 and obj2.
result
obj1
obj2
expand all
RDD
An input RDD, specified as a RDD object.
A pipelined RDD containing the set union of the two input RDDs, returned as a RDD object.
%% Connect to Spark sparkProp = containers.Map({'spark.executor.cores'}, {'1'}); conf = matlab.compiler.mlspark.SparkConf('AppName','myApp', ... 'Master','local[1]','SparkProperties',sparkProp); sc = matlab.compiler.mlspark.SparkContext(conf); %% union inRDD = sc.parallelize({'A','B'}); newRDD = inRDD.union(inRDD); %{'A','B', 'A','B'} viewRes = newRDD.collect()
intersection | parallelize | subtract | subtractByKey
intersection
parallelize
subtract
subtractByKey