You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/10 01:06:47 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #9655: Fix wrong cardinality computation in BufferArrayGrouper

jihoonson commented on a change in pull request #9655: Fix wrong cardinality computation in BufferArrayGrouper
URL: https://github.com/apache/druid/pull/9655#discussion_r406555229
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/BufferArrayGrouper.java
 ##########
 @@ -69,12 +69,20 @@
   @Nullable
   private int[] vAggregationRows = null;
 
-  static long requiredBufferCapacity(
-      int cardinality,
-      AggregatorFactory[] aggregatorFactories
-  )
+  /**
+   * Computes required buffer capacity for a grouping key of the given cardinaltiy and aggregatorFactories.
+   * This method assumes that the given cardinality doesn't count nulls.
+   *
+   * Returns -1 if it cardinality + 1 (for null) = Integer.MAX_VALUE. Returns computed required buffer capacity
 
 Review comment:
   Oops, thanks!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org