Path: blob/main/crates/polars-arrow/src/io/ipc/read/mod.rs
8431 views
//! APIs to read Arrow's IPC format.1//!2//! The two important File-based structs here are the [`FileReader`](reader::FileReader),3//! which provides arbitrary access to any of its messages, and the4//! [`StreamReader`](stream::StreamReader), which only supports reading5//! data in the order it was written in.6//! In addition, there is a Block-based struct [`BlockReader`](reader::BlockReader), which7//! enabled random access to a standalone IPC Block.8use crate::array::Array;910mod array;11pub mod common;12mod deserialize;13mod error;14pub(crate) mod file;15#[cfg(feature = "io_flight")]16mod flight;17mod read_basic;18mod reader;19mod schema;20mod stream;2122pub(crate) use common::first_dict_field;23pub use common::{ProjectionInfo, prepare_projection};24pub use error::OutOfSpecKind;25pub use file::{26FileMetadata, deserialize_footer, get_row_count, get_row_count_from_blocks, read_batch,27read_dictionary_block, read_file_dictionaries, read_file_metadata,28};29use polars_utils::aliases::PlHashMap;30pub use reader::{BlockReader, FileReader};31pub use schema::deserialize_schema;32pub use stream::{StreamMetadata, StreamReader, StreamState, read_stream_metadata};3334/// how dictionaries are tracked in this crate35pub type Dictionaries = PlHashMap<i64, Box<dyn Array>>;3637pub(crate) type Node<'a> = arrow_format::ipc::FieldNodeRef<'a>;38pub(crate) type IpcBuffer<'a> = arrow_format::ipc::BufferRef<'a>;39pub(crate) type Compression<'a> = arrow_format::ipc::BodyCompressionRef<'a>;40pub(crate) type Version = arrow_format::ipc::MetadataVersion;4142#[cfg(feature = "io_flight")]43pub use flight::*;4445pub trait SendableIterator: Send + Iterator {}4647impl<T: Iterator + Send> SendableIterator for T {}484950