pyspark.RDD.isEmpty

RDD.isEmpty()[source]

Returns true if and only if the RDD contains no elements at all.

Note

an RDD may be empty even when it has at least 1 partition.

>>> sc.parallelize([]).isEmpty()
True
>>> sc.parallelize([1]).isEmpty()
False