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§
Sourcefn format_name(&self) -> &'static str
fn format_name(&self) -> &'static str
Returns the format name this inferencer handles (e.g., "json").
Sourcefn infer(
&self,
samples: &[RawRecord],
config: &InferenceConfig,
) -> SchemaResult<InferredSchema>
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.