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


##########
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorFactory.java:
##########
@@ -62,6 +63,31 @@ public abstract class HllSketchAggregatorFactory extends 
AggregatorFactory
   private final boolean shouldFinalize;
   private final boolean round;
 
+  HllSketchAggregatorFactory(
+      final String name,
+      final String fieldName,
+      @Nullable final Integer lgK,
+      @Nullable final String tgtHllType,
+      @Nullable final StringEncoding stringEncoding,
+      final Boolean shouldFinalize,
+      final boolean round,
+      final int maxLgK
+  )
+  {
+    this(name, fieldName, lgK, tgtHllType, stringEncoding, shouldFinalize, 
round);
+
+    if (this.lgK > maxLgK) {
+      throw DruidException.forPersona(DruidException.Persona.USER)
+                          .ofCategory(DruidException.Category.INVALID_INPUT)
+                          .build(
+                              "LgK value [%s] for HLL sketch cannot be greater 
than [%s]. Reduce the lgK value"

Review Comment:
   Added



##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDataSketchesTest.java:
##########
@@ -43,6 +44,9 @@
  */
 public class MSQDataSketchesTest extends MSQTestBase
 {
+
+  private static final SketchConfig SKETCH_CONFIG = new SketchConfig();

Review Comment:
   Added



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