Skip to main content
pub fn decode_records<T: DeserializeOwned + Send, B: AsRef<[u8]> + Sync>(
    schema: &Schema,
    binary_records: &[B],
) -> Result<Vec<T>, KineticaError>

Decodes binary Avro records to typed Rust structs.

This is the recommended decoding function. It automatically chooses between sequential and parallel decoding based on record count, and uses serde_avro_fast for optimal performance.

Type Parameters

  • T - The target type to decode into. Must implement serde::Deserialize.

Arguments

  • schema - The serde_avro_fast schema to use for decoding
  • binary_records - Slice of binary Avro-encoded records

Returns

A vector of decoded typed records, or an error if any record fails to decode.

Example