apache / apache/arrow-java

Arrow vector in Java(Scala) allocate byteBuffer error while read the bytes from Python pyarrow

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

Description

I am using scala arrow 1.0.1 and pyarrow 1.0.1

Following error occurs when scala decode the byte that encoded from python.

tried to downgrade pyarrow to 0.17.0, 0.14.1, error still exists.

This is a loop function to decode the same data repeatedly. The error occurs sometimes, and I use a try catch block to include the code. And after an error occurs, following code could still work correctly, but after the first error occurs, following error would happen more frequently.
> Error stack trace java.nio.ByteBuffer.allocate(ByteBuffer.java:334)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.message.MessageSerializer.readMessage(MessageSerializer.java:692)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.message.MessageChannelReader.readNext(MessageChannelReader.java:57)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.ArrowStreamReader.readSchema(ArrowStreamReader.java:164)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.ArrowReader.initialize(ArrowReader.java:170)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.ArrowReader.ensureInitialized(ArrowReader.java:161)
> com.intel.analytics.zoo.shaded.arrow.vector.ipc.ArrowReader.getVectorSchemaRoot(ArrowReader.java:63)
How to fix it?

**Reporter**: [Litchy Soong](https://issues.apache.org/jira/browse/ARROW-10342)

**Note**: *This issue was originally created as [ARROW-10342](https://issues.apache.org/jira/browse/ARROW-10342). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the repeated decode loop with Python-produced bytes, then trace the stack from ArrowReader and ArrowStreamReader through MessageChannelReader and MessageSerializer. The issue does not name a source file or test; done means the data can be decoded repeatedly without the intermittent ByteBuffer allocation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python, scala
Domain
data-engineering
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.