tarekakrout2021 opened a new pull request, #22344:
URL: https://github.com/apache/datafusion/pull/22344
## Which issue does this PR close?
- Closes #22269.
## Rationale for this change
round(float8) should match PostgreSQL half-tie behavior (banker's rounding /
round-half-to-even).
## What changes are included in this PR?
- Changed round_float() to use round-half-to-even (ties-to-even) for the
zero-decimal / single-argument case only
- The two-argument form is intentionally unchanged, as PostgreSQL does not
support round(double precision, int) — that form operates on numeric types
- Added regression tests for f32 and f64 with canonical half-tie values
(2.5, 3.5, -2.5, -3.5)
- Updated scalar.slt expected output to reflect the corrected behavior
## Are these changes tested?
Ran:
`cargo test --package datafusion-functions round`
and
```
cargo test -p datafusion --test parquet_integration
cargo test --profile=ci --test sqllogictests
```
## Are there any user-facing changes?
Yes — round(x) where x is a float and x is a half-tie value (e.g. 0.5, 1.5,
2.5)
will now return a different result. This is a correctness fix to match
PostgreSQL behavior.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
To run the CI : @kumarUjjawal
--
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]