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


##########
core/src/main/java/org/apache/iceberg/V4ManifestWriter.java:
##########
@@ -362,7 +403,14 @@ protected StructLike prepare(TrackedFile file, Tracking 
tracking) {
 
     @Override
     public long assignedRowIds() {
-      return nextRowId - firstRowId;
+      long assignedRowIds = nextRowId - firstRowId;
+      // sanity check the assigned row IDs
+      Preconditions.checkState(
+          assignedRowIds == super.assignedRowIds(),
+          "Incorrect assigned row IDs: %s != %s",
+          assignedRowIds,

Review Comment:
   The error message was wrong. Fixed.
   
   This isn't strictly necessary, but since we are calculating the assigned 
rows in two ways I think it is a good sanity check to leave in. I like having 
the assertions in tests as @amogh-jahagirdar suggested, even for leaf files.



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