adarshsanjeev commented on code in PR #12998:
URL: https://github.com/apache/druid/pull/12998#discussion_r969187970


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/statistics/DistinctKeyCollector.java:
##########
@@ -120,14 +121,16 @@ public void add(RowKey key, long weight)
       if (isNewMin && !retainedKeys.isEmpty() && 
!isKeySelected(retainedKeys.firstKey())) {
         // Old min should be kicked out.
         totalWeightUnadjusted -= 
retainedKeys.removeLong(retainedKeys.firstKey());
+        retainedBytes -= retainedKeys.firstKey().array().length;

Review Comment:
   Added



##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/statistics/QuantilesSketchKeyCollectorSnapshot.java:
##########
@@ -20,26 +20,35 @@
 package org.apache.druid.msq.statistics;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 import java.util.Objects;
 
 public class QuantilesSketchKeyCollectorSnapshot implements 
KeyCollectorSnapshot
 {
   private final String encodedSketch;
 
+  private final double averageKeyLength;
+
   @JsonCreator
-  public QuantilesSketchKeyCollectorSnapshot(String encodedSketch)
+  public QuantilesSketchKeyCollectorSnapshot(@JsonProperty("encodedSketch") 
String encodedSketch, @JsonProperty("averageKeyLength") double averageKeyLength)

Review Comment:
   Added tests



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