lifulong commented on code in PR #52701:
URL: https://github.com/apache/spark/pull/52701#discussion_r2537009206


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala:
##########
@@ -267,35 +263,40 @@ object ApproximatePercentile {
   // The default relative error can be deduced by defaultError = 1.0 / 
DEFAULT_PERCENTILE_ACCURACY
   val DEFAULT_PERCENTILE_ACCURACY: Int = 10000
 
+  def nextPowOf2(relativeError: Double): Int = {
+    val baseK = DoublesSketch.getKFromEpsilon(relativeError, true)
+    if (baseK == 1 || (baseK & (baseK - 1)) == 0) {

Review Comment:
   yes, the min baseK value is 2, remove the baseK value check logic



-- 
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