Main Content

leftOuterJoin

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

Perform a left outer join

Syntax

result = leftOuterJoin(obj1,obj2,numPartitions)

Description

result = leftOuterJoin(obj1,obj2,numPartitions) performs a left outer join on 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);

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

Version History

Introduced in R2016b