rdblue commented on a change in pull request #1285:
URL: https://github.com/apache/iceberg/pull/1285#discussion_r464550504



##########
File path: core/src/main/java/org/apache/iceberg/BaseCombinedScanTask.java
##########
@@ -19,21 +19,22 @@
 
 package org.apache.iceberg;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import org.apache.iceberg.relocated.com.google.common.base.Joiner;
 import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
-import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
 
 public class BaseCombinedScanTask implements CombinedScanTask {
   private final List<FileScanTask> tasks;
 
   public BaseCombinedScanTask(FileScanTask... tasks) {
-    this.tasks = ImmutableList.copyOf(tasks);
+    this.tasks = Arrays.asList(tasks);
   }
 
   public BaseCombinedScanTask(List<FileScanTask> tasks) {
-    this.tasks = ImmutableList.copyOf(tasks);
+    this.tasks = copyList(tasks);

Review comment:
       What about a slightly different approach?
   
   Right now, the main problem is that `List` can't be easily serialized. But 
we know that `tasks` are `FileScanTask` and never changes, so we could use 
`private final FileScanTask[] tasks` instead, which has no problems with 
serialization.
   
   Then this would just need to copy into the array, 
`tasks.stream().toArray(FileScanTask[]::new)`, and we could update `files` to 
return `ImmutableList.copyOf(tasks)`.
   
   By making those changes, we still end up with an immutable list returned by 
`files`, but take care of the serialization issue and don't need to add 
`copyList`.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to