Github user mridulm commented on a diff in the pull request:
https://github.com/apache/spark/pull/16357#discussion_r93323151
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala
---
@@ -88,7 +88,15 @@ class FileScanRDD(
private[this] var currentFile: PartitionedFile = null
private[this] var currentIterator: Iterator[Object] = null
- def hasNext = (currentIterator != null && currentIterator.hasNext)
|| nextIterator()
+ def hasNext: Boolean = {
+ // Kill the task in case it has been marked as killed. This logic
is from
+ // InterruptibleIterator, but we inline it here instead of
wrapping the iterator in order
+ // to avoid performance overhead.
+ if (context.isInterrupted()) {
+ throw new TaskKilledException
+ }
--- End diff --
Why not move this to next() instead of hasNext (latter is not mandatory to
be called - as seen here : https://github.com/apache/spark/pull/16252)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]