parquet::arrow::arrow_reader

Struct ArrowReaderMetadata

Source
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

  1. 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

  2. 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

Source

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.

Source

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.

Source

fn with_supplied_schema( metadata: Arc<ParquetMetaData>, supplied_schema: SchemaRef, ) -> Result<Self>

Source

pub fn metadata(&self) -> &Arc<ParquetMetaData>

Returns a reference to the ParquetMetaData for this parquet file

Source

pub fn parquet_schema(&self) -> &SchemaDescriptor

Returns the parquet SchemaDescriptor for this parquet file

Source

pub fn schema(&self) -> &SchemaRef

Returns the arrow [SchemaRef] for this parquet file

Source§

impl ArrowReaderMetadata

Source

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

Source§

fn clone(&self) -> ArrowReaderMetadata

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ArrowReaderMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T