okumin commented on code in PR #5444:
URL: https://github.com/apache/hive/pull/5444#discussion_r1756959394


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/common/histogram/KllHistogramEstimator.java:
##########
@@ -30,11 +30,11 @@ public class KllHistogramEstimator {
   private final KllFloatsSketch kll;
 
   KllHistogramEstimator() {
-    this.kll = new KllFloatsSketch();
+    this.kll = KllFloatsSketch.newHeapInstance();

Review Comment:
   I verified the heap version is the right one at least from the point of 
compatibility.
   
https://github.com/apache/datasketches-java/commit/bc8fa6fa72b854983d946b74481cb5316b80f097



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/common/histogram/KllHistogramEstimator.java:
##########
@@ -30,11 +30,11 @@ public class KllHistogramEstimator {
   private final KllFloatsSketch kll;
 
   KllHistogramEstimator() {
-    this.kll = new KllFloatsSketch();
+    this.kll = KllFloatsSketch.newHeapInstance();

Review Comment:
   dataskatches-hive 2.0 can read the data written by 1.2?



##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/stats/FilterSelectivityEstimator.java:
##########
@@ -511,7 +511,7 @@ private static double rangedSelectivity(KllFloatsSketch 
kll, float val1, float v
    * @return the selectivity of a predicate "column > value" in the range 
[0, 1]
    */
   public static double greaterThanSelectivity(KllFloatsSketch kll, float 
value) {
-    float max = kll.getMaxValue();
+    float max = kll.getMaxItem();

Review Comment:
   Understood [getMaxValue -> 
getMaxQuantile](https://github.com/apache/datasketches-java/commit/83c11b73a77b5295b2e93582bee9ab70afc37c11#diff-255436ca709c4ad22450438c6b07cb84771cbb9694ebaec9b15ab201f8f03673),
 and then getMaxItem.
   
   [The current method throws an exception when the sketch is 
empty](https://github.com/apache/datasketches-java/pull/419). Is it OK? I guess 
it is ok.



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