use datafusion::error::DataFusionError;
#[derive(Debug, thiserror::Error)]
pub enum DfOlapError {
#[error("DataFusion error: {0}")]
DataFusion(#[from] DataFusionError),
#[error("Arrow error: {0}")]
Arrow(#[from] arrow::error::ArrowError),
#[error("Parquet error: {0}")]
Parquet(#[from] parquet::errors::ParquetError),
#[error("table not found: {0}")]
TableNotFound(String),
#[error("schema mismatch: {0}")]
SchemaMismatch(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("task join error: {0}")]
Join(String),
#[cfg(feature = "cloud-storage")]
#[error("object store error: {0}")]
ObjectStore(#[from] object_store::Error),
#[cfg(feature = "cloud-storage")]
#[error("invalid URL: {0}")]
UrlParse(#[from] url::ParseError),
#[error("{0}")]
Other(String),
}
impl DfOlapError {
pub(crate) fn from_join(e: tokio::task::JoinError) -> Self {
Self::Join(e.to_string())
}
}