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
8431 views
1
//! APIs to read Arrow's IPC format.
2
//!
3
//! The two important File-based 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
//! In addition, there is a Block-based struct [`BlockReader`](reader::BlockReader), which
8
//! enabled random access to a standalone IPC Block.
9
use crate::array::Array;
10
11
mod array;
12
pub mod common;
13
mod deserialize;
14
mod error;
15
pub(crate) mod file;
16
#[cfg(feature = "io_flight")]
17
mod flight;
18
mod read_basic;
19
mod reader;
20
mod schema;
21
mod stream;
22
23
pub(crate) use common::first_dict_field;
24
pub use common::{ProjectionInfo, prepare_projection};
25
pub use error::OutOfSpecKind;
26
pub use file::{
27
FileMetadata, deserialize_footer, get_row_count, get_row_count_from_blocks, read_batch,
28
read_dictionary_block, read_file_dictionaries, read_file_metadata,
29
};
30
use polars_utils::aliases::PlHashMap;
31
pub use reader::{BlockReader, FileReader};
32
pub use schema::deserialize_schema;
33
pub use stream::{StreamMetadata, StreamReader, StreamState, read_stream_metadata};
34
35
/// how dictionaries are tracked in this crate
36
pub type Dictionaries = PlHashMap<i64, Box<dyn Array>>;
37
38
pub(crate) type Node<'a> = arrow_format::ipc::FieldNodeRef<'a>;
39
pub(crate) type IpcBuffer<'a> = arrow_format::ipc::BufferRef<'a>;
40
pub(crate) type Compression<'a> = arrow_format::ipc::BodyCompressionRef<'a>;
41
pub(crate) type Version = arrow_format::ipc::MetadataVersion;
42
43
#[cfg(feature = "io_flight")]
44
pub use flight::*;
45
46
pub trait SendableIterator: Send + Iterator {}
47
48
impl<T: Iterator + Send> SendableIterator for T {}
49
50