Path: blob/main/crates/polars-arrow/src/io/ipc/read/error.rs
6940 views
use std::fmt::{Display, Formatter};12/// The different types of errors that reading from IPC can cause3#[derive(Debug)]4#[non_exhaustive]5pub enum OutOfSpecKind {6/// The IPC file does not start with [b'A', b'R', b'R', b'O', b'W', b'1']7InvalidHeader,8/// The IPC file does not end with [b'A', b'R', b'R', b'O', b'W', b'1']9InvalidFooter,10/// The first 4 bytes of the last 10 bytes is < 011NegativeFooterLength,12/// The footer is an invalid flatbuffer13InvalidFlatbufferFooter(arrow_format::ipc::planus::Error),14/// The file's footer does not contain record batches15MissingRecordBatches,16/// The footer's record batches is an invalid flatbuffer17InvalidFlatbufferRecordBatches(arrow_format::ipc::planus::Error),18/// The file's footer does not contain a schema19MissingSchema,20/// The footer's schema is an invalid flatbuffer21InvalidFlatbufferSchema(arrow_format::ipc::planus::Error),22/// The file's schema does not contain fields23MissingFields,24/// The footer's dictionaries is an invalid flatbuffer25InvalidFlatbufferDictionaries(arrow_format::ipc::planus::Error),26/// The block is an invalid flatbuffer27InvalidFlatbufferBlock(arrow_format::ipc::planus::Error),28/// The dictionary message is an invalid flatbuffer29InvalidFlatbufferMessage(arrow_format::ipc::planus::Error),30/// The message does not contain a header31MissingMessageHeader,32/// The message's header is an invalid flatbuffer33InvalidFlatbufferHeader(arrow_format::ipc::planus::Error),34/// Relative positions in the file is < 035UnexpectedNegativeInteger,36/// dictionaries can only contain dictionary messages; record batches can only contain records37UnexpectedMessageType,38/// RecordBatch messages do not contain buffers39MissingMessageBuffers,40/// The message's buffers is an invalid flatbuffer41InvalidFlatbufferBuffers(arrow_format::ipc::planus::Error),42/// RecordBatch messages does not contain nodes43MissingMessageNodes,44/// The message's nodes is an invalid flatbuffer45InvalidFlatbufferNodes(arrow_format::ipc::planus::Error),46/// The message's body length is an invalid flatbuffer47InvalidFlatbufferBodyLength(arrow_format::ipc::planus::Error),48/// The message does not contain data49MissingData,50/// The message's data is an invalid flatbuffer51InvalidFlatbufferData(arrow_format::ipc::planus::Error),52/// The version is an invalid flatbuffer53InvalidFlatbufferVersion(arrow_format::ipc::planus::Error),54/// The compression is an invalid flatbuffer55InvalidFlatbufferCompression(arrow_format::ipc::planus::Error),56/// The record contains a number of buffers that does not match the required number by the data type57ExpectedBuffer,58/// A buffer's size is smaller than the required for the number of elements59InvalidBuffer {60/// Declared number of elements in the buffer61length: usize,62/// The name of the `NativeType`63type_name: &'static str,64/// Bytes required for the `length` and `type`65required_number_of_bytes: usize,66/// The size of the IPC buffer67buffer_length: usize,68},69/// A buffer's size is larger than the file size70InvalidBuffersLength {71/// number of bytes of all buffers in the record72buffers_size: u64,73/// the size of the file74file_size: u64,75},76/// A bitmap's size is smaller than the required for the number of elements77InvalidBitmap {78/// Declared length of the bitmap79length: usize,80/// Number of bits on the IPC buffer81number_of_bits: usize,82},83/// The dictionary is_delta is an invalid flatbuffer84InvalidFlatbufferIsDelta(arrow_format::ipc::planus::Error),85/// The dictionary id is an invalid flatbuffer86InvalidFlatbufferId(arrow_format::ipc::planus::Error),87/// Invalid dictionary id88InvalidId {89/// The requested dictionary id90requested_id: i64,91},92/// Field id is not a dictionary93InvalidIdDataType {94/// The requested dictionary id95requested_id: i64,96},97/// FixedSizeBinaryArray has invalid datatype.98InvalidDataType,99}100101impl Display for OutOfSpecKind {102fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {103write!(f, "{self:?}")104}105}106107108