Main Content

fullOuterJoin

Class: matlab.compiler.mlspark.RDD
Namespace: matlab.compiler.mlspark

Perform a full outer join between two key-value pair RDDs

Syntax

result = fullOuterJoin(obj1,obj2,numPartitions)

Description

result = fullOuterJoin(obj1,obj2,numPartitions) performs a full outer join between two key-value pair RDDs, obj1 and obj2. numPartitions specifies the number of partitions to create in the resulting RDD.

Input Arguments

expand all

Input RDD to be joined, specified as a RDD object. RDD must be a key-value pair RDD.

Input RDD to be joined, specified as a RDD object. RDD must be a key-value pair RDD.

Number of partitions to create, specified as a scalar value.

Data Types: double

Output Arguments

expand all

A pipelined RDD containing all pairs of elements with matching keys in the two input RDDs, returned as a RDD object.

Examples

expand all

%% 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);

%% fullOuterJoin
x = sc.parallelize({ {'a',1}, {'b', 4} });
y = sc.parallelize({ {'a',2}, {'c', 8} });
z = x.fullOuterJoin(y);
viewRes = z.collect() % {{'a',{1,2}},{'b',{4,[]}},{'c',{[],8}}}

Version History

Introduced in R2016b