Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Push down limit through Dataset.isEmpty()
  • Loading branch information
wangyum committed Nov 1, 2023
commit 8bac7b5e507fca10d26b0e26d00c65d89fbc4789
2 changes: 1 addition & 1 deletion sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ class Dataset[T] private[sql](
* @group basic
* @since 2.4.0
*/
def isEmpty: Boolean = withAction("isEmpty", select().queryExecution) { plan =>
def isEmpty: Boolean = withAction("isEmpty", select().limit(1).queryExecution) { plan =>
plan.executeTake(1).isEmpty
}

Expand Down