Expand description
Arrow IPC File and Stream Readers
Β§Notes
The FileReader and StreamReader have similar interfaces,
however the FileReader expects a reader that supports Seeking
Re-exportsΒ§
use arrow_select::concat;πuse flatbuffers::VectorIter;πuse flatbuffers::VerifierOptions;πuse std::collections::HashMap;πuse std::collections::VecDeque;πuse std::fmt;πuse std::io::BufReader;πuse std::io::Read;πuse std::io::Seek;πuse std::io::SeekFrom;πuse std::sync::Arc;πuse arrow_buffer::ArrowNativeType;πuse arrow_buffer::BooleanBuffer;πuse arrow_buffer::Buffer;πuse arrow_buffer::MutableBuffer;πuse arrow_buffer::NullBuffer;πuse arrow_buffer::ScalarBuffer;πuse arrow_data::ArrayData;πuse arrow_data::ArrayDataBuilder;πuse crate::compression::CompressionCodec;πuse crate::compression::DecompressionContext;πuse crate::gen::Message;πuse crate::Block;πuse crate::CONTINUATION_MARKER;πuse crate::FieldNode;πuse crate::MetadataVersion;πuse arrow_array::*;πuse arrow_schema::*;πuse DataType::*;π
ModulesΒ§
- stream π
StructsΒ§
- File
Decoder - A low-level, push-based interface for reading an IPC file
- File
Reader - Arrow File Reader
- File
Reader Builder - Build an Arrow
FileReaderwith custom options. - Message
Reader π - A low-level construct that reads
Message::Messages from a reader while re-using a buffer for metadata. This is composed intoStreamReader. - Record
Batch Decoder - State for decoding Arrow arrays from an IPC RecordBatch structure to
[
RecordBatch] - Stream
Decoder - A low-level interface for reading [
RecordBatch] data from a stream of bytes - Stream
Reader - Arrow Stream Reader
EnumsΒ§
- Decoder
State - IpcMessage π
- Representation of a fully parsed IpcMessage from the underlying stream.
Parsing this kind of message is done by higher level constructs such as
StreamReader, because fully interpreting the messages into a record batch or dictionary batch requires access to stream state such as schema and the full dictionary cache.
ConstantsΒ§
- MAX_
PREALLOC_ πBYTES - Upper bound on how much memory a single message length is allowed to reserve before any of the bytes it promises have been read.
FunctionsΒ§
- check_
variadic_ πcounts_ consumed - One variadic buffer count is consumed per
BinaryVieworUtf8Viewcolumn in the schema, so any count left over means the message and the schema disagree. - child_
field_ πwith_ dict_ id - field_
with_ πdict_ id - first_
field_ πwith_ dict_ id - Returns the first field with dictionary
id, in [Schema::fields_with_dict_id] order. - get_
dictionary_ πvalues - Given a dictionary batch IPC message/body along with the full state of a stream including schema, dictionary cache, metadata, and other flags, this function will parse the buffer into an array of dictionary values.
- parse_
message π - Parse an encapsulated message
- read_
block π - Read the data for a given block
- read_
body_ πbounded - Reads exactly
lenbytes of message body, without reservinglenbefore reading it. - read_
buffer π - Read a buffer based on offset and length From https://github.com/apache/arrow/blob/6a936c4ff5007045e86f65f1a6b6c3c955ad5103/format/Message.fbs#L58 Each constituent buffer is first compressed with the indicated compressor, and then written with the uncompressed length in the first 8 bytes as a 64-bit little-endian signed integer followed by the compressed buffer bytes (and then padding as required by the protocol). The uncompressed length may be set to -1 to indicate that the data that follows is not compressed, which can be useful for cases where compression does not yield appreciable savings.
- read_
dictionary - Read the dictionary from the buffer and provided metadata,
updating the
dictionaries_by_idwith the resulting dictionary - read_
dictionary_ impl - Low-level version of
read_dictionarywith alignment and validation controls - read_
footer_ length - Read the footer length from the last 10 bytes of an Arrow IPC file
- read_
record_ batch - Creates a record batch from binary data using the
crate::RecordBatchindexes and theSchema. - reserve_
declared - Reserves a messageβs declared length before copying its first bytes into an empty
buf, bounded as inread_body_bounded. Growing with each input buffer instead doubles the capacity, and the decoded batch, which is zero-copy overbuf, keeps up to twice its size. - update_
dictionaries π - Updates the
dictionaries_by_idwith the provided dictionary values and id.