List and VarBin constructors decode compressed offsets twice

Offen
#11,796 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
performance

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
239
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
684

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus vortex-data/vortex

Alle Issues in vortex-data/vortex

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.