Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion parquet/src/arrow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ mod test {
.unwrap();
assert_eq!(
err.to_string(),
"EOF: Parquet file too small. Page index range 82..115 overlaps with file metadata 0..357"
"EOF: Parquet file too small. Page index range 82..115 overlaps with file metadata 0..392"
);
}

Expand Down
10 changes: 6 additions & 4 deletions parquet/src/bloom_filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,12 @@ impl Sbbf {
/// flush the writer in order to boost performance of bulk writing all blocks. Caller
/// must remember to flush the writer.
pub(crate) fn write<W: Write>(&self, mut writer: W) -> Result<(), ParquetError> {
let mut protocol = ThriftCompactOutputProtocol::new(&mut writer);
self.header().write_thrift(&mut protocol).map_err(|e| {
ParquetError::General(format!("Could not write bloom filter header: {e}"))
})?;
{
let mut protocol = ThriftCompactOutputProtocol::new(&mut writer);
self.header().write_thrift(&mut protocol).map_err(|e| {
ParquetError::General(format!("Could not write bloom filter header: {e}"))
})?;
}
self.write_bitset(&mut writer)?;
Ok(())
}
Expand Down
24 changes: 16 additions & 8 deletions parquet/src/file/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,8 +1628,10 @@ mod tests {
.unwrap();

let mut buf = Vec::new();
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
row_group_meta.write_thrift(&mut writer).unwrap();
{
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
row_group_meta.write_thrift(&mut writer).unwrap();
}

let row_group_res = read_row_group(&mut buf, schema_descr).unwrap();

Expand Down Expand Up @@ -1710,8 +1712,10 @@ mod tests {
.build()
.unwrap();
let mut buf = Vec::new();
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
row_group_meta_2cols.write_thrift(&mut writer).unwrap();
{
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
row_group_meta_2cols.write_thrift(&mut writer).unwrap();
}

let err = read_row_group(&mut buf, schema_descr_3cols)
.unwrap_err()
Expand Down Expand Up @@ -1761,8 +1765,10 @@ mod tests {
.unwrap();

let mut buf = Vec::new();
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
col_metadata.write_thrift(&mut writer).unwrap();
{
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
col_metadata.write_thrift(&mut writer).unwrap();
}
let col_chunk_res = read_column_chunk(&mut buf, column_descr).unwrap();

assert_eq!(col_chunk_res, col_metadata);
Expand All @@ -1777,8 +1783,10 @@ mod tests {
.unwrap();

let mut buf = Vec::new();
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
col_metadata.write_thrift(&mut writer).unwrap();
{
let mut writer = ThriftCompactOutputProtocol::new(&mut buf);
col_metadata.write_thrift(&mut writer).unwrap();
}
let col_chunk_res = read_column_chunk(&mut buf, column_descr).unwrap();

assert_eq!(col_chunk_res, col_metadata);
Expand Down
Loading
Loading