Module logical

Module logical 

Source
Expand description

§Logical Operations Kernels Module - Boolean Logic and Set Operations

Logical operation kernels providing efficient boolean algebra, set membership testing, and range operations with SIMD acceleration and null-aware semantics. Critical foundation for query execution, filtering predicates, and analytical data processing workflows.

§Core Operations

  • Boolean algebra: AND, OR, XOR, NOT operations on boolean arrays with bitmask optimisation
  • Set membership: IN and NOT IN operations with hash-based lookup optimisation
  • Range operations: BETWEEN predicates for numeric and string data types
  • Pattern matching: String pattern matching with optimised prefix/suffix detection
  • Null-aware logic: Three-valued logic implementation following SQL semantics
  • Compound predicates: Efficient evaluation of complex multi-condition expressions

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_logical_bool
Logical AND/OR/XOR of two bit-packed boolean masks over a window. Offsets are bit offsets. Length is in bits. Panics if offsets are not 64-bit aligned.
between_array
Test if array elements fall between min/max bounds, dispatching by array type.
between_f32
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
between_f64
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
between_i32
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
between_i64
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
between_u32
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
between_u64
Test if LHS values fall between RHS min/max bounds, producing boolean result array.
cmp_between
Test if values fall between min/max bounds for comparable numeric types.
cmp_between_f
Test if floating-point values fall between bounds with NaN handling.
cmp_between_mask
Mask-aware variant
cmp_dict_between
Test if dictionary/categorical values fall between lexicographic bounds.
cmp_dict_in
Returns true for each row in lhs whose string value also appears anywhere in rhs, respecting null masks on both sides. Returns true for each row in lhs whose string value also appears anywhere in rhs, respecting null masks on both sides.
cmp_in
Test membership in set for hashable types using hash-based lookup.
cmp_in_f
Test membership in set for floating-point types with NaN handling.
cmp_in_f_mask
SIMD-aware, type-specific dispatch for cmp_in_f_mask and cmp_in_f
cmp_in_mask
Mask-aware variant
cmp_str_between
Test if LHS string values fall lexicographically between RHS min/max bounds.
cmp_str_in
Test membership of LHS string values in RHS string set.
in_array
Test membership of array elements in values set, dispatching by array type.
in_f32
Test membership of LHS floating-point values in RHS set with NaN handling.
in_f64
Test membership of LHS floating-point values in RHS set with NaN handling.
in_i32
Test membership of LHS integer values in RHS set, producing boolean result array.
in_i64
Test membership of LHS integer values in RHS set, producing boolean result array.
in_u32
Test membership of LHS integer values in RHS set, producing boolean result array.
in_u64
Test membership of LHS integer values in RHS set, producing boolean result array.
is_not_null_array
Generate boolean mask indicating non-null elements in any array type.
is_null_array
Generate boolean mask indicating null elements in any array type.
not_bool
Bitwise NOT of a bit-packed boolean mask window. Offset is a bit offset; len is in bits. Requires offset % 64 == 0 for word-level SIMD processing.
not_in_array
Test non-membership of array elements in values set, dispatching by array type.