Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[C++] GetSchema labels its null check on each schema field as "DictionaryEncoding.indexType"

Cerrado Apto para principiantes
#51,780 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp
Área
data

Línea de trabajo

Abre cpp/src/arrow/ipc/metadata_internal.cc alrededor del bucle GetSchema (las líneas enlazadas ~1450–1457). El CHECK_FLATBUFFERS_NOT_NULL en cada campo usa la etiqueta DictionaryEncoding.indexType; o bien elimina esa comprobación (como sugiere el comentario cercano) o relabélala a algo como Schema.fields[i]. La comprobación real de DictionaryEncoding.indexType permanece en ~901. Listo cuando ese bucle ya no informe el nombre de campo incorrecto.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Component: C++

[!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.

Lenguaje dominante
C++
Estrellas
17.2k
Forks
4.4k
Merge medio
4 d 1 h
PR fusionados (30 d)
87

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/arrow

Todos los issues de apache/arrow

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.