samuelcolvin commented on code in PR #6367:
URL: https://github.com/apache/arrow-rs/pull/6367#discussion_r1759967411


##########
parquet/src/arrow/async_reader/metadata.rs:
##########
@@ -57,6 +57,12 @@ impl<F: MetadataFetch> MetadataLoader<F> {
             return Err(ParquetError::EOF(format!(
                 "file size of {file_size} is less than footer"
             )));
+        } else if let Some(size_hint) = prefetch {
+            if size_hint < 8 {
+                return Err(ParquetError::EOF(format!(
+                    "prefetch size of {size_hint} is less than footer size"
+                )));
+            }

Review Comment:
   LGTM, except we don't need the `let size_hint = std::cmp::min(size_hint, 
file_size);` since we're using `file_size.saturating_sub(size_hint)` directly 
afterwards.
   
   Changed.



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

Reply via email to