apache / apache/arrow-java

[Java] Exception when trying to load next batch while reading a parquet file

Open
#80 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
94
Forks
152
Avg merge
3d 16h
Merged PRs (30d)
11

Description

### Describe the bug, including details regarding any error messages, version, and platform.

Getting this exception when trying to load next batch while reading a parquet file.
The parsing works if the batch size is big enough to process all the parquet contents in one shot. But if I try to give a smaller batch size , the code breaks giving the below exception

java.lang.IllegalArgumentException: should have as many children as in the schema: found 0 expected 8
at org.apache.arrow.util.Preconditions.checkArgument(Preconditions.java:282)
at org.apache.arrow.vector.VectorLoader.loadBuffers(VectorLoader.java:127)
at org.apache.arrow.vector.VectorLoader.load(VectorLoader.java:84)
at org.apache.arrow.c.Data.importIntoVectorSchemaRoot(Data.java:334)
at org.apache.arrow.dataset.jni.NativeScanner$NativeReader.loadNextBatch(NativeScanner.java:151)

### Component(s)

Java

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure when loading a parquet file in batches smaller than the full contents. Read NativeScanner.java at loadNextBatch, then trace the calls through Data.importIntoVectorSchemaRoot and VectorLoader.loadBuffers. Done means subsequent batches load without the schema-child-count exception, but the issue provides no test or reproduction file.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.