Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Java] MapVector written data does not meet expectations

Đang mở
#40 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
data

Hướng nghiên cứu

Tái hiện đoạn mã Java được cung cấp bằng MapVector và UnionMapWriter, sau đó kiểm tra đường dẫn ghi của MapVector và UnionMapWriter để xem cách xử lý các kiểu khóa và giá trị khác nhau. So sánh với ví dụ tài liệu ListVector hiện có và xác định việc hoàn thành là ghi MapVector với các kiểu hỗn hợp thành công hoặc một ví dụ MapVector hoạt động được và đã được tài liệu hóa, có kiểm thử hồi quy hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Component: Documentation
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.

image

Ngôn ngữ chính
Java
Star
95
Fork
154
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
11

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/arrow-java

Tất cả issue của apache/arrow-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.