Avro adapter: setPosition doesn't work with BaseVariableWidthVectors
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing the Avro adapter's Consumer.setPosition behavior with BaseVariableWidthVector-based VarBinaryVector and VarCharVector instances. Reproduce the write sequence 0, 2, 1, 3 and add a regression test; done means positioning no longer erases previously written data or is prevented for these vectors.
Written by the indexing model from the issue text.
Description
Describe the bug, including details regarding any error messages, version, and platform.
BaseVariableWidthVector-based vectors (VarBinaryVector, VarCharVector) expect the data to be written sequentially. This means Consumer.setPosition is not safe to use. Imagine the following scenario:
- write index 0
- write index 2
- write index 1
- write index 3
On the last step, BaseVariableWidthVector.fillHoles erases the data written for the index 2:
protected final void fillHoles(int index) {
for (int i = lastSet + 1; i < index; i++) {
setBytes(i, emptyByteArray, 0, emptyByteArray.length);
}
lastSet = index - 1;
}
Here, index would be 3, lastSet + 1 would be 2 (1 + 1), so setBytes(2, emptyByteArray, ...) is called.
Not sure what the right solution is here, but at a minimum, the library shouldn't allow calling setPosition for Consumers using BaseVariableWidthVector vectors.
- Dominant language
- Java
- Stars
- 95
- Forks
- 154
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/arrow-java#1261 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1236 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/arrow-java#1230 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
apache/arrow-java#1205 ·
-
Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/arrow-java#1196 · 1 comment ·
All issues in apache/arrow-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100