andygrove opened a new issue, #26297:
URL: https://github.com/apache/datafusion/issues/26297

   ### Describe the bug
   
   All three benchmarks in 
[functions/benches/math_expressions/gcd.rs](https://github.com/apache/datafusion/blob/0d79252f61bd8777990b2749c216ffd07079c30d/datafusion/functions/benches/math_expressions/gcd.rs#L24-L105)
 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to