Ma77Ball commented on code in PR #57241:
URL: https://github.com/apache/spark/pull/57241#discussion_r3584842882
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/percentiles.scala:
##########
@@ -224,7 +224,8 @@ abstract class PercentileBase
toDoubleValue(lowerKey)
} else {
// Linear interpolation to get the exact percentile
- (higher - position) * toDoubleValue(lowerKey) + (position - lower) *
toDoubleValue(higherKey)
+ toDoubleValue(lowerKey) +
+ (position - lower) * (toDoubleValue(higherKey) -
toDoubleValue(lowerKey))
Review Comment:
Hello @yadavay-amzn, thank you for the review. I've added a comment noting
the tradeoff so it's flagged if the overflow ever surfaces for values near
Double.MaxValue.
--
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]