Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-arrow/src/io/ipc/read/mod.rs
6940 views
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.
7
use crate::array::Array;
8
9
mod array;
10
mod common;
11
mod deserialize;
12
mod error;
13
pub(crate) mod file;
14
#[cfg(feature = "io_flight")]
15
mod flight;
16
mod read_basic;
17
mod reader;
18
mod schema;
19
mod stream;
20
21
pub(crate) use common::first_dict_field;
22
pub use common::{ProjectionInfo, prepare_projection};
23
pub use error::OutOfSpecKind;
24
pub use file::{
25
FileMetadata, deserialize_footer, get_row_count, get_row_count_from_blocks, read_batch,
26
read_file_dictionaries, read_file_metadata,
27
};
28
use polars_utils::aliases::PlHashMap;
29
pub use reader::FileReader;
30
pub use schema::deserialize_schema;
31
pub use stream::{StreamMetadata, StreamReader, StreamState, read_stream_metadata};
32
33
/// how dictionaries are tracked in this crate
34
pub type Dictionaries = PlHashMap<i64, Box<dyn Array>>;
35
36
pub(crate) type Node<'a> = arrow_format::ipc::FieldNodeRef<'a>;
37
pub(crate) type IpcBuffer<'a> = arrow_format::ipc::BufferRef<'a>;
38
pub(crate) type Compression<'a> = arrow_format::ipc::BodyCompressionRef<'a>;
39
pub(crate) type Version = arrow_format::ipc::MetadataVersion;
40
41
#[cfg(feature = "io_flight")]
42
pub use flight::*;
43
44
pub trait SendableIterator: Send + Iterator {}
45
46
impl<T: Iterator + Send> SendableIterator for T {}
47
48