rdblue commented on code in PR #18108:
URL: https://github.com/apache/iceberg/pull/18108#discussion_r4158985110
##########
core/src/main/java/org/apache/iceberg/TrackedFileStruct.java:
##########
@@ -210,14 +207,27 @@ public long fileSizeInBytes() {
return fileSizeInBytes;
}
+ void setPartitionProjection(StructProjection projection) {
+ this.partitionProjection = projection;
+ }
+
+ void clearPartition() {
+ this.partition = null;
+ this.partitionProjection = null;
+ }
+
@Override
public Integer specId() {
return specId;
}
@Override
public StructLike partition() {
- return partitionData;
+ if (partition == null || partitionProjection == null) {
Review Comment:
Now that the partition is cleared if it is not valid, I think that this
method should throw `IllegalStateException` when the spec ID is present, but
the partition is null. That way we are not relying on the caller to recognize
that the partition is invalid, rather than assuming that a null partition tuple
indicates an unpartitioned file.
I think this is needed for correctness. If we are matching equality deletes
with data files, we need to fail when the partition is missing.
--
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]