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

gcd benchmarks pass number_rows: 0 for 100k-row inputs

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

维护者通常 1 天内回复

@med9110 已经在做这个了。

开始于 2026年10月14日。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
92/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
performance

调研方向

从 datafusion/functions/benches/math_expressions/gcd.rs 开始,查看第 56、77 和 98 行附近 ScalarFunctionArgs 的构造,其中设置了 number_rows: 0。与 lcm.rs 第 55 行对比,那里传入的是 n_rows。完成标准是:数组基准测试传入 n_rows,标量-标量基准测试传入 1,expect 消息为 "gcd should work on valid values",并且 cargo bench --bench math_expressions(或 gcd 基准的过滤器)仍能运行。

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

描述

bug functions good first issue help wanted tech debt
Describe the bug

All three benchmarks in functions/benches/math_expressions/gcd.rs pass number_rows: 0 in ScalarFunctionArgs, including "gcd both array" and "gcd array and scalar", whose array inputs have 100,000 rows. The sibling lcm.rs benchmark passes number_rows: n_rows. A UDF that sizes its output or expands scalars from number_rows will not do the work the benchmark claims to measure.

Every gcd benchmark also uses the copy-pasted message .expect("date_bin should work on valid values").

To Reproduce

Read gcd.rs lines 56, 77 and 98 (number_rows: 0) and compare with lcm.rs line 55 (number_rows: n_rows).

Expected behavior
  • Pass number_rows: n_rows for the benchmarks with array inputs (and 1 for scalar-scalar).
  • Change the expect messages to "gcd should work on valid values".
Additional context

to_char.rs (L144-L341), gcd.rs and lcm.rs repeat the same bench_function + ScalarFunctionArgs boilerplate seven times, which is how this drift happened. A small shared helper that takes the UDF, args, number_rows and return type would prevent it. That part is optional.

This is a small, self-contained change and a good first issue. Line references are pinned to commit 0d79252f61bd.

主要语言
Rust
星标
9.5k
派生
2.5k
平均合并
4 天 19 小时
30 天内合并 PR
342

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

apache/datafusion 的其他 Issue

查看 apache/datafusion 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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