Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MINOR][SQL] Move iterator.hasNext into try block in executeTask
### What changes were proposed in this pull request? This patch moves `iterator.hasNext` into the try block of `tryWithSafeFinallyAndFailureCallbacks` in `FileFormatWriter.executeTask`. ### Why are the changes needed? Not only `dataWriter.writeWithIterator(iterator)` causes error, `iterator.hasNext` could cause error like: ``` org.apache.spark.shuffle.FetchFailedException: Block shuffle_1_106_21 is corrupted but checksum verification passed ``` As it is not wrapped in the try block, `abort` won't be called on the committer. But as `setupTask` is called, it is safer to call `abort` in any case that error happens after it. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing test ### Was this patch authored or co-authored using generative AI tooling? No Closes #48360 from viirya/try_block. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: huaxingao <[email protected]>
- Loading branch information