Tracking Issue: Implement `ListPack` in V2 Scan Engine
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 8/100
Hướng nghiên cứu
This is a design tracking issue, not a bounded task. Start by reading the existing ListReader in the V1 scan path and comparing it with the planned ListPack port for the V2 scan engine. The issue leaves open whether to use an element-domain index in layout metadata or runtime plan compilation, so the design must be settled first. Done means ListLayout reads on V2 with no regression against V1 on the PolarSignals and Statpopgen benchmarks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a tracking issue for implementing ListPack in the V2 Scan engine, which allows for reading from ListLayout.
Motivation
Currently the V2 Scan engine cannot read from ListLayout. Benchmarks that use V2 Scan do not have ListLayout enabled in the edition they use. Benchmarks that write and read ListLayout, including PolarSignals and Statpopgen, use the v1 scan engine.
The goal is to move these two onto the V2 scan with no regression against V1.
Problem
There is no straightforward port of ListReader to ListPack, because reading the elements child is currently dependent on first reading the offsets child to determine the corresponding row range in the elements row domain.
Handed a row range that covers the entire list and an all-true mask, ListReader will fetch the offsets and elements in parallel. In general though, the requested row range is narrower than the length of the layout and/or the mask filters out some lists. A scans splits are typically narrower than the layout even when nothing is filtered. This is the case ListLayout, which shreds offsets and elements into children with separate layouts, was designed for. A sparse or bounded read only fetches the subset of the elements child it needs, and skips IO and compute over elements it doesn't need.
For such a read,ListReader first fetches and decodes the offsets child, indexes into them to find the element ranges it needs, and only asks the element reader for those rows (with the mask expanded to element row domain).
This costs a sequential read (or potentially several, for deeply nested lists), but the benchmarks show that this cost is offset by the IO/compute savings. A potential optimization that has been discussed is adding an index for the outer row domain (offsets) -> inner row domain (elements) mapping, stored as metadata in either the list layout metadata or in another segment near the footer. This would allow fetching offsets and elements in parallel, at the cost of overreading elements and larger file size.
The main issue with integrating the current system into the Scan V2 engine is that planning happens before execution. It is not currently possible to plan the offsets read, read the offsets data, and then plan and execute the list elements read. Plans must be compiled statically during the filter or projection phase with a row range and corresponding mask, so the row range of one compiled plan cannot be determined by reading the data fetched by another plan.
Design
There are two proposed approaches to adding support for reading ListLayout. They are not mutually exclusive.
Element Domain Index
Record the (outer) row index of each stride-th element row in layout metadata (or in another segment near the footer). The indices can be heavily compressed (perhaps with delta + bitpack) since they are monotonically increasing. Since metadata is read at planning time, we can translate the (outer) row domain into element domain without reading the offsets.
This also has the benefit of removing the sequential dependency between offsets and elements, which leads to multiple rounds of IO for nested lists (and worse coalescing). There would be one round of IO regardless of nesting depth.
However, the index may also bloat footer size and will always lead to overreading element rows (but this is bounded up to stride - 1 elements). Nested lists will compound the latter problem.
Allow Plan Compilation during Runtime
This mirrors what is currently done in ListReader.
A running source queues a compile over rows it computed. The scan carries it out after that run, into ordinary pipelines writing a new inlet of the source, so only the scan rewires the graph and only between runs; the new pipelines share its scheduler, reads and value cache. A compile selecting nothing yields a closed inlet and wakes the source.
ListPack::compile compiles the offsets and validity of the selected lists and joins them with a ListSource. Once both inlets close, the source computes the element ranges of the selected non-null lists from the stored offsets, merges adjacent ranges, builds a mask over first..last element, and calls cx.compile(elements, range, mask). When that inlet closes it joins the elements and emits the lists. This would cost one extra round of IO per nesting level.
Steps
Unresolved questions
Implementation history
- 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vortex-data/vortex
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
vortex-data/vortex#12633 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
vortex-data/vortex#12628 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
vortex-data/vortex#12491 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fallible constructor for nested_case_whenCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vortex-data/vortex#11425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
vortex-data/vortex#12635 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vortex-data/vortex
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
marklauter/tsong#110 ·
-
docs enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: engine bug needs milestone
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Mudcrab-Team/mudcrab#1197 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày