pub mod avro;
pub mod csv;
pub mod json;
pub mod parquet;
use std::any::Any;
use std::fmt;
use std::sync::Arc;
use crate::arrow::datatypes::SchemaRef;
use crate::error::Result;
use crate::logical_plan::Expr;
use crate::physical_plan::file_format::FileScanConfig;
use crate::physical_plan::{ExecutionPlan, Statistics};
use async_trait::async_trait;
use super::object_store::{ObjectReader, ObjectReaderStream};
#[async_trait]
pub trait FileFormat: Send + Sync + fmt::Debug {
fn as_any(&self) -> &dyn Any;
async fn infer_schema(&self, readers: ObjectReaderStream) -> Result<SchemaRef>;
async fn infer_stats(&self, reader: Arc<dyn ObjectReader>) -> Result<Statistics>;
async fn create_physical_plan(
&self,
conf: FileScanConfig,
filters: &[Expr],
) -> Result<Arc<dyn ExecutionPlan>>;
}