List and VarBin constructors decode compressed offsets twice

Abierto
#11,796 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
performance

Línea de trabajo

Start with ListData::validate and VarBinData::validate_utf8, where the offsets are decoded during construction and the decoded copy is dropped. Then read list_view_from_list in listview/conversion.rs and the canonical path in varbin/vtable/canonical.rs, which decode the offsets again. Done when a compressed-offset List or VarBin array decodes its offsets at most once between construction and canonicalization, and the existing tests still pass.

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

Descripción

Follow-up to #11222.

ListArray and VarBinArray, both Utf8 and Binary, decode their offsets to a PrimitiveArray when they are built, to check that the offsets are valid. They keep the original offsets and drop the decoded copy. When the array is canonicalized later, the offsets are decoded again: by list_view_from_list in listview/conversion.rs for List, and in varbin/vtable/canonical.rs for VarBin. So a List or VarBin array whose offsets are compressed, for example one read from a file, decodes its offsets twice.

Utf8 VarBin already did this before #11222: VarBinData::validate_utf8 decodes the offsets to check UTF-8 boundaries (see its TODO(joe)). #11222 adds the same pattern for List and Binary VarBin, with its own TODO in ListData::validate.

I have not measured the cost. It is one extra decode of len + 1 integers per array.

Expected: for List, Utf8 VarBin and Binary VarBin, the offsets are decoded at most once between construction and canonicalization.

🤖 Generated with Claude Code

Lenguaje dominante
Rust
Estrellas
3.2k
Forks
239
Merge medio
1 d 4 h
PR fusionados (30 d)
684

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 vortex-data/vortex

Todos los issues de vortex-data/vortex

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.