VectorAppender fails with OversizedAllocationException when appending to empty UnionVector
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 VectorAppender.java 第556行附近的迴圈開始,檢查 UnionVector.getValueCapacity(),包括 NonNullableStructVector.java 第373行附近的程式碼。執行提供的 testAppendEmptyTargetUnionVector 重現,並比較 reAlloc() 前後的容量。當向空的 UnionVector 追加資料時能夠在沒有 OversizedAllocationException 的情況下完成,並保留全部五個 float 值,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug, including details regarding any error messages, version, and platform.
Description:
When appending a UnionVector to an empty target UnionVector, this while loop runs infinitely until the exception occurs:
org.apache.arrow.vector.util.OversizedAllocationException: Unable to expand the buffer
It seems to be a issue with the UnionVector.getValueCapacity() method. Logging the capacity before and after calling reAlloc() shows that it's always 0.
Debugging further, it seems like the value capacity of the internalStruct in the UnionVector always returns 0 because it has no children so size is 0.
@Override
public int getValueCapacity() {
return Math.min(getTypeBufferValueCapacity(), internalStruct.getValueCapacity());
}
Steps to reproduce
@Test
public void testAppendEmptyTargetUnionVector() {
final int length = 5;
try (final UnionVector target = UnionVector.empty("target", allocator);
final UnionVector delta = UnionVector.empty("delta", allocator)) {
// populate the delta vector
delta.setType(0, Types.MinorType.FLOAT4);
delta.setType(1, Types.MinorType.FLOAT4);
delta.setType(2, Types.MinorType.FLOAT4);
delta.setType(3, Types.MinorType.FLOAT4);
delta.setType(4, Types.MinorType.FLOAT4);
Float4Vector deltaFloatVector = delta.getFloat4Vector();
deltaFloatVector.allocateNew();
ValueVectorDataPopulator.setVector(deltaFloatVector, 1f, 2f, 3f, 4f, 5f);
assertEquals(length, deltaFloatVector.getValueCount());
delta.setValueCount(length);
VectorAppender appender = new VectorAppender(target);
delta.accept(appender, null);
assertEquals(length, target.getValueCount());
for (int i = 0; i < length; i++) {
Object floatObj = target.getObject(i);
assertTrue(floatObj instanceof Float);
assertEquals(i+1, ((Float) floatObj).intValue());
}
}
}
This issue does not occur if any value is set in the target vector before appending.
- 主要語言
- Java
- 星號
- 97
- 分支
- 158
- 平均合併
- 7 天 5 小時
- 30 天內合併 PR
- 9
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/arrow-java 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
apache/arrow-java#1311 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1261 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1236 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1230 ·
維護者通常 2 天內回覆
-
Type: bug
難度 2/5 1-3 小時 新手友好度 85/100
apache/arrow-java#1205 ·
維護者通常 2 天內回覆
查看 apache/arrow-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
apache/rocketmq-dashboard#5358 ·
維護者通常 3 天內回覆
-
area:cpan-port area:database bug
難度 2/5 1-3 小時 新手友好度 84/100
fglock/PerlOnJava#1605 ·
維護者通常 1 天內回覆
-
1.0.0-rc2
難度 2/5 1-3 小時 新手友好度 68/100
wso2/dpdp-accelerator#377 ·
維護者通常 1 天內回覆
-
area/dependencies backport/26.4 kind/cve severity/high source/scan-dependencies status/triage
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆