datafusion-proto: decoding an AvroScan node without the avro feature panics
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
Research direction
The panic is the #[cfg(not(feature = "avro"))] arm for AvroScan in datafusion/proto/src/physical_plan/mod.rs, around lines 1238-1247. Copy the ParquetScan arm just above it, which returns not_impl_err! for the same case. Done means decoding an AvroScan node with default features returns Err instead of panicking, which a new test built without the avro feature can check.
Written by the indexing model from the issue text.
Description
Describe the bug
datafusion-proto is built without avro by default, since its default features are ["parquet"]. In that build, PhysicalPlanNode::try_into_physical_plan panics on an AvroScan node:
#[cfg(not(feature = "avro"))]
panic!(
"Unable to process a Avro PhysicalPlan when `avro` feature is not enabled"
)
The ParquetScan arm just above it handles the same situation with not_impl_err!:
The same code is in 55.1.0, src/physical_plan/mod.rs, lines 1100-1108.
To Reproduce
Build datafusion-proto with default features, then decode a PhysicalPlanNode whose physical_plan_type is AvroScan(Default::default()):
let node = protobuf::PhysicalPlanNode {
physical_plan_type: Some(protobuf::physical_plan_node::PhysicalPlanType::AvroScan(Default::default())),
};
let _ = datafusion_proto::bytes::physical_plan_from_bytes(&node.encode_to_vec(), &ctx.task_ctx());
The arm is an unconditional panic!, so this panics before the node's contents are looked at.
Expected behavior
Return not_impl_err!, as the ParquetScan arm does, so a caller gets Err and keeps running.
Additional context
This matters wherever a process decodes plans it did not encode itself. One example is a distributed worker that receives plan stages from peers. A few bytes of input panic the decoding task, and under panic = "abort" they stop the whole process.
A fix is one line, plus a decode test with the feature off. I can open the PR if that is welcome.
- Dominant language
- Rust
- Stars
- 9.6k
- Forks
- 2.6k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 331
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/datafusion
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yamlOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/datafusion#27059 ·
Maintainers usually reply within 1 day
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column statsPossibly taken @joseph-isaacs claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion#27050 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/datafusion#26999 · 1 comment ·
Maintainers usually reply within 1 day
-
`repeat` on `LargeUtf8` aborts the process on a result size no allocation can satisfyPossibly taken @huong8373tt-beep claimed this 1 day ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion#26948 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug] atan2 does not normalize -0.0 the way Spark doesPossibly taken @galaxytemple claimed this 4 days ago. Openbug spark
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/datafusion#26333 ·
Maintainers usually reply within 1 day
All issues in apache/datafusion
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
riverqueue/river#1576 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
stadelmanma/fitparse-rs#64 ·