Window constructors panic when the expression list is empty
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 windows/window_agg_exec.rs 开始,阅读 WindowAggExec::try_new 和 BoundedWindowAggExec::try_new;Issue 指出其中对第一个表达式进行了未经检查的读取。为表达式列表为空的情况添加回归测试,并验证两个构造函数都会在推导模式或分区属性之前返回 DataFusionError::Plan。完成标准是:空列表的情况返回错误而不是触发 panic,同时非空计划保持原有行为。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
WindowAggExec::try_new and BoundedWindowAggExec::try_new index window_expr[0] when the list is empty. Both constructors return Result, but this input panics instead of returning an error.
The physical plan decoder reaches these constructors when a WindowAggExecNode contains a valid child and no window_expr entries. With panic = "abort", decoding that node stops the process.
To reproduce
use std::sync::Arc;
use arrow::datatypes::Schema;
use datafusion_physical_plan::empty::EmptyExec;
use datafusion_physical_plan::windows::{BoundedWindowAggExec, WindowAggExec};
use datafusion_physical_plan::InputOrderMode;
let input = Arc::new(EmptyExec::new(Arc::new(Schema::empty())));
WindowAggExec::try_new(vec![], input.clone(), false); // panics
BoundedWindowAggExec::try_new(vec![], input, InputOrderMode::Linear, false); // panics
The first panic was found in a peer-plan fuzz run using DataFusion 55.1.0: https://github.com/telekom/sutura/actions/runs/42873920210/job/130032073633
The unchanged input is 21 bytes, base64 ehMKBhoECgAQARoEEgKgARgUUIBA. The failure is index out of bounds: the len is 0 but the index is 0 in windows/window_agg_exec.rs. The current upstream source also has the unchecked first-element reads in both constructors; I have not run the reproducer on upstream main.
Expected behavior
Return DataFusionError::Plan when there is no window expression, before deriving the schema or partition properties. Nonempty window plans keep their current behavior.
Additional context
We are preparing a small vendored fix and worker-decode regression tests in sutura. This report is limited to the empty expression list. It does not establish that every malformed physical plan is refused.
AI assistance was used to investigate and draft this report.
- 主要语言
- Rust
- 星标
- 9.6k
- 派生
- 2.6k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 345
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion#27094 · 1 条评论 ·
维护者通常 1 天内回复
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml可能已有人在做 @jonasHanhan 于 9 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion#27059 ·
维护者通常 1 天内回复
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column stats可能已有人在做 @joseph-isaacs 于 9 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#27050 ·
维护者通常 1 天内回复
-
physical-plan: decoding an Unnest or Explain node with an unset field panics可能已有人在做 @geoHeil 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/datafusion#26999 · 1 条评论 ·
维护者通常 1 天内回复
-
datafusion-proto: decoding an AvroScan node without the avro feature panics可能已有人在做 @geoHeil 于 8 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
apache/datafusion#26998 ·
维护者通常 1 天内回复
查看 apache/datafusion 的全部 Issue
相似的 Issue
-
area:schema documentation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
ElectronicWave/Elemental#252 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
dekobon/big-code-analysis#1887 ·
维护者通常 1 天内回复
-
Shell中文符号输入异常未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复