aokolnychyi commented on code in PR #5376:
URL: https://github.com/apache/iceberg/pull/5376#discussion_r944907127
##########
core/src/main/java/org/apache/iceberg/BaseFilesTable.java:
##########
@@ -185,5 +232,60 @@ public Iterable<FileScanTask> split(long splitSize) {
ManifestFile manifest() {
return manifest;
}
+
+ private List<Function<ContentFile<?>, Object>> accessors(boolean
partitioned) {
Review Comment:
What if you created a StructLike that would wrap the StructLike you get from
reading manifests and the metrics map?
Something like this.
```
private static class SomeReasonableNameStructLike implements StructLike {
private final StructLike fileAsStruct;
private final Map<String, StructLike> readableMetrics;
@Override
public <T> T get(int pos, Class<T> javaClass) {
if (pos < fileAsStruct.size()) {
return fileAsStruct.get(pos, javaClass);
} else if (pos == fileAsStruct.size()) {
return javaClass.cast(readableMetrics);
} else {
throw new ...
}
}
```
##########
core/src/main/java/org/apache/iceberg/BaseFilesTable.java:
##########
@@ -185,5 +232,60 @@ public Iterable<FileScanTask> split(long splitSize) {
ManifestFile manifest() {
return manifest;
}
+
+ private List<Function<ContentFile<?>, Object>> accessors(boolean
partitioned) {
Review Comment:
What if you created a StructLike that would wrap the StructLike you get from
reading manifests and the metrics map? Something like this.
```
private static class SomeReasonableNameStructLike implements StructLike {
private final StructLike fileAsStruct;
private final Map<String, StructLike> readableMetrics;
@Override
public <T> T get(int pos, Class<T> javaClass) {
if (pos < fileAsStruct.size()) {
return fileAsStruct.get(pos, javaClass);
} else if (pos == fileAsStruct.size()) {
return javaClass.cast(readableMetrics);
} else {
throw new ...
}
}
```
--
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]