apache / apache/arrow-java

[Java] Fix splitAndTransfer for variable width vector

Open
#419 1 comment 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

When we splitAndTransfer a vector, the value count to set for the target vector should be equal to split length and not the value count of source vector. 

We have seen cases in operator slike FLATTEN and under low memory conditions, we end up allocating a lot more memory for the target vector because of using a large value in setValueCount after split and transfer is done.

**Reporter**: [Siddharth Teotia](https://issues.apache.org/jira/browse/ARROW-2294) / @siddharthteotia

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

Contributor guide

Open the contributing guide

Research direction

Search the Java implementation for splitAndTransfer and the variable-width vector classes, then trace how FLATTEN invokes the operation. Verify the target vector's post-transfer value count against the split length and check the relevant existing tests or add coverage for the reduced allocation case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.