rahil-c commented on code in PR #11369: URL: https://github.com/apache/iceberg/pull/11369#discussion_r1861148874
########## core/src/main/java/org/apache/iceberg/ContentFileParser.java: ########## @@ -48,6 +48,97 @@ class ContentFileParser { private ContentFileParser() {} + public static void unboundContentFileToJson( + ContentFile<?> contentFile, PartitionSpec spec, JsonGenerator generator) throws IOException { + Preconditions.checkArgument(contentFile != null, "Invalid content file: null"); + Preconditions.checkArgument(spec != null, "Invalid partition spec: null"); + Preconditions.checkArgument(generator != null, "Invalid JSON generator: null"); + Preconditions.checkArgument( + contentFile.specId() == spec.specId(), + "Invalid partition spec id from content file: expected = %s, actual = %s", + spec.specId(), + contentFile.specId()); + + generator.writeStartObject(); + // ignore the ordinal position (ContentFile#pos) of the file in a manifest, + // as it isn't used and BaseFile constructor doesn't support it. Review Comment: @amogh-jahagirdar I actually am not the original author of that comment. <img width="898" alt="Screenshot 2024-11-27 at 11 15 47 AM" src="https://github.com/user-attachments/assets/b5219cee-3cbd-4128-9d96-d22bbf25df1c"> This was the pr that added it: https://github.com/apache/iceberg/commit/b8db3f00424c2cc2910a760b9068d38916e8c27a. Do you still want me to remove it? -- 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