nastra commented on code in PR #11446: URL: https://github.com/apache/iceberg/pull/11446#discussion_r1827524332
########## core/src/main/java/org/apache/iceberg/FileMetadata.java: ########## @@ -240,6 +252,14 @@ public DeleteFile build() { Preconditions.checkArgument(fileSizeInBytes >= 0, "File size is required"); Preconditions.checkArgument(recordCount >= 0, "Record count is required"); + if (format == FileFormat.PUFFIN) { + Preconditions.checkArgument(contentOffset != null, "Content offset is required for DV"); + Preconditions.checkArgument(contentSizeInBytes != null, "Content size is required for DV"); + } else { + Preconditions.checkArgument(contentOffset == null, "Content offset is only for DV"); Review Comment: I think it's quite difficult to stay on a single line while also producing a good/descriptive error msg. I would favor a better error msg, since that is what people later will run into and will read. What about `Content offset must only be set for DVs` here? In other places we typically use `Invalid xyz: ...`, so this error msg could also be `Invalid content offset: must be null for DVs` and in the msgs further above it could be `Invalid content offset: must be non-null for DVs` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org