You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] GetSchema labels its null check on each schema field as "DictionaryEncoding.indexType" #51780
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.
Activity
GH-51780: [C++][IPC] Remove the mislabeled null check on schema field…
pitrou commentedon Oct 7, 2026
Closed by #51811
pitrou commentedon Oct 7, 2026
@CaptainAni187 Can you post here so that we can assign this issue to you?