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 2022/02/08 08:49:50 UTC

[GitHub] [iceberg] rymurr commented on a change in pull request #3697: API: Add Immutables to FileScanTask's subclasses

rymurr commented on a change in pull request #3697:
URL: https://github.com/apache/iceberg/pull/3697#discussion_r801388540



##########
File path: core/src/main/java/org/apache/iceberg/BaseFileScanTask.java
##########
@@ -20,71 +20,69 @@
 package org.apache.iceberg;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
+import javax.annotation.Nullable;
 import org.apache.iceberg.expressions.Expression;
 import org.apache.iceberg.expressions.ResidualEvaluator;
 import org.apache.iceberg.relocated.com.google.common.annotations.VisibleForTesting;
 import org.apache.iceberg.relocated.com.google.common.base.MoreObjects;
 import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
-
-class BaseFileScanTask implements FileScanTask {
-  private final DataFile file;
-  private final DeleteFile[] deletes;
-  private final String schemaString;
-  private final String specString;
-  private final ResidualEvaluator residuals;
-
-  private transient PartitionSpec spec = null;
-
-  BaseFileScanTask(DataFile file, DeleteFile[] deletes, String schemaString, String specString,
-                   ResidualEvaluator residuals) {
-    this.file = file;
-    this.deletes = deletes != null ? deletes : new DeleteFile[0];
-    this.schemaString = schemaString;
-    this.specString = specString;
-    this.residuals = residuals;
+import org.immutables.value.Value;
+
+@Value.Immutable
+abstract class BaseFileScanTask implements FileScanTask {

Review comment:
       Not sure that I agree that 'serializing everything as a JSON string' is the right way forward. Nor do I think that we should forgo making our code safer, cleaner and easier to use because an engine cant _directly_ handle it.
   
   As @nastra pointed out this annotation generates the annotations and objects that Trino needs to serialize (namely `@JsonCreator` and `@JsonProperty`.




-- 
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: issues-unsubscribe@iceberg.apache.org

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