Fallible constructor for nested_case_when
维护者通常 1 天内回复
评估
调研方向
构造函数是 vortex-array/src/expr/exprs.rs 中的 nested_case_when,它会对空的 when_then_pairs 进行断言,并在配对数量溢出 u32 时 panic。请阅读同一文件中现有的 bound_* 构造函数,复制其可失败的模式。添加返回 VortexResult<Expression> 的 try_nested_case_when,让 nested_case_when 通过 vortex_expect 调用它,然后为空输入和溢出情况添加测试。当两个非法输入都返回错误且现有调用方仍能通过时即完成。
由索引模型根据 Issue 内容生成。
描述
nested_case_when (vortex-array/src/expr/exprs.rs) panics on input a caller may not control:
- no WHEN/THEN pairs:
assert!(!when_then_pairs.is_empty(), ...); - more pairs than fit in
u32:vortex_panic!("nested_case_when has too many when/then pairs").
Callers that build a CASE from user or query input (for example a list of branches translated from SQL) have to repeat both checks before calling it, or wrap it to turn the panics into errors.
Proposal: add try_nested_case_when(when_then_pairs, else_value) -> VortexResult<Expression> that returns an error in both cases, and have nested_case_when call it and vortex_expect the result, as the bound_* constructors already do.
- 主要语言
- Rust
- 星标
- 3.2k
- 派生
- 239
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 684
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vortex-data/vortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
vortex-data/vortex#12633 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
vortex-data/vortex#12628 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
vortex-data/vortex#12491 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 67/100
vortex-data/vortex#12635 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
vortex-data/vortex#12634 ·
维护者通常 1 天内回复
查看 vortex-data/vortex 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
marklauter/tsong#110 ·
-
docs enhancement
难度 2/5 1-3 小时 新手友好度 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 条评论 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
marketing
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
area: engine bug needs milestone
难度 2/5 1-3 小时 新手友好度 70/100
Mudcrab-Team/mudcrab#1197 · 1 条评论 ·
维护者通常 1 天内回复