ajantha-bhat commented on code in PR #13425:
URL: https://github.com/apache/iceberg/pull/13425#discussion_r2175008045
##########
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:
As mentioned, the second argument for the `transform`, should be a
`Function`. Passing `recordToPartitionStats` which accepts two argument will be
a `BiFunction` and doesn't match with existing method.
I can add a new `transform` method in `CloseableIterable` with `BiFunction`.
But I feel it is an overkill as it is not used anywhere in the code.
##########
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:
oh. I think you mean extract a common code like this.
--
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]