You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "cxzl25 (via GitHub)" <gi...@apache.org> on 2026/06/10 11:02:32 UTC
[PR] ORC-2177: Fix array conversion with empty first batch [orc]
cxzl25 opened a new pull request, #2638:
URL: https://github.com/apache/orc/pull/2638
### What changes were proposed in this pull request?
Add a `batchSize > 0` guard in `ConvertTreeReader.convertVector()` before accessing index 0.
### Why are the changes needed?
When reading an ORC file with schema evolution converting `array<int>` to `array<string>`, an `ArrayIndexOutOfBoundsException` is thrown if the first batch processed by the element reader has `childCount=0` (i.e., all rows in the batch contain empty arrays).
```java
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at org.apache.orc.impl.ConvertTreeReaderFactory$StringGroupFromAnyIntegerTreeReader.setConvertVectorElement(ConvertTreeReaderFactory.java:1094)
at org.apache.orc.impl.ConvertTreeReaderFactory$ConvertTreeReader.convertVector(ConvertTreeReaderFactory.java:305)
at org.apache.orc.impl.ConvertTreeReaderFactory$StringGroupFromAnyIntegerTreeReader.nextVector(ConvertTreeReaderFactory.java:1115)
at org.apache.orc.impl.TreeReaderFactory$ListTreeReader.nextVector(TreeReaderFactory.java:2892)
at org.apache.orc.impl.reader.tree.StructBatchReader.readBatchColumn(StructBatchReader.java:66)
at org.apache.orc.impl.reader.tree.StructBatchReader.nextBatchForLevel(StructBatchReader.java:101)
at org.apache.orc.impl.reader.tree.StructBatchReader.nextBatch(StructBatchReader.java:78)
at org.apache.orc.impl.RecordReaderImpl.nextBatch(RecordReaderImpl.java:1444)
```
### How was this patch tested?
Added `testIntArrayToStringArrayFirstBatchAllEmpty` in `TestConvertTreeReaderFactory`
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ORC-2177: Fix array conversion with empty first batch [orc]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #2638:
URL: https://github.com/apache/orc/pull/2638#issuecomment-4721361797
Merged to main/2.3/2.2/2.1/2.0/1.9.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ORC-2177: Fix array conversion with empty first batch [orc]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #2638: ORC-2177: Fix array conversion with empty first batch
URL: https://github.com/apache/orc/pull/2638
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@orc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org