rdblue commented on code in PR #8147:
URL: https://github.com/apache/iceberg/pull/8147#discussion_r1274221570


##########
core/src/main/java/org/apache/iceberg/UpdateRequirement.java:
##########
@@ -114,6 +117,15 @@ public void validate(TableMetadata base) {
             lastAssignedFieldId, base.lastColumnId());
       }
     }
+
+    @Override
+    public void validate(ViewMetadata base) {
+      if (base != null && base.schema().highestFieldId() != 
lastAssignedFieldId) {

Review Comment:
   This isn't correct, but it probably doesn't matter. Consider a case where I 
add a new field (id=3) and then roll back to a previous schema where the 
highest field ID is 2. That's why we store the last assigned field ID 
separately in the table spec. However, I don't think that we would ever use 
this validation for views. We don't store data files that embed schema field 
IDs, so we don't have any need for them to be consistent across versions or 
schemas. I think this should just throw an `UnsupportedOperationException ` 
because we should not generated the validation.
   
   (We could also assign field IDs like we do in the table schema, but I'd 
probably skip that complexity)



-- 
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]

Reply via email to