Skip to content

Commit 0196ac2

Browse files
ericlMingjie Tang
authored andcommitted
[SPARK-20398][SQL] range() operator should include cancellation reason when killed
## What changes were proposed in this pull request? https://issues.apache.org/jira/browse/SPARK-19820 adds a reason field for why tasks were killed. However, for backwards compatibility it left the old TaskKilledException constructor which defaults to "unknown reason". The range() operator should use the constructor that fills in the reason rather than dropping it on task kill. ## How was this patch tested? Existing tests, and I tested this manually. Author: Eric Liang <[email protected]> Closes apache#17692 from ericl/fix-kill-reason-in-range.
1 parent 51eaa28 commit 0196ac2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,7 @@ case class RangeExec(range: org.apache.spark.sql.catalyst.plans.logical.Range)
463463
| $number = $batchEnd;
464464
| }
465465
|
466-
| if ($taskContext.isInterrupted()) {
467-
| throw new TaskKilledException();
468-
| }
466+
| $taskContext.killTaskIfInterrupted();
469467
|
470468
| long $nextBatchTodo;
471469
| if ($numElementsTodo > ${batchSize}L) {

0 commit comments

Comments
 (0)