rdblue commented on a change in pull request #119: Split files when planning
scan tasks
URL: https://github.com/apache/incubator-iceberg/pull/119#discussion_r263575435
##########
File path: core/src/main/java/com/netflix/iceberg/BaseFileScanTask.java
##########
@@ -66,6 +70,15 @@ public Expression residual() {
return residuals.residualFor(file.partition());
}
+ @Override
+ public Iterable<FileScanTask> split(long splitSize) {
+ if (file.format().isSplittable()) {
+ return () -> new SplitScanTaskIterator(splitSize, this);
+ } else {
+ return Lists.newArrayList(this);
Review comment:
I think it would be better to use `ImmutableList.of(this)`. It is good to
return immutable objects even though this probably won't be mutated. And that
`ImmutableList` can use an implementation that is more efficient than
`ArrayList` because it knows that there is only going to be one item.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]