spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Goun Na (JIRA)" <>
Subject [jira] [Created] (SPARK-23627) Provide isEmpty() function in DataSet
Date Thu, 08 Mar 2018 07:32:00 GMT
Goun Na created SPARK-23627:

             Summary: Provide isEmpty() function in DataSet
                 Key: SPARK-23627
             Project: Spark
          Issue Type: Improvement
          Components: Spark Core, SQL
    Affects Versions: 2.1.0
            Reporter: Goun Na

Like rdd.isEmpty, adding isEmpty to DataSet would useful. 


Some code without isEmpty:
if (df.count = 0) { do_something }{code}

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 }{code}


However, if isEmpty provided, the code will be perfect clean:
if (df.isEmpty)  { do_something }{code}








This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message