Main Content


Class: matlab.compiler.mlspark.RDD
Package: matlab.compiler.mlspark

Return an RDD with the keys of each tuple


result = keys(obj)


result = keys(obj) returns an RDD result with the keys of each tuple in obj.

Input Arguments

expand all

An input RDD, specified as a RDD object.

Output Arguments

expand all

A pipelined RDD containing the keys of each tuple in the input RDD, returned as a RDD object.


expand all

%% Connect to Spark
sparkProp = containers.Map({'spark.executor.cores'}, {'1'});
conf = matlab.compiler.mlspark.SparkConf('AppName','myApp', ...
sc = matlab.compiler.mlspark.SparkContext(conf);

%% keys
m = sc.parallelize({ {'AA', {5,15} }, {'BB', 200}});
out = m.keys().collect();

Version History

Introduced in R2016b

See Also