liurenjie1024 commented on code in PR #1207: URL: https://github.com/apache/iceberg-rust/pull/1207#discussion_r2055992653
########## crates/iceberg/src/puffin/metadata.rs: ########## @@ -264,18 +293,83 @@ impl FileMetadata { } /// Returns the file metadata about a Puffin file - pub(crate) async fn read(input_file: &InputFile) -> Result<FileMetadata> { + /// + /// `prefetch_hint` is used to try to fetch the entire footer in one read. If + /// the entire footer isn't fetched in one read the function will call the `read_no_prefetch` + /// option. + pub(crate) async fn read(&self, input_file: &InputFile) -> Result<FileMetadata> { Review Comment: ```suggestion pub(crate) async fn read(input_file: &InputFile) -> Result<FileMetadata> { ``` Suggestions: 1. Keep original api 2. Add anoter method `read_with_hint` to implement the method with a hint. ########## crates/iceberg/src/puffin/metadata.rs: ########## @@ -131,31 +131,45 @@ impl Flag { } /// Metadata about a puffin file. +/// /// For more information, see: https://iceberg.apache.org/puffin-spec/#filemetadata -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Default)] pub struct FileMetadata { pub(crate) blobs: Vec<BlobMetadata>, #[serde(skip_serializing_if = "HashMap::is_empty")] #[serde(default)] pub(crate) properties: HashMap<String, String>, + /// Optional prefetch hint you can pass for retrieving footer + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) prefetch_hint: Option<u8>, Review Comment: I have concerns adding this field for two reasons: 1. It looks impractical to ask user to pass in the `prefetch_hint`. 2. This format is define by [iceberg spec](https://iceberg.apache.org/puffin-spec/#format-specification), and adding another field may lead to wrong file. -- 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