pvary commented on code in PR #8803: URL: https://github.com/apache/iceberg/pull/8803#discussion_r1365197840
########## core/src/main/java/org/apache/iceberg/BaseFile.java: ########## @@ -186,12 +189,23 @@ public PartitionData copy() { this.recordCount = toCopy.recordCount; this.fileSizeInBytes = toCopy.fileSizeInBytes; if (fullCopy) { - this.columnSizes = SerializableMap.copyOf(toCopy.columnSizes); - this.valueCounts = SerializableMap.copyOf(toCopy.valueCounts); - this.nullValueCounts = SerializableMap.copyOf(toCopy.nullValueCounts); - this.nanValueCounts = SerializableMap.copyOf(toCopy.nanValueCounts); - this.lowerBounds = SerializableByteBufferMap.wrap(SerializableMap.copyOf(toCopy.lowerBounds)); - this.upperBounds = SerializableByteBufferMap.wrap(SerializableMap.copyOf(toCopy.upperBounds)); + if (statsToKeep == null || statsToKeep.isEmpty()) { Review Comment: I did it this way, to save 5 checks, but the code is much nicer if we hide the checks in the method, so refactored ########## core/src/main/java/org/apache/iceberg/TableScanContext.java: ########## @@ -59,6 +60,11 @@ public boolean returnColumnStats() { return false; } + @Value.Default + public Collection<Integer> returnColumnStatsToInclude() { Review Comment: done ########## core/src/main/java/org/apache/iceberg/TableScanContext.java: ########## @@ -125,6 +131,16 @@ TableScanContext shouldReturnColumnStats(boolean returnColumnStats) { .build(); } + TableScanContext shouldReturnSpecificColumnStats(Collection<Integer> columStatsToInclude) { Review Comment: done -- 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