Skip to content

Commit

Permalink
Add accessors for ColumnIndex / OffsetIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Sep 28, 2024
1 parent 572ce5c commit 5e324f6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion parquet/src/file/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ impl ParquetMetaDataBuilder {
Self(ParquetMetaData::new(file_meta_data, vec![]))
}

/// Create a new builder from an exising ParquetMetaData
/// Create a new builder from an existing ParquetMetaData
pub fn new_from_metadata(metadata: ParquetMetaData) -> Self {
Self(metadata)
}
Expand Down Expand Up @@ -385,6 +385,11 @@ impl ParquetMetaDataBuilder {
std::mem::take(&mut self.0.column_index)
}

/// Return a reference to the current column index, if any
pub fn column_index(&self) -> Option<&ParquetColumnIndex> {
self.0.column_index.as_ref()
}

/// Sets the offset index
pub fn set_offset_index(mut self, offset_index: Option<ParquetOffsetIndex>) -> Self {
self.0.offset_index = offset_index;
Expand All @@ -396,6 +401,11 @@ impl ParquetMetaDataBuilder {
std::mem::take(&mut self.0.offset_index)
}

/// Return a reference to the current offset index, if any
pub fn offset_index(&self) -> Option<&ParquetOffsetIndex> {
self.0.offset_index.as_ref()
}

/// Creates a new ParquetMetaData from the builder
pub fn build(self) -> ParquetMetaData {
let Self(metadata) = self;
Expand Down

0 comments on commit 5e324f6

Please sign in to comment.