Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Deduplicate spark_ceil and spark_floor and port floor's decimal boundary tests to ceil

未关闭 适合新手
#6,974 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
半天
新手友好度
68/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

从 native/spark-expr/src/math_funcs/floor.rs 中的边界测试 test_floor_decimal128_i64_boundary_array 和 test_floor_decimal128_large_scale_array 开始,并与缺少这些测试的 ceil.rs 进行比较。将两个测试移植到 ceil.rs 中,针对 decimal_ceil_pow10 进行验证,同时保持预期值针对 ceil 的特定性。当移植后的测试在 native/spark-expr 中通过 cargo test 时即完成。第二步中的共享模块重构属于设计工作,应交由维护者处理。

由索引模型根据 Issue 内容生成。

描述

area:expressions enhancement help wanted requires-triage rust tech debt
What is the problem the feature request solves?

native/spark-expr/src/math_funcs/ceil.rs and floor.rs are the same module with ceil/floor and div_ceil/div_floor swapped. The spark_* dispatch, decimal_*_f, decimal_*_pow10::<EXP> with its i64 fast path, and the cold *_wide fallback are identical, as are the first seven tests.

The copies have already diverged in their tests. floor.rs has test_floor_decimal128_i64_boundary_array and test_floor_decimal128_large_scale_array, which exercise the i64/i128 switch and the runtime fallback. ceil.rs has neither, even though decimal_ceil_pow10 has the same boundary logic. Any future fix to the fast path has to be made twice, and today only floor's version is tested at the boundary.

Describe the potential solution
  1. Port floor's boundary and large-scale tests to ceil. This is the quick win and could land on its own.
  2. Move the shared decimal rounding into math_funcs/utils.rs, generic over a rounding mode (e.g. a trait with Ceil/Floor marker types providing the i64 and i128 division), and make spark_ceil/spark_floor thin wrappers over one generic function. Parameterise the tests by mode.
Additional context

Line references are pinned to commit 7d8d9b1544b7.

主要语言
Scala
星标
1.3k
派生
387
平均合并
2 天 8 小时
30 天内合并 PR
422

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion-comet 的其他 Issue

查看 apache/datafusion-comet 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。