etseidl commented on code in PR #6290: URL: https://github.com/apache/arrow-rs/pull/6290#discussion_r1765798886
########## parquet/Cargo.toml: ########## @@ -215,3 +218,4 @@ harness = false [lib] bench = false + Review Comment: ```suggestion ``` ########## parquet/README.md: ########## @@ -82,4 +83,4 @@ The `parquet` crate provides the following features which may be enabled in your ## License -Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0. +Licensed under the Apache License, Version 2.0: <http://www.apache.org/licenses/LICENSE-2.0>. Review Comment: Are the angle brackets necessary? ########## parquet/src/file/serialized_reader.rs: ########## @@ -391,6 +391,17 @@ pub(crate) fn decode_page( physical_type: Type, decompressor: Option<&mut Box<dyn Codec>>, ) -> Result<Page> { + // Verify the 32-bit CRC checksum of the page + #[cfg(feature = "crc")] + if let Some(expected_crc) = page_header.crc { + let crc = crc32fast::hash(&buffer); + if crc != expected_crc as u32 { + return Err(ParquetError::General( + "Page CRC checksum mismatch".to_string(), + )); Review Comment: ```suggestion return Err(general_err!("Page CRC checksum mismatch")); ``` ########## parquet/tests/arrow_reader/checksum.rs: ########## @@ -0,0 +1,55 @@ +use std::path::PathBuf; Review Comment: Please add the apache license notification. -- 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]
