[C++] GetSchema labels its null check on each schema field as "DictionaryEncoding.indexType"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Mở cpp/src/arrow/ipc/metadata_internal.cc quanh vòng lặp GetSchema (các dòng được liên kết ~1450–1457). CHECK_FLATBUFFERS_NOT_NULL trên mỗi field dùng nhãn DictionaryEncoding.indexType; hoặc bỏ kiểm tra đó (như comment gần đó gợi ý) hoặc gắn lại nhãn thành thứ gì đó như Schema.fields[i]. Kiểm tra DictionaryEncoding.indexType thực sự vẫn ở ~901. Xong khi vòng lặp đó không còn báo sai tên field.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[!NOTE]
I discovered this issue and wrote it up with help from Claude Opus 5.5.
Describe the enhancement requested
In GetSchema in cpp/src/arrow/ipc/metadata_internal.cc, the loop over a schema's fields checks each field for null with the wrong label:
for (int i = 0; i < num_fields; ++i) {
const flatbuf::Field* field = schema->fields()->Get(i);
// XXX I don't think this check is necessary (AP)
CHECK_FLATBUFFERS_NOT_NULL(field, "DictionaryEncoding.indexType");
RETURN_NOT_OK(
FieldFromFlatbuffer(field, field_pos.child(i), dictionary_memo, &fields[i]));
}
The value being checked is a Field, not DictionaryEncoding.indexType. If the check ever failed, it would report Unexpected null field DictionaryEncoding.indexType in flatbuffer-encoded metadata. That message already belongs to the real check on dictionary index types at line 901, so the two errors would be indistinguishable.
As the comment beside it suggests, the check also appears unable to fail. For a vector of tables, the vendored flatbuffers IndirectHelper<Offset<T>>::Read returns the element's address plus its stored offset, so fields()->Get(i) doesn't return null. The function already checks schema->fields() itself for null, with the correct label Schema.fields.
Either option would fix it:
- Remove the check, as the comment suggests.
- Keep it with an accurate label, such as
"Schema.fields[i]".
I found this while looking into how the reader handles a missing DictionaryEncoding.indexType, which is reported separately at #51779.
- Ngôn ngữ chính
- C++
- Star
- 17.2k
- Fork
- 4.3k
- Merge trung bình
- 4 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 101
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/arrow
-
Component: Ruby Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[C++][Python] IPC reader rejects a DictionaryEncoding without indexType, which the format allowsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởComponent: C++ Component: Python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Component: R Type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/arrow#51695 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[C++][Parquet] Plaintext-footer files written with AES_GCM_CTR_V1 record AES_GCM_V1 as the encryption algorithm and cannot be readCó thể đã có người làm @YusefSyed đã nhận 4 ngày trước. Đang mởType: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[R] Expose ignore_extra_columns and pad_short_rows CSV parse optionsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởComponent: R good-first-issue Type: enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug iOS 🍎 ui/ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MerginMaps/mobile#4744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kokkos/kokkos-kernels#3328 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs triage tcp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
project-chip/connectedhomeip#74644 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày