This is an automated email from the ASF dual-hosted git repository.
feiwang pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.9 by this push:
new e27735339 [KYUUBI #6370] For saveToFile, checking idx to prevent
IndexOutOfBoundsException
e27735339 is described below
commit e2773533966f1366236dfa4e6473f35752dc60f5
Author: Wang, Fei <[email protected]>
AuthorDate: Wed May 8 09:31:16 2024 -0700
[KYUUBI #6370] For saveToFile, checking idx to prevent
IndexOutOfBoundsException
# :mag: 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 :bookmark:
- [ ] 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 :coffin:
#### Behavior With This Pull Request :tada:
#### 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
d0c6a9236 [Wang, Fei] fix
Authored-by: Wang, Fei <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>
(cherry picked from commit 12c5568c9b020b1212c9514f046c67fcb267467e)
Signed-off-by: Wang, Fei <[email protected]>
---
.../org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala | 1 +
1 file changed, 1 insertion(+)
diff --git
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala
index 861539b95..4673588c9 100644
---
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala
+++
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala
@@ -111,6 +111,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()