polars_arrow/io/ipc/read/
mod.rs

1//! APIs to read Arrow's IPC format.
2//!
3//! The two important structs here are the [`FileReader`](reader::FileReader),
4//! which provides arbitrary access to any of its messages, and the
5//! [`StreamReader`](stream::StreamReader), which only supports reading
6//! data in the order it was written in.
7use crate::array::Array;
8
9mod array;
10mod common;
11mod deserialize;
12mod error;
13pub(crate) mod file;
14#[cfg(feature = "io_flight")]
15mod flight;
16mod read_basic;
17mod reader;
18mod schema;
19mod stream;
20
21pub(crate) use common::first_dict_field;
22pub use common::{prepare_projection, ProjectionInfo};
23pub use error::OutOfSpecKind;
24pub use file::{
25    deserialize_footer, get_row_count, get_row_count_from_blocks, read_batch,
26    read_file_dictionaries, read_file_metadata, FileMetadata,
27};
28use polars_utils::aliases::PlHashMap;
29pub use reader::FileReader;
30pub use schema::deserialize_schema;
31pub use stream::{read_stream_metadata, StreamMetadata, StreamReader, StreamState};
32
33/// how dictionaries are tracked in this crate
34pub type Dictionaries = PlHashMap<i64, Box<dyn Array>>;
35
36pub(crate) type Node<'a> = arrow_format::ipc::FieldNodeRef<'a>;
37pub(crate) type IpcBuffer<'a> = arrow_format::ipc::BufferRef<'a>;
38pub(crate) type Compression<'a> = arrow_format::ipc::BodyCompressionRef<'a>;
39pub(crate) type Version = arrow_format::ipc::MetadataVersion;
40
41#[cfg(feature = "io_flight")]
42pub use flight::*;
43
44pub trait SendableIterator: Send + Iterator {}
45
46impl<T: Iterator + Send> SendableIterator for T {}