Offset overflow - Native Parquet scan expands flat dictionary columns and reads twice Spark's batch rows
Maintainer thường phản hồi trong vòng 2 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
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- data-engineering, performance
Hướng nghiên cứu
Start with the native Parquet scan and the arrow-rs byte-array decoding paths described in the issue, including the DELTA_LENGTH_BYTE_ARRAY decoder. Reproduce the overflow with a flat dictionary-encoded string column and a small injected byte budget, then compare native scan results with Spark's reader. Done means byte-bounded batching or dictionary handling prevents overflow while preserving the expected rows; the issue also calls out matching Spark's default batch size and an upstream decoder panic fix.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of #7267.
Problem
Two things make the native Parquet scan, and the native Iceberg scan that uses the same arrow-rs reader, overflow a string or binary column where Spark's reader does not.
Flat dictionary-encoded columns are expanded per batch. Comet asks arrow-rs for plain Utf8/Binary, so the reader copies a dictionary value into the batch once per row that references it (extend_from_dictionary, parquet 59.3.2 src/arrow/buffer/offset_buffer.rs:92-118). A column with a few wide distinct values is stored as a small dictionary page plus tiny keys, and can still expand past 2 GiB in one 8192-row batch: one 300 KB value repeated 8192 times is 2.4 GB. The scan fails with index overflow decoding byte array. Spark's vectorized reader keeps the dictionary ids and decodes a value only when a row reads it, so it succeeds. #7254 covers the nested case; flat columns overflow inside arrow-rs instead.
Twice the rows per batch. Comet reads spark.comet.batchSize rows per batch, 8192 by default. Spark's vectorized Parquet reader reads spark.sql.parquet.columnarReaderBatchSize rows (4096), and Iceberg's Java reader 5000. With values of 256-512 KiB in row groups large enough to fill a batch (large row-group sizes or highly compressible values), Comet's batch passes 2 GiB and Spark's does not.
The DELTA_LENGTH_BYTE_ARRAY decoder panics instead of returning that error (parquet 59.3.2 src/arrow/array_reader/byte_array.rs:514).
The epic lists the scan as honoring the batch size. It does, but in both cases the batch size alone doesn't bound the bytes.
Workaround
Lower spark.comet.batchSize.
Proposed fix
- Keep dictionary-encoded byte columns as dictionaries out of the reader and unpack them after the scan in row ranges bounded by bytes, or cap scan batches by bytes.
- At least, default the native scan's batch size to Spark's reader batch size.
- Upstream: return an error from the DELTA_LENGTH_BYTE_ARRAY decoder instead of panicking.
Tests
A Parquet file with a flat dictionary-encoded string column, one 300 KB value repeated 8192 times, stays tiny on disk. Reading it with the native scan and comparing with Spark shows the problem, but needs about 2.5 GB of memory, so test the byte-bounded batching with a small budget injected for the test.
- Ngôn ngữ chính
- Scala
- Star
- 1.3k
- Fork
- 414
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 210
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 apache/datafusion-comet
-
requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion-comet#7583 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug priority:medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
apache/datafusion-comet#7559 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:writer bug priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7558 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7557 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`rand` and `randn` with an integer seed fall back to Spark without a fallback reasonCó thể đã có người làm @galaxytemple đã nhận 3 ngày trước. Đang mởrequires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7479 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/datafusion-comet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
chipsalliance/rocket-chip#3845 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 13 ngày
-
gesticulate: the `FastInfoset` suffix is written `fast-infoset`, not the registered `fastinfoset`Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
propensive/soundness#2437 ·
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 72/100
ergoplatform/ergo#2918 ·
Maintainer thường phản hồi trong vòng 3 ngày