trunc(x) on a column turns -0.0 into 0.0
维护者通常 1 天内回复
评估
调研方向
在 DataFusion 代码库中查找 trunc 函数的实现,可能在 expr/scalar.rs 或 expr/builtin.rs 等文件中。错误出现在使用 x == 0_f64 的列路径中。将该条件替换为保留符号的检查,或许可以直接使用 x.trunc()。在相应的测试模块中编写测试,以验证 trunc(-0.0) 对于列返回 -0.0。运行现有的 SQL 函数测试以确保没有回归。
由索引模型根据 Issue 内容生成。
描述
trunc(x) drops the sign of -0.0, but only when it runs on a column. On a scalar, and for trunc(x, 0), the sign is kept.
SELECT trunc(column1), trunc(column1, 0) FROM (VALUES (CAST(-0.0 AS DOUBLE)));
-- got: 0.0, -0.0
-- expected: -0.0, -0.0
The column code path returns 0.0 for either zero:
if x == 0_f64 { 0_f64 } else { x.trunc() }
-0.0 == 0.0 is true, so -0.0 becomes 0.0. f64::trunc already keeps the sign, so plain x.trunc() would be enough.
Seen through Lance (pylance 12.0.0): trunc(x, 0) on a -0.0 column returns -0.0. This line is the same on main and in 55.1.0. I found no existing issue or PR for it.
- 主要语言
- Rust
- 星标
- 9.4k
- 派生
- 2.5k
- 平均合并
- 4 天 5 小时
- 30 天内合并 PR
- 331
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion#26259 ·
维护者通常 1 天内回复
-
`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"可能已有人在做 @RishavTiwari25 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
apache/datafusion#26243 ·
维护者通常 1 天内回复
-
array_min / array_max fail on a zero-row batch for non-primitive element types可能已有人在做 @linuxpi 于 7 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
apache/datafusion#26072 ·
维护者通常 1 天内回复
-
BaselineMetrics output_bytes converts every column to ArrayData for every batch可能已有人在做 @minhh-nguyen 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#26071 · 1 条评论 ·
维护者通常 1 天内回复
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs release可能已有人在做 @isabellehuangg 于 8 天前认领。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion#26030 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 apache/datafusion 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
scanaislop/aislop#482 ·
维护者通常 1 天内回复
-
docs(skills): issue-first should reference an existing Linear ticket instead of filing a duplicate未关闭documentation
难度 1/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复