An immutable, continuous-memory string array implementing the Apache Arrow Utf8 columnar format.
Under the hood, data is organized in three buffers:
- Offsets buffer (
offsets): a continuous binary of 32-bit signed integers in little-endian. - Data buffer (
data): a continuous binary containing the concatenated UTF-8 string bytes. - Validity bitmap (
validity): a bitstring tracking null (nil) values (1 bit per element).
Features
- O(1) Random Access: Slicing and indexing (
array[i]) usebinary_part/3without copying memory. - Full Protocol Integration: Implements
Enumerable,Collectable, andAccess. - Arrow Compatible: 100% byte-for-byte compliant with the Apache Arrow specification.
Summary
Functions
Appends a string or nil to the array.
Returns the byte size of the continuous data buffer.
Deletes the element at index idx.
Fetches the element at the given index or a slice specified by a range.
Supports negative indices (e.g. -1 for the last element).
Builds an Errow.String array from a list or enumerable of strings and optional nils.
Gets the value at index idx or returns default if out of bounds.
Joins the strings in the array with the given separator. Null values are skipped by default.
Finds the lexicographically largest string in the array.
Finds the lexicographically smallest string in the array.
Creates a new empty Errow.String array.
Checks if the value at the given index is null (nil).
Returns the count of null values.
Replaces the element at the given index with a new string or nil.
Returns the number of elements in the array.
Converts the Errow.String array into a standard Elixir list.
Returns the sum of byte lengths of all strings in the array.
Types
@type t() :: %Errow.String{ data: binary(), length: non_neg_integer(), null_count: non_neg_integer(), offsets: binary(), validity: bitstring() }
Functions
Appends a string or nil to the array.
@spec buffer_byte_size(t()) :: non_neg_integer()
Returns the byte size of the continuous data buffer.
Deletes the element at index idx.
Fetches the element at the given index or a slice specified by a range.
Supports negative indices (e.g. -1 for the last element).
@spec from_list(Enumerable.t()) :: t()
Builds an Errow.String array from a list or enumerable of strings and optional nils.
Gets the value at index idx or returns default if out of bounds.
Joins the strings in the array with the given separator. Null values are skipped by default.
Finds the lexicographically largest string in the array.
Finds the lexicographically smallest string in the array.
@spec new() :: t()
Creates a new empty Errow.String array.
Checks if the value at the given index is null (nil).
@spec null_count(t()) :: non_neg_integer()
Returns the count of null values.
Replaces the element at the given index with a new string or nil.
@spec size(t()) :: non_neg_integer()
Returns the number of elements in the array.
Converts the Errow.String array into a standard Elixir list.
@spec total_bytes(t()) :: non_neg_integer()
Returns the sum of byte lengths of all strings in the array.