[Java] MapVector written data does not meet expectations
還沒有人認領這個 Issue。
評估
研究方向
使用 MapVector 和 UnionMapWriter 重現提供的 Java 程式碼片段,然後檢查 MapVector 和 UnionMapWriter 的寫入路徑,了解其對不同鍵型別和值型別的處理。比較現有的 ListVector 文件範例,並將完成定義為以下任一項:成功寫入具有混合型別的 MapVector,或提供一個有文件說明且可運作的 MapVector 範例,並由回歸測試支援。
由索引模型根據 Issue 內容生成。
描述
What would you like help with?
RootAllocator allocator = new RootAllocator(Long.MAX_VALUE);
Map<String, String> metadata = new HashMap<>();
metadata.put("K1", "V1");
metadata.put("K2", "V2");
Field a = new Field("key", FieldType.notNullable(new ArrowType.Int(32, true)), null);
Field b = new Field("value", FieldType.nullable(new ArrowType.Int(32,true)), null);
Schema schema = new Schema(asList(a, b), metadata);
Field struct = new Field("struct", FieldType.notNullable(new ArrowType.Struct()), schema.getFields());
StructVector structVector = new StructVector(Field.nullable("struct", struct.getType()), allocator, null);
MapVector mapVector = new MapVector(Field.nullable("map", structVector.getField().getType()), allocator, null);
mapVector.initializeChildrenFromFields(Collections.singletonList(struct));
mapVector.allocateNew();
UnionMapWriter writer = mapVector.getWriter();
for (int i = 0; i < 10; i++) {
writer.startMap();
writer.setPosition(i);
writer.key().writeInt(i);
writer.value().writeInt(i * 10);
writer.endMap();
}
writer.setValueCount(10);
when the types of key and value are different, data cannot be written .
Only examples of ListVector are available in the documentation on the official website ,Please provide an example of writing data to MapVector.
- 主要語言
- Java
- 星號
- 95
- 分支
- 154
- 平均合併
- 2 天 10 小時
- 30 天內合併 PR
- 11
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/arrow-java 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 74/100
apache/arrow-java#1261 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1236 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/arrow-java#1230 ·
-
Type: bug
難度 2/5 1-3 小時 新手友好度 85/100
apache/arrow-java#1205 ·
-
Type: bug
難度 2/5 1-3 小時 新手友好度 68/100
apache/arrow-java#1196 · 1 則留言 ·
查看 apache/arrow-java 的全部 Issue
相似的 Issue
-
documentation
難度 2/5 1-3 小時 新手友好度 65/100
inu-appcenter/memorIN-backend#288 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
-
frontend maui-pilot pilot-ask question
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
area/plugin
難度 2/5 1-3 小時 新手友好度 75/100
kestra-io/plugin-kestra#190 ·