physical-plan: decoding an Unnest or Explain node with an unset field panics
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Bắt đầu từ datafusion/physical-plan/src/unnest.rs, trong UnnestExec::try_from_proto, nơi recursion.input_column và recursion.output_column đang được unwrap. Sau đó xem datafusion/physical-plan/src/explain.rs, trong stringified_plan_from_proto và ExplainExec::try_from_proto, nơi plan_type và plan_type_enum đang được unwrap. Hoàn thành khi cả hai đường đi đều trả về internal_err nêu tên trường bị thiếu, và có một test decode cho mỗi trường hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Two physical plan decoders in datafusion-physical-plan panic on a field the wire leaves unset. Their neighbours return an error in the same situation.
UnnestExec::try_from_proto unwraps both columns of each recursion option:
input_column: recursion.input_column.as_ref().unwrap().into(),
output_column: recursion.output_column.as_ref().unwrap().into(),
RecursionUnnestOption.input_column and .output_column are optional messages, so a peer can leave either one unset. A few lines earlier, the same function refuses a missing options with internal_datafusion_err!:
ExplainExec::try_from_proto maps each stringified plan through stringified_plan_from_proto. That function panics when plan_type, or its plan_type_enum, is unset:
ExplainExec::try_from_proto itself refuses a missing schema with an error:
The same code is in 55.1.0, at src/unnest.rs lines 473-474 and src/explain.rs lines 355-363.
To Reproduce
Decode a PhysicalPlanNode with datafusion_proto::bytes::physical_plan_from_bytes, where the node is one of:
- an
Explainnode with aschemaand oneStringifiedPlan::default()instringified_plans, soplan_typeisNone; - an
Unnestnode with a decodableinputandschema, andoptions.recursionsholding oneRecursionUnnestOption::default(), soinput_columnisNone.
Both reach the panic without any earlier check failing. I found these by reading the decode path and have not run these exact inputs here yet. I will add the panic output once a decode test on our side has run.
Expected behavior
Return internal_err! naming the missing field, as the sibling checks do. The caller then gets Err and keeps running.
Additional context
This matters wherever a process decodes plans it did not encode itself, such as a distributed worker that receives plan stages from peers. A malformed node panics the decoding task, and under panic = "abort" it stops the whole process. A related case in datafusion-proto is #26998.
The fix is two ok_or_else calls plus a decode test for each. I can open the PR if that is welcome.
- Ngôn ngữ chính
- Rust
- Star
- 9.6k
- Fork
- 2.6k
- Merge trung bình
- 3 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 331
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- 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
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/datafusion#27094 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlCó thể đã có người làm @jonasHanhan đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/datafusion#27059 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column statsCó thể đã có người làm @joseph-isaacs đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion#27050 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
datafusion-proto: decoding an AvroScan node without the avro feature panicsCó thể đã có người làm @geoHeil đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
apache/datafusion#26998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`repeat` on `LargeUtf8` aborts the process on a result size no allocation can satisfyCó thể đã có người làm @huong8373tt-beep đã nhận 2 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion#26948 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/datafusion
Issue tương tự
-
Windows docs: pin a tested ConPTY version for Kitty graphics; 1.25.260930003 corrupts large uploadsĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
raphamorim/rio#2021 ·
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 84/100
hydro-project/infinity#187 ·
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
near/near-sdk-rs#1676 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auto:producer auto:security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
fritzprix/libr-agent#2595 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:fs type:fix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Tripstack-Corp/spyc#1002 ·
Maintainer thường phản hồi trong vòng 1 ngày