Skip to content

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

Closed

Description

@andygrove

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 0d79252.

Activity

  1. added
    bugSomething isn't working
    help wantedExtra attention is needed
    functionsChanges to functions implementation
    tech debtCode complexity, duplication or structure that makes the codebase harder to change
    on Oct 14, 2026
  2. med9110 commented on Oct 14, 2026

    @med9110

    Hi @andygrove, I'd like to work on #26297. I'll keep the change focused on correcting number_rows and the error messages in the GCD benchmarks, then validate the benchmark target. Would that scope be appropriate?

  3. added a commit that references this issue on Oct 19, 2026
    384d646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfunctionsChanges to functions implementationgood first issueGood for newcomershelp wantedExtra attention is neededtech debtCode complexity, duplication or structure that makes the codebase harder to change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions