aokolnychyi commented on code in PR #8346:
URL: https://github.com/apache/iceberg/pull/8346#discussion_r1298962978
##########
api/src/main/java/org/apache/iceberg/BaseScanTaskGroup.java:
##########
@@ -48,20 +54,59 @@ public StructLike groupingKey() {
@Override
@SuppressWarnings("unchecked")
public Collection<T> tasks() {
- if (taskList == null) {
+ if (taskCollection == null) {
synchronized (this) {
- if (taskList == null) {
+ if (taskCollection == null) {
ImmutableList.Builder<T> listBuilder =
ImmutableList.builderWithExpectedSize(tasks.length);
for (Object task : tasks) {
listBuilder.add((T) task);
}
- taskList = listBuilder.build();
+ this.taskCollection = listBuilder.build();
}
}
}
- return taskList;
+ return taskCollection;
+ }
+
+ @Override
+ public long sizeBytes() {
+ if (sizeBytes == Long.MIN_VALUE) {
+ long size = 0L;
+ for (Object task : tasks) {
+ size += ((ScanTask) task).sizeBytes();
+ }
+ this.sizeBytes = size;
+ }
+
+ return sizeBytes;
+ }
+
+ @Override
+ public long estimatedRowsCount() {
Review Comment:
I decided to drop the caching step for now. We can add it later.
--
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]