You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/04 02:09:46 UTC

[GitHub] [iceberg] HeartSaVioR commented on a change in pull request #1285: Core: fix serialization issue in BaseCombinedScanTask with Kyro (No refactor)

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



##########
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:
       Ah OK that also makes sense - I realized we'd probably want to make sure `tasks` cannot be modified but `files()` opens it for modification outside of this class.
   
   I simply thought about defining `tasks` as `ArrayList<FileScanTask>` which also ensures no problem with serialization, but the efforts would be similar (had to make change on constructors and `files()`) so either is fine for me. I'll go through changing it to array first. Thanks!




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org