Skip to main content

Crate tiders_cast

Crate tiders_cast 

Source
Expand description

§tiders-cast

Type casting and encoding/decoding utilities for Arrow columns and schemas.

Provides batch-level and column-level operations for:

  • Type casting: Convert columns between Arrow data types by name or by source type.
  • Hex encoding/decoding: Binary columns to/from hex strings (with optional 0x prefix).
  • Base58 encoding/decoding: Binary columns to/from Base58 strings (Bitcoin alphabet).
  • U256 conversion: Between Decimal256(76,0) and big-endian binary representations.

Functions§

base58_decode_column
Decodes a Base58-encoded string column to binary.
base58_encode
Encodes all Binary and LargeBinary columns in the batch to Base58 (Bitcoin alphabet) strings.
base58_encode_column
Encodes a single binary column to Base58 strings.
cast
Casts columns according to given (column name, target data type) pairs.
cast_by_type
Casts all columns with from_type to to_type.
cast_schema
Casts column types according to given (column name, target data type) pairs.
cast_schema_by_type
Casts columns with from_type to to_type
decimal128_to_be16
Encodes a Decimal128 column as fixed 16-byte big-endian two’s-complement binary.
decimal256_to_be32
Encodes a Decimal256 column as fixed 32-byte big-endian two’s-complement binary.
flatten_record_batch
Flattens all Struct columns in a RecordBatch into top-level columns, dot-joining names as it recurses.
flatten_schema
Schema-only mirror of flatten_record_batch.
hex_decode_column
Decodes a hex-encoded string column to binary.
hex_encode
Encodes all Binary and LargeBinary columns in the batch to hex strings.
hex_encode_column
Encodes a single binary column to hex strings.
large_ints_to_binary
Converts large-integer Decimal columns (Decimal256(_, 0) and Decimal128(_, 0)) to fixed-width big-endian two’s-complement binary (32 bytes and 16 bytes respectively). Other columns pass through unchanged.
schema_binary_to_string
Converts binary fields to string in the schema
schema_decimal256_to_binary
Converts decimal256 fields to binary in the schema
schema_large_int_to_binary
Schema-only mirror of large_ints_to_binary: rewrites scale-0 Decimal256 and Decimal128 fields to Binary. Other fields pass through unchanged.
u256_column_from_binary
Converts a big-endian binary column (up to 32 bytes) to Decimal256(76,0).
u256_column_to_binary
Converts a Decimal256(76,0) column to trimmed big-endian binary.
u256_to_binary
Converts all Decimal256 (U256) columns in the batch to big endian binary values