[jira] [Commented] (SPARK-23627) Provide isEmpty() function in DataSet
[ https://issues.apache.org/jira/browse/SPARK-23627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16394782#comment-16394782 ] Apache Spark commented on SPARK-23627: -- User 'goungoun' has created a pull request for this issue: https://github.com/apache/spark/pull/20800 > Provide isEmpty() function in DataSet > - > > Key: SPARK-23627 > URL: https://issues.apache.org/jira/browse/SPARK-23627 > Project: Spark > Issue Type: Improvement > Components: Spark Core, SQL >Affects Versions: 2.1.0 >Reporter: Goun Na >Priority: Trivial > > Like rdd.isEmpty, adding isEmpty to DataSet would useful. > Some code without isEmpty: > {code:java} > if (df.count = 0) { do_something }{code} > Some people add limit 1 for a performance reason: > {code:java} > if (df.limit(1).rdd.isEmpty) { do_something } > if (df.rdd.take(1).isEmpty) { do_something }{code} > > If isEmpty is provided, the code will be perfect clean: > {code:java} > if (df.isEmpty) { do_something }{code} > > > > > > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-23627) Provide isEmpty() function in DataSet
[ https://issues.apache.org/jira/browse/SPARK-23627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16392468#comment-16392468 ] Apache Spark commented on SPARK-23627: -- User 'goungoun' has created a pull request for this issue: https://github.com/apache/spark/pull/20782 > Provide isEmpty() function in DataSet > - > > Key: SPARK-23627 > URL: https://issues.apache.org/jira/browse/SPARK-23627 > Project: Spark > Issue Type: Improvement > Components: Spark Core, SQL >Affects Versions: 2.1.0 >Reporter: Goun Na >Priority: Trivial > > Like rdd.isEmpty, adding isEmpty to DataSet would useful. > Some code without isEmpty: > {code:java} > if (df.count = 0) { do_something }{code} > Some people add limit 1 for a performance reason: > {code:java} > if (df.limit(1).rdd.isEmpty) { do_something } > if (df.rdd.take(1).isEmpty) { do_something }{code} > > If isEmpty is provided, the code will be perfect clean: > {code:java} > if (df.isEmpty) { do_something }{code} > > > > > > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org