-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40294][SQL] Fix repeat calls to PartitionReader.hasNext timing out
#37743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PartitionReader.hasNext timing outPartitionReader.hasNext timing out
|
Can one of the admins verify this patch? |
|
Does DSv1 have similar problems? |
| reader: PartitionReader[T], | ||
| customMetrics: Map[String, SQLMetric]) extends Iterator[T] { | ||
| private[this] var valuePrepared = false | ||
| private[this] var prevHasNext = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think hasMoreInput is a better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| private var numRow = 0L | ||
|
|
||
| override def hasNext: Boolean = { | ||
| if (!valuePrepared) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you follow the change in https://github.com/apache/spark/pull/37900/files ? It can avoid entering this if branch entirely.
|
ping @richardc-db |
|
Closed in favor of #37743 |
What changes were proposed in this pull request?
This change ensures that, once
PartitionReader.hasNextreturns false once, subsequent calls toPartitionReader.hasNextwill not callreader.next()(which before could cause a timeout).Why are the changes needed?
This change prevents potential performance regressions caused by parent nodes that call
PartitionIterator.hasNexteven after it returns false once.Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests