rdblue commented on code in PR #8803:
URL: https://github.com/apache/iceberg/pull/8803#discussion_r1375315072


##########
core/src/main/java/org/apache/iceberg/GenericDataFile.java:
##########
@@ -66,23 +68,31 @@ class GenericDataFile extends BaseFile<DataFile> implements 
DataFile {
    * Copy constructor.
    *
    * @param toCopy a generic data file to copy.
-   * @param fullCopy whether to copy all fields or to drop column-level stats
+   * @param copyStats whether to copy all fields or to drop column-level stats.
+   * @param columnsToKeepStats a set of column ids to keep stats. If empty or 
<code>null</code> then
+   *     every column stat is kept.
    */
-  private GenericDataFile(GenericDataFile toCopy, boolean fullCopy) {
-    super(toCopy, fullCopy);
+  private GenericDataFile(
+      GenericDataFile toCopy, boolean copyStats, Set<Integer> 
columnsToKeepStats) {
+    super(toCopy, copyStats, columnsToKeepStats);
   }
 
   /** Constructor for Java serialization. */
   GenericDataFile() {}
 
   @Override
   public DataFile copyWithoutStats() {
-    return new GenericDataFile(this, false /* drop stats */);
+    return new GenericDataFile(this, false /* drop stats */, 
ImmutableSet.of());
+  }
+
+  @Override
+  public DataFile copyWithStats(Set<Integer> columnsToKeepStats) {
+    return new GenericDataFile(this, true, columnsToKeepStats);
   }
 
   @Override
   public DataFile copy() {
-    return new GenericDataFile(this, true /* full copy */);
+    return new GenericDataFile(this, true /* full copy */, ImmutableSet.of());

Review Comment:
   Why does this pass an empty set for a full copy? Those two things conflict 
with one another. If you intend to allow not passing a set of column IDs (which 
is a good idea) then pass a default that makes sense to turn off the filter, 
like `null`.



-- 
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-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to