Skip to main content

FormatInference

Trait FormatInference 

Source
pub trait FormatInference: Send + Sync {
    // Required methods
    fn format_name(&self) -> &'static str;
    fn infer(
        &self,
        samples: &[RawRecord],
        config: &InferenceConfig,
    ) -> SchemaResult<InferredSchema>;
}
Expand description

Trait for format-specific schema inference.

Each implementation handles a single data format (JSON, CSV, etc.) and can infer an Arrow schema from sample records.

Required Methods§

Source

fn format_name(&self) -> &'static str

Returns the format name this inferencer handles (e.g., "json").

Source

fn infer( &self, samples: &[RawRecord], config: &InferenceConfig, ) -> SchemaResult<InferredSchema>

Infers a schema from sample raw records.

§Errors

Returns SchemaError::InferenceFailed if the samples cannot be parsed or the schema cannot be determined.

Implementors§