ExArrow. IPC. File
(ex_arrow v0.8.0)
View Source
IPC file format reader: random access to schema, batch count, and batches by index.
Use from_file/1 or from_binary/1 to open, then schema/1, batch_count/1,
and get_batch/2 for random access. Data remains in native memory until you
use ExArrow.RecordBatch / ExArrow.Schema accessors.
Summary
Functions
Returns the number of record batches in the file.
Opens an IPC file format from in-memory binary (e.g. for tests). Random access as with from_file.
Opens an IPC file (file format) from a path. Enables random access to batches.
Returns the record batch at the given 0-based index as an ExArrow.RecordBatch handle.
Returns the schema of the IPC file as an ExArrow.Schema handle.
Returns {:error, message} if the file handle is invalid (e.g. poisoned lock).
Write schema and batches to an Arrow IPC file-format path
(magic + footer, random-access compatible).
Types
Functions
@spec batch_count(t()) :: non_neg_integer()
Returns the number of record batches in the file.
Opens an IPC file format from in-memory binary (e.g. for tests). Random access as with from_file.
Opens an IPC file (file format) from a path. Enables random access to batches.
@spec get_batch(t(), non_neg_integer()) :: {:ok, ExArrow.RecordBatch.t()} | {:error, String.t()}
Returns the record batch at the given 0-based index as an ExArrow.RecordBatch handle.
@spec schema(t()) :: {:ok, ExArrow.Schema.t()} | {:error, String.t()}
Returns the schema of the IPC file as an ExArrow.Schema handle.
Returns {:error, message} if the file handle is invalid (e.g. poisoned lock).
@spec write(Path.t(), ExArrow.Schema.t(), [ExArrow.RecordBatch.t()]) :: :ok | {:error, String.t()}
Write schema and batches to an Arrow IPC file-format path
(magic + footer, random-access compatible).
This is distinct from ExArrow.IPC.Writer.to_file/3, which writes the
IPC stream format.