List and VarBin constructors decode compressed offsets twice

Đang mở
#11,796 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Rust
Star
3.2k
Fork
239
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
684

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vortex-data/vortex

Tất cả issue của vortex-data/vortex

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.