pyspark.RDD.isEmpty

RDD.isEmpty() → bool[source]

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

Notes

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

Examples

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