Offset overflow - Explode copies columns past 2 GiB and never splits one long row
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start in native/operators/src/explode.rs, especially next_chunk_rows at lines 320–342 and repeat_arrs_from_indices at lines 1291–1305; trace how output_lens feeds chunk sizing and take allocation. Add coverage using a small injected byte budget, including a single long-array row split across batches, and verify all output values and copied columns.
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
ExplodeExec copies every column that is not exploded once per array element, with take (repeat_arrs_from_indices, native/operators/src/explode.rs:1291-1305). It decides how many input rows to unnest at a time by output row count only (next_chunk_rows, :320-342), and it never splits one input row: a row whose array is longer than the batch size is built in one go and sliced afterwards.
So the copied columns can pass 2 GiB even when the input is small. In SELECT payload, explode(items) FROM t, rows with a 300 KB payload and 900 elements each are unnested nine at a time, so each chunk is 8,100 output rows holding 2.4 GB of payload. One row with a 1 MiB payload and a 2,100-element array overflows on its own, at any batch size. The query fails with Arrow error: Offset overflow error: 2147483648. Spark's GenerateExec produces one row at a time and succeeds.
The epic lists explode as honoring the batch size. It does for rows, but the copying makes each output row as large as its input row, so bytes per batch are not bounded.
A unit test on the one-row case fails with Offset overflow error: 2147483648 at batch_size=8192 and at batch_size=1024.
Line references are for main at 4e6b12290f.
Workaround
Lowering spark.comet.batchSize helps when many input rows share a chunk, but not for one row with a long array. spark.comet.exec.explode.enabled=false runs explode in Spark.
Proposed fix
- When picking the next chunk, also bound the predicted output bytes: for each copied variable-width column, sum the value length times the row's output length (
output_lensalready holds the second factor) over the chunk's rows. - Let one input row be split across several output batches, by taking ranges of its repeated indices instead of the whole row at once.
Tests
take computes the output size before it allocates, so the one-row case above fails in milliseconds today. After the fix, test the chunking with a small byte budget injected for the test, and check that one row with a long array comes out in several batches with the right values.
- 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ự
-
A-api C-bug S-ready-for-human
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ergoplatform/ergo#2932 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lichess-org/lila#22454 ·
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 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