pvary commented on code in PR #13425:
URL: https://github.com/apache/iceberg/pull/13425#discussion_r2174643385


##########
core/src/main/java/org/apache/iceberg/PartitionStatsHandler.java:
##########
@@ -226,7 +278,12 @@ public static CloseableIterable<PartitionStats> 
readPartitionStatsFile(
 
     CloseableIterable<StructLike> records =
         InternalData.read(fileFormat, inputFile).project(schema).build();
-    return CloseableIterable.transform(records, 
PartitionStatsHandler::recordToPartitionStats);
+
+    if (schema.findField(DV_COUNT.name()) == null) {
+      return CloseableIterable.transform(records, 
PartitionStatsHandler::recordToPartitionStats);
+    } else {
+      return CloseableIterable.transform(records, 
PartitionStatsHandler::recordToPartitionStatsV3);

Review Comment:
   ```
    private static PartitionStats recordToPartitionStats(StructLike record, 
BiFunction<String, Integer, PartitionStats> statBuilder) {
       int pos = 0;
       PartitionStats stats = statBuilder.apply(
               record.get(pos++, StructLike.class), // partition
               record.get(pos++, Integer.class)); // spec id
   
       for (; pos < record.size(); pos++) {
         stats.set(pos, record.get(pos, Object.class));
       }
   
       return stats;
     }
   ```



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