Expand description
§String Arithmetic Module - String Operations with Numeric Interactions
String-specific arithmetic operations including string multiplication, concatenation, and manipulation. This unifies strings into a typical numeric-compatible workloads. E.g., “hello” + “there” = “hellothere”. These are opt-in via the “str_arithmetic” feature.
§Overview
- String multiplication: Repeat strings by numeric factors with configurable limits
- String-numeric conversions: Format numbers into string representations
- Categorical operations: Efficient string deduplication and categorical array generation
- Null-aware processing: Full Arrow-compatible null propagation
§Features
- Memory efficiency: Uses string interning and categorical encoding to reduce allocation overhead
- Safety limits: Configurable multiplication limits prevent excessive memory usage
- Optional dependencies: String-numeric arithmetic gated behind
str_arithmeticfeature
Constants§
- W8
- Auto-generated SIMD lane widths from build.rs
SIMD lane count for 8-bit elements (u8, i8).
Determined at build time based on target architecture capabilities,
or overridden via
SIMD_LANES_OVERRIDE. - W16
- SIMD lane count for 16-bit elements (u16, i16).
Determined at build time based on target architecture capabilities,
or overridden via
SIMD_LANES_OVERRIDE. - W32
- SIMD lane count for 32-bit elements (u32, i32, f32).
Determined at build time based on target architecture capabilities,
or overridden via
SIMD_LANES_OVERRIDE. - W64
- SIMD lane count for 64-bit elements (u64, i64, f64).
Determined at build time based on target architecture capabilities,
or overridden via
SIMD_LANES_OVERRIDE.
Functions§
- apply_
dict32_ dict32 - Applies an element-wise binary operation between two
CategoricalArray<u32>arrays, producing a newCategoricalArray<u32>. The result reuses or extends the unified dictionary from both input arrays and ensures deterministic interned value codes. - apply_
dict32_ num - Applies element-wise binary arithmetic op between
CategoricalArray<u32>s a numeric slice. - apply_
dict32_ str - Applies element-wise binary arithmetic ops between a
CategoricalArray<u32>and aStringArray<T>. - apply_
str_ dict32 - Applies element-wise binary arithmetic ops between
StringArray<T>andCategoricalArray<u32> - apply_
str_ float - Applies an element-wise binary operation between a
StringArray<T>and a slice of floating-point values, producing a newStringArray<T>. Each operation is performed by interpreting the float as a finite decimal string representation (f64formatted withryu), and applying string transformations accordingly. - apply_
str_ num - String-numeric arithmetic operation dispatcher. Supports string multiplication (repeat string N times) with safety limits. Other operations pass through unchanged. Handles null propagation correctly.
- apply_
str_ str - Applies an element-wise binary operation between two
StringArrays, producing a newStringArray. Requires both arrays to have the same length.