[C++] GetSchema labels its null check on each schema field as "DictionaryEncoding.indexType"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Open cpp/src/arrow/ipc/metadata_internal.cc around the GetSchema loop (the linked lines ~1450–1457). The CHECK_FLATBUFFERS_NOT_NULL on each field uses the label DictionaryEncoding.indexType; either drop that check (as the nearby comment suggests) or relabel it to something like Schema.fields[i]. The real DictionaryEncoding.indexType check stays at ~901. Done when that loop no longer reports the wrong field name.
Written by the indexing model from the issue text.
Description
[!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.
- Dominant language
- C++
- Stars
- 17.2k
- Forks
- 4.3k
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 101
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow
-
[Ruby] Wrong data pointer in MemoryView of a sliced arrayPossibly taken A pull request linked to this issue is open or already merged. OpenComponent: Ruby Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
[C++][Python] IPC reader rejects a DictionaryEncoding without indexType, which the format allowsPossibly taken A pull request linked to this issue is open or already merged. OpenComponent: C++ Component: Python
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Component: R Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/arrow#51695 · 1 comment ·
Maintainers usually reply within 1 day
-
[C++][Parquet] Plaintext-footer files written with AES_GCM_CTR_V1 record AES_GCM_V1 as the encryption algorithm and cannot be readPossibly taken @YusefSyed claimed this 5 days ago. OpenType: bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
[R] Expose ignore_extra_columns and pad_short_rows CSV parse optionsPossibly taken A pull request linked to this issue is open or already merged. OpenComponent: R good-first-issue Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
flashinfer-ai/flashinfer#6212 ·
Maintainers usually reply within 1 day
-
bug graphics
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
FlaxEngine/FlaxEngine#4295 · 2 comments ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Algorithmiq/monoprop#390 ·
Maintainers usually reply within 1 day
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
8-membered-ring atrop stereo lost in 2026.09.1Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 Half a day Newbie friendliness 86/100
Maintainers usually reply within 2 days