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


##########
core/src/main/java/org/apache/iceberg/V4ManifestReader.java:
##########
@@ -252,6 +272,29 @@ Builder project(Schema newProjection) {
       return this;
     }
 
+    /**
+     * Reads content stats for the given table field IDs instead of for every 
field. Stats for
+     * fields referenced by the {@link #filter(Expression) filter} are always 
read.
+     *
+     * <p>Passing no field IDs reads only the stats that the filter needs.
+     */
+    Builder projectStats(int... fieldIds) {
+      Preconditions.checkArgument(fieldIds != null, "Invalid stats projection 
for field IDs: null");
+      return projectStats(ArrayUtil.toIntList(fieldIds));
+    }
+
+    /**
+     * Reads content stats for the given table field IDs instead of for every 
field. Stats for
+     * fields referenced by the {@link #filter(Expression) filter} are always 
read.
+     *
+     * <p>Passing an empty iterable reads only the stats that the filter needs.
+     */
+    Builder projectStats(Iterable<Integer> fieldIds) {
+      Preconditions.checkArgument(fieldIds != null, "Invalid stats projection 
for field IDs: null");
+      this.statsProjectionForFieldIds = ImmutableSet.copyOf(fieldIds);

Review Comment:
   I think this name also makes little sense. It isn't a projection. We need to 
store the field IDs for which stats were requested. How about 
`requestedStatsFieldIds`?



-- 
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]

Reply via email to