pub struct ArrowReaderMetadata {
pub(crate) metadata: Arc<ParquetMetaData>,
pub(crate) schema: SchemaRef,
pub(crate) fields: Option<Arc<ParquetField>>,
}
Expand description
The metadata necessary to construct a ArrowReaderBuilder
Note this structure is cheaply clone-able as it consists of several arcs.
This structure allows
-
Loading metadata for a file once and then using that same metadata to construct multiple separate readers, for example, to distribute readers across multiple threads
-
Using a cached copy of the
ParquetMetadata
rather than reading it from the file each time a reader is constructed.
Fields§
§metadata: Arc<ParquetMetaData>
The Parquet Metadata, if known aprior
schema: SchemaRef
The Arrow Schema
fields: Option<Arc<ParquetField>>
Implementations§
Source§impl ArrowReaderMetadata
impl ArrowReaderMetadata
Sourcepub fn load<T: ChunkReader>(
reader: &T,
options: ArrowReaderOptions,
) -> Result<Self>
pub fn load<T: ChunkReader>( reader: &T, options: ArrowReaderOptions, ) -> Result<Self>
Loads ArrowReaderMetadata
from the provided ChunkReader
, if necessary
See ParquetRecordBatchReaderBuilder::new_with_metadata
for an
example of how this can be used
§Notes
If options
has ArrowReaderOptions::with_page_index
true, but
Self::metadata
is missing the page index, this function will attempt
to load the page index by making an object store request.
Sourcepub fn try_new(
metadata: Arc<ParquetMetaData>,
options: ArrowReaderOptions,
) -> Result<Self>
pub fn try_new( metadata: Arc<ParquetMetaData>, options: ArrowReaderOptions, ) -> Result<Self>
Create a new ArrowReaderMetadata
§Notes
This function does not attempt to load the PageIndex if not present in the metadata.
See Self::load
for more details.
fn with_supplied_schema( metadata: Arc<ParquetMetaData>, supplied_schema: SchemaRef, ) -> Result<Self>
Sourcepub fn metadata(&self) -> &Arc<ParquetMetaData>
pub fn metadata(&self) -> &Arc<ParquetMetaData>
Returns a reference to the ParquetMetaData
for this parquet file
Sourcepub fn parquet_schema(&self) -> &SchemaDescriptor
pub fn parquet_schema(&self) -> &SchemaDescriptor
Returns the parquet SchemaDescriptor
for this parquet file
Source§impl ArrowReaderMetadata
impl ArrowReaderMetadata
Sourcepub async fn load_async<T: AsyncFileReader>(
input: &mut T,
options: ArrowReaderOptions,
) -> Result<Self>
pub async fn load_async<T: AsyncFileReader>( input: &mut T, options: ArrowReaderOptions, ) -> Result<Self>
Returns a new ArrowReaderMetadata
for this builder
See ParquetRecordBatchStreamBuilder::new_with_metadata
for how this can be used
§Notes
If options
has ArrowReaderOptions::with_page_index
true, but
Self::metadata
is missing the page index, this function will attempt
to load the page index by making an object store request.
Trait Implementations§
Source§impl Clone for ArrowReaderMetadata
impl Clone for ArrowReaderMetadata
Source§fn clone(&self) -> ArrowReaderMetadata
fn clone(&self) -> ArrowReaderMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ArrowReaderMetadata
impl RefUnwindSafe for ArrowReaderMetadata
impl Send for ArrowReaderMetadata
impl Sync for ArrowReaderMetadata
impl Unpin for ArrowReaderMetadata
impl UnwindSafe for ArrowReaderMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more