Skip to content

Commit

Permalink
[KYUUBI #6370] For saveToFile, checking idx to prevent IndexOutOfBoun…
Browse files Browse the repository at this point in the history
…dsException

# 🔍 Description
## Issue References 🔗

This pull request fixes #6370

## Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6372 from turboFei/kyuubi_6370.

Closes #6370

d0c6a92 [Wang, Fei] fix

Authored-by: Wang, Fei <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
  • Loading branch information
turboFei committed May 8, 2024
1 parent 55f1db3 commit 12c5568
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[
var idx = 0

override def hasNext: Boolean = {
if (idx >= iters.size) return false
val hasNext = iters(idx).hasNext
if (!hasNext) {
iters(idx).close()
Expand Down

0 comments on commit 12c5568

Please sign in to comment.