You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/03/29 01:04:42 UTC
[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #8419: Avoid creation of max length result arrays
Jackie-Jiang commented on a change in pull request #8419:
URL: https://github.com/apache/pinot/pull/8419#discussion_r836966601
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ValueInTransformFunction.java
##########
@@ -118,10 +119,9 @@ public Dictionary getDictionary() {
_dictIdSet.add(dictId);
}
}
- _dictIds = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL][];
+ _dictIds = new int[length][];
Review comment:
We should have a separate check if this in case the buffer is not big enough. Same for other methods
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/ArrayAverageTransformFunction.java
##########
@@ -71,11 +70,12 @@ public TransformResultMetadata getResultMetadata() {
@Override
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) {
- if (_results == null) {
- _results = new double[DocIdSetPlanNode.MAX_DOC_PER_CALL];
+ int numDocs = projectionBlock.getNumDocs();
Review comment:
(minor) Consider using `length` everywhere for consistency
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org