Main Content

rightOuterJoin

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

Perform a right outer join

Syntax

result = rightOuterJoin(obj1,obj2,numPartitions)

Description

result = rightOuterJoin(obj1,obj2,numPartitions) performs a right 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);

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

Version History

Introduced in R2016b