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


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentileSuite.scala:
##########
@@ -426,12 +426,18 @@ class ApproximatePercentileSuite extends SparkFunSuite {
   }
 
   private def compareEquals(left: PercentileDigest, right: PercentileDigest): 
Boolean = {
-    val leftSummary = left.quantileSummaries
-    val rightSummary = right.quantileSummaries
-    leftSummary.compressThreshold == rightSummary.compressThreshold &&
-      leftSummary.relativeError == rightSummary.relativeError &&
-      leftSummary.count == rightSummary.count &&
-      leftSummary.sampled.sameElements(rightSummary.sampled)
+    val leftSketch = left.sketchInfo
+    val rightSketch = right.sketchInfo
+    if (leftSketch.isEmpty && rightSketch.isEmpty) {
+      true
+    } else if (leftSketch.isEmpty || rightSketch.isEmpty) {
+      false
+    } else {
+      leftSketch.getK == rightSketch.getK &&
+        leftSketch.getMaxItem == rightSketch.getMaxItem &&
+        leftSketch.getMinItem == rightSketch.getMinItem &&
+        leftSketch.getN == rightSketch.getN

Review Comment:
   there is no get content api, update with check sketch serialize result



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