rdblue commented on a change in pull request #3689:
URL: https://github.com/apache/iceberg/pull/3689#discussion_r767312515
##########
File path: core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
##########
@@ -117,7 +117,7 @@ public String toString() {
this.offsets = ImmutableList.copyOf(offsetList);
this.parentScanTask = parentScanTask;
this.targetSplitSize = targetSplitSize;
- this.splitSizes = new ArrayList<>(offsets.size());
+ this.splitSizes = Lists.newArrayListWithCapacity(offsets.size());
Review comment:
The recommendation is to "choose your desired amount explicitly". If you
know that there are going to be less than or equal to the requested number of
elements, then `WithCapacity` is fine. Otherwise, you'd need to add some
additional space. Rather than coming up with a heuristic for the additional
space, let's just use `WithExpectedSize`.
--
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]