VectorAppender fails with OversizedAllocationException when appending to empty UnionVector
維護者通常 1 天內回覆
還沒有人認領這個 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 天 12 小時
- 30 天內合併 PR
- 31
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/arrow-java 的其他 Issue
-
DictionaryEncoder.decode accepts out-of-range dictionary indices可能已有人在做 @Arawoof06 於 49 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1261 ·
維護者通常 1 天內回覆
-
ArrowFlightJdbcArray.getArray(index, count) can read past the end of the array slice可能已有人在做 @Arawoof06 於 78 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1236 ·
維護者通常 1 天內回覆
-
[Java][JDBC] ClobConsumer writes past VarCharVector data buffer for large CLOBs可能已有人在做 @Arawoof06 於 83 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1230 ·
維護者通常 1 天內回覆
-
[Java] DictionaryEncoder doesn't crash when decoding index outside of Dictionary可能已有人在做 @jakobhok-neo4j 於 140 天前認領。 未關閉Type: bug
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1158 ·
維護者通常 1 天內回覆
-
Type: enhancement
難度 2/5 1-3 小時 新手友好度 76/100
apache/arrow-java#1100 ·
維護者通常 1 天內回覆
查看 apache/arrow-java 的全部 Issue
相似的 Issue
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)未關閉
難度 2/5 1-3 小時 新手友好度 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 個 reaction ·
維護者通常 2 天內回覆
-
難度 1/5 1 小時以內 新手友好度 70/100
維護者通常 4 天內回覆
-
enhancement untriaged
難度 2/5 1-3 小時 新手友好度 78/100
opensearch-project/sql#5842 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
openhab/openhab-addons#21882 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
YunaiV/ruoyi-vue-pro#1273 ·
維護者通常 3 天內回覆