Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
2.1.0
-
None
Description
Like rdd.isEmpty, adding isEmpty to DataSet would useful.
Some code without isEmpty:
if (df.count = 0) { do_something }
Some people add limit 1 for a performance reason:
if (df.limit(1).rdd.isEmpty) { do_something } if (df.rdd.take(1).isEmpty) { do_something }
If isEmpty is provided, the code will be perfect clean:
if (df.isEmpty) { do_something }