aokolnychyi commented on a change in pull request #2956:
URL: https://github.com/apache/iceberg/pull/2956#discussion_r685697551
##########
File path: core/src/main/java/org/apache/iceberg/BaseUpdatePartitionSpec.java
##########
@@ -69,7 +69,7 @@
this.schema = spec.schema();
this.nameToField = indexSpecByName(spec);
this.transformToField = indexSpecByTransform(spec);
- this.lastAssignedPartitionId = base.lastAssignedPartitionId();
+ this.lastAssignedPartitionId = formatVersion == 1 ?
spec.lastAssignedFieldId() : base.lastAssignedPartitionId();
Review comment:
I think the spec [assumes](https://iceberg.apache.org/spec/#version-2)
that `base.lastAssignedPartitionId` is always set for v2 tables.
I checked `PartitionSpecParser` and it looks like
`spec.lastAssignedFieldId()` is always propagated for v1 tables.
Another pair of eyes to check this would be much appreciated.
--
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]