Skip to content

Commit

Permalink
Add ParquetMetaDataReader (#6431)
Browse files Browse the repository at this point in the history
* add ParquetMetaDataReader

* clippy

* Apply suggestions from code review

Co-authored-by: Andrew Lamb <[email protected]>

* formatting

* add ParquetMetaDataReader to module documentation

* document erros returned from `try_parse_sized`

* oops

* rename methods per review suggestion

---------

Co-authored-by: Andrew Lamb <[email protected]>
  • Loading branch information
etseidl and alamb authored Sep 24, 2024
1 parent a65e14a commit e67f17e
Show file tree
Hide file tree
Showing 2 changed files with 973 additions and 3 deletions.
7 changes: 4 additions & 3 deletions parquet/src/file/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
//! Reading:
//! * Read from bytes to `ParquetMetaData`: [`decode_footer`]
//! and [`decode_metadata`]
//! * Read from an `async` source to `ParquetMetadata`: [`MetadataLoader`]
//! * Read from an `async` source to `ParquetMetaData`: [`MetadataLoader`]
//! * Read from bytes or from an async source to `ParquetMetaData`: [`ParquetMetaDataReader`]
//!
//! [`MetadataLoader`]: https://docs.rs/parquet/latest/parquet/arrow/async_reader/struct.MetadataLoader.html
//! [`decode_footer`]: crate::file::footer::decode_footer
Expand Down Expand Up @@ -94,6 +95,7 @@
//! * Same name, different struct
//! ```
mod memory;
pub(crate) mod reader;
mod writer;

use std::ops::Range;
Expand All @@ -115,6 +117,7 @@ use crate::schema::types::{
ColumnDescPtr, ColumnDescriptor, ColumnPath, SchemaDescPtr, SchemaDescriptor,
Type as SchemaType,
};
pub use reader::ParquetMetaDataReader;
pub use writer::ParquetMetaDataWriter;
pub(crate) use writer::ThriftMetadataWriter;

Expand Down Expand Up @@ -278,13 +281,11 @@ impl ParquetMetaData {
}

/// Override the column index
#[cfg(feature = "arrow")]
pub(crate) fn set_column_index(&mut self, index: Option<ParquetColumnIndex>) {
self.column_index = index;
}

/// Override the offset index
#[cfg(feature = "arrow")]
pub(crate) fn set_offset_index(&mut self, index: Option<ParquetOffsetIndex>) {
self.offset_index = index;
}
Expand Down
Loading

0 comments on commit e67f17e

Please sign in to comment.