Main Content


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

Determine if an RDD contains any elements


tf = isEmpty(obj)


tf = isEmpty(obj) returns a logical 1 (true) if the input RDD obj contains no elements, and a logical 0 (false) otherwise.

Input Arguments

expand all

An input RDD, specified as an RDD object.

Output Arguments

expand all

Indicates whether the input RDD is empty or not, returned as a logical value.


expand all

Check if an RDD contains any elements.

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

%% isEmpty
x = sc.parallelize({});
tf ={x,1})).isEmpty(); % tf=1

Version History

Introduced in R2016b