priyen commented on code in PR #10926: URL: https://github.com/apache/pinot/pull/10926#discussion_r1275450645
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/aggregator/DistinctCountHLLValueAggregator.java: ########## @@ -28,11 +33,31 @@ public class DistinctCountHLLValueAggregator implements ValueAggregator<Object, HyperLogLog> { public static final DataType AGGREGATED_VALUE_TYPE = DataType.BYTES; - private static final int DEFAULT_LOG2M_BYTE_SIZE = 180; - + private int _log2m = CommonConstants.Helix.DEFAULT_HYPERLOGLOG_LOG2M; + private int _log2mByteSize = 180; // Byte size won't change once we get the initial aggregated value private int _maxByteSize; + public DistinctCountHLLValueAggregator() { + } + + public DistinctCountHLLValueAggregator(List<ExpressionContext> arguments) { + // length 1 means we use the default _log2m of 8 + if (arguments.size() <= 1) { + return; + } + + try { + String log2mLit = arguments.get(1).getLiteral().getStringValue(); + Preconditions.checkState(StringUtils.isNumeric(log2mLit), "log2m argument must be a numeric literal"); + + _log2m = Integer.parseInt(log2mLit); Review Comment: doesn't this remove the check if its numeric though? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org