apache / apache/arrow-java

[Java] MapVector written data does not meet expectations

オープン
#40 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
Component: Documentation
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
11

説明

### What would you like help with?

```
RootAllocator allocator = new RootAllocator(Long.MAX_VALUE);
Map 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](https://arrow.apache.org/docs/java/vector.html#building-listvector) are available in the documentation on the official website ,Please provide an example of writing data to MapVector.

![image](https://github.com/user-attachments/assets/9d081d9a-6f0d-48c9-a4fd-a4ddaa26450b)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

提供された Java スニペットを MapVector と UnionMapWriter で再現し、その後、MapVector と UnionMapWriter の書き込みパスを調べて、異なるキー型と値型の扱いを確認します。利用可能な ListVector のドキュメント例と比較し、完了条件を、混在した型での MapVector の書き込みに成功すること、または回帰テストで裏付けられた、動作する MapVector の例を文書化することのいずれかと定義します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
data
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。