xxubai commented on code in PR #4085:
URL: https://github.com/apache/amoro/pull/4085#discussion_r2889765780
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/scan/TableEntriesScan.java:
##########
@@ -340,7 +343,7 @@ private DataFile buildDataFile(StructLike fileRecord) {
if (spec.isPartitioned()) {
StructLike partition =
fileRecord.get(dataFileFieldIndex(DataFile.PARTITION_NAME),
StructLike.class);
- builder.withPartition(partition);
+ builder.withPartition(projectPartition(spec, partition));
Review Comment:
```suggestion
builder.withPartition(PartitionUtil.coercePartition(unifiedPartitionType(),
spec, partition));
```
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/scan/TableEntriesScan.java:
##########
@@ -429,6 +432,20 @@ private int dataFileFieldIndex(String fieldName) {
return lazyIndexOfDataFileType.get(fieldName);
}
+ private StructLike projectPartition(PartitionSpec spec, StructLike
partition) {
Review Comment:
It seems this function duplicates the logic in
`PartitionUtil.coercePartition(...)`. Maybe we can reuse that method directly.
##########
amoro-format-iceberg/src/main/java/org/apache/amoro/scan/TableEntriesScan.java:
##########
@@ -372,7 +375,7 @@ private DeleteFile buildDeleteFile(StructLike fileRecord,
FileContent fileConten
if (spec.isPartitioned()) {
StructLike partition =
fileRecord.get(dataFileFieldIndex(DataFile.PARTITION_NAME),
StructLike.class);
- builder.withPartition(partition);
+ builder.withPartition(projectPartition(spec, partition));
Review Comment:
```suggestion
builder.withPartition(PartitionUtil.coercePartition(unifiedPartitionType(),
spec, partition));
```
--
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]