Skip to main content
pub fn encode_records<T: Serialize + Sync>(
    schema: &Schema,
    records: &[T],
) -> Result<Vec<Vec<u8>>, KineticaError>

Encodes records to Avro binary format.

Automatically chooses between sequential and parallel encoding based on record count. Uses serde_avro_fast for optimal performance.

Type Parameters

  • T - The record type. Must implement serde::Serialize.

Arguments

  • schema - The serde_avro_fast schema to use for encoding
  • records - Slice of records to encode

Returns

A vector of binary-encoded Avro records.

Example