Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add first test
  • Loading branch information
etseidl committed Aug 12, 2025
commit 0c3a5b07e78d7adbccf01bd4b562be173bdc7c7d
22 changes: 22 additions & 0 deletions parquet/src/file/metadata/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,7 @@ fn convert_stats(
mod tests {
use super::*;
use bytes::Bytes;
use zstd::zstd_safe::WriteBuf;

use crate::basic::SortOrder;
use crate::basic::Type;
Expand Down Expand Up @@ -1803,6 +1804,27 @@ mod tests {
"EOF: Parquet file too small. Size is 1728 but need 1729"
);
}

#[test]
fn test_new_decoder() {
let file = get_test_file("alltypes_tiny_pages.parquet");
let len = file.len();

// read entire file
let bytes = file.get_bytes(0, len as usize).unwrap();
let mut footer = [0u8; FOOTER_SIZE];
footer.copy_from_slice(bytes.slice(len as usize - FOOTER_SIZE..).as_slice());
let tail = ParquetMetaDataReader::decode_footer_tail(&footer).unwrap();
let meta_len = tail.metadata_length();
let metadata_bytes = bytes.slice(len as usize - FOOTER_SIZE - meta_len..);

// get ParquetMetaData
let m = ParquetMetaDataReader::decode_file_metadata(&metadata_bytes).unwrap();
let m2 = ParquetMetaDataReader::decode_metadata(&metadata_bytes).unwrap();

// check that metadatas are equivalent
assert_eq!(m, m2);
}
}

#[cfg(all(feature = "async", feature = "arrow", test))]
Expand Down