Contenido principal

collect

R2026b

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

(To be removed) Return a MATLAB cell array that contains all of the elements in an RDD

matlab.compiler.mlspark.RDD.collect will be removed in a future release. There is no replacement functionality. For more information, see Version History.

Syntax

result = collect(obj)

Description

result = collect(obj) returns a MATLAB® cell array that contains all of the elements in obj.

Input Arguments

expand all

An input RDD, specified as an RDD object.

Output Arguments

expand all

Elements of an RDD, returned as a cell array.

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

%% Collect
x = sc.parallelize({'A', 2, 'C'});
y = sc.parallelize({'D', 1});
z = x.cartesian(y);
out = z.collect()

Version History

Introduced in R2016b

collapse all