huan233usc commented on code in PR #17451:
URL: https://github.com/apache/iceberg/pull/17451#discussion_r3876735437
##########
api/src/main/java/org/apache/iceberg/ContentFile.java:
##########
@@ -99,6 +99,17 @@ default String location() {
/** Returns if collected, map from column ID to value upper bounds, null
otherwise. */
Map<Integer, ByteBuffer> upperBounds();
+ /**
+ * Returns if collected, map from column ID to its average value size in
memory (uncompressed) in
+ * bytes over non-null values, null otherwise.
+ *
+ * <p>This statistic is not persisted in manifests prior to v4, so it is
generally only present
Review Comment:
Applied — wrapped the Javadoc so `:iceberg-api:spotlessJavaCheck` is clean.
##########
core/src/main/java/org/apache/iceberg/BaseFile.java:
##########
@@ -217,13 +220,15 @@ abstract class BaseFile<F> extends SupportsIndexProjection
this.nanValueCounts = copyMap(toCopy.nanValueCounts, requestedColumnIds);
this.lowerBounds = copyByteBufferMap(toCopy.lowerBounds,
requestedColumnIds);
this.upperBounds = copyByteBufferMap(toCopy.upperBounds,
requestedColumnIds);
+ this.avgValueSizes = copyMap(toCopy.avgValueSizes, requestedColumnIds);
Review Comment:
Done. `copyWithStats` now normalizes a fully-filtered `avgValueSizes` map to
null, matching the accessor contract and the tracked-file adapter. Added a
nonmatching-column unit test plus the same assertion on the Parquet geo
round-trip.
##########
core/src/main/java/org/apache/iceberg/util/ContentFileUtil.java:
##########
@@ -175,7 +175,9 @@ private static Metrics metricsWithoutPathBounds(DeleteFile
file) {
file.nullValueCounts(),
file.nanValueCounts(),
lowerBounds == null ? null : Collections.unmodifiableMap(lowerBounds),
- upperBounds == null ? null : Collections.unmodifiableMap(upperBounds));
+ upperBounds == null ? null : Collections.unmodifiableMap(upperBounds),
+ file.avgValueSizes(),
Review Comment:
Sounds good — I'll leave `PATH_ID` / rewrite-table-paths avg sizes for a
follow-up.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]