Subodh-17 opened a new pull request, #26465:
URL: https://github.com/apache/datafusion/pull/26465
## Which issue does this PR close?
Closes #26297
## Rationale for this change
In `datafusion/functions/benches/math_expressions/gcd.rs`, all three Int64
benchmarks passed `number_rows: 0` in `ScalarFunctionArgs`, including the
100,000-row array benchmarks (`gcd both array` and `gcd array and scalar`). In
addition, all three benchmarks used copy-pasted assertion failure messages
referencing `date_bin` (`.expect("date_bin should work on valid values")`).
While the current Int64 evaluation path delegates directly to Arrow kernels
using array lengths, passing `number_rows: 0` violates the `ScalarFunctionArgs`
contract ("The number of rows in record batch being evaluated") and creates a
silent failure hazard if UDF scalar expansion or common wrappers rely on
`number_rows`.
## What changes are included in this PR?
- Pass the actual row count (`number_rows: n_rows`) to `ScalarFunctionArgs`
for array/array and array/scalar GCD benchmark cases.
- Pass 1 (`number_rows: 1`) for the scalar/scalar case.
- Correct copied assertion messages from `date_bin` to `gcd`.
## What is the testing strategy for this PR?
Validation:
- `rustfmt --check datafusion/functions/benches/math_expressions/gcd.rs` —
passed.
- `cargo check -p datafusion-functions --benches` — passed in WSL.
- `cargo clippy -p datafusion-functions --benches` — passed in WSL.
- `git diff --check` — passed.
Benchmark runtime execution was not verified because the previous attempt
encountered a WSL/NTFS permission error.
## Are there any user-facing changes?
No. This only corrects benchmark metadata and assertion messages.
--
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]