RussellSpitzer commented on code in PR #8346:
URL: https://github.com/apache/iceberg/pull/8346#discussion_r1302362902


##########
core/src/main/java/org/apache/iceberg/BaseCombinedScanTask.java:
##########
@@ -41,7 +42,38 @@ public BaseCombinedScanTask(List<FileScanTask> tasks) {
 
   @Override
   public Collection<FileScanTask> files() {
-    return ImmutableList.copyOf(tasks);
+    if (taskList == null) {
+      this.taskList = ImmutableList.copyOf(tasks);
+    }
+
+    return taskList;
+  }
+
+  @Override
+  public long sizeBytes() {
+    long sizeBytes = 0L;
+    for (FileScanTask task : tasks) {
+      sizeBytes += task.sizeBytes();
+    }
+    return sizeBytes;
+  }
+
+  @Override
+  public long estimatedRowsCount() {
+    long estimatedRowsCount = 0L;
+    for (FileScanTask task : tasks) {
+      estimatedRowsCount += task.estimatedRowsCount();
+    }
+    return estimatedRowsCount;
+  }
+
+  @Override
+  public int filesCount() {
+    int filesCount = 0;
+    for (FileScanTask task : tasks) {
+      filesCount += task.filesCount();

Review Comment:
   Same issue for bytes too right?



##########
core/src/main/java/org/apache/iceberg/BaseCombinedScanTask.java:
##########
@@ -41,7 +42,38 @@ public BaseCombinedScanTask(List<FileScanTask> tasks) {
 
   @Override
   public Collection<FileScanTask> files() {
-    return ImmutableList.copyOf(tasks);
+    if (taskList == null) {
+      this.taskList = ImmutableList.copyOf(tasks);
+    }
+
+    return taskList;
+  }
+
+  @Override
+  public long sizeBytes() {
+    long sizeBytes = 0L;
+    for (FileScanTask task : tasks) {
+      sizeBytes += task.sizeBytes();
+    }
+    return sizeBytes;
+  }
+
+  @Override
+  public long estimatedRowsCount() {
+    long estimatedRowsCount = 0L;
+    for (FileScanTask task : tasks) {
+      estimatedRowsCount += task.estimatedRowsCount();
+    }
+    return estimatedRowsCount;
+  }
+
+  @Override
+  public int filesCount() {
+    int filesCount = 0;
+    for (FileScanTask task : tasks) {
+      filesCount += task.filesCount();

Review Comment:
   This is counting delete files that may be read for multiple data files 
multiple times, is that ok?



-- 
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]

Reply via email to