zhengruifeng opened a new pull request, #58173: URL: https://github.com/apache/spark/pull/58173
### What changes were proposed in this pull request? Clamp the integer accuracy derived by `DataFrameStatFunctions.approxQuantile` to at least 1 when delegating to `approx_percentile`. ### Why are the changes needed? After SPARK-51816, `approxQuantile` computes `approx_percentile` accuracy from `relativeError` as `ceil(1.0 / relativeError)`. `Double.PositiveInfinity` is accepted by the existing non-negative relative-error check, but that formula produces accuracy 0, which is invalid for `approx_percentile`. Clamping to 1 keeps the coarsest valid approximation for this edge case. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added `Double.PositiveInfinity` to the existing `DataFrameStatSuite` coverage for `relativeError > 1`. Not run locally. -- 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]
