deltalake_core/data_catalog/
mod.rsuse std::fmt::Debug;
#[cfg(feature = "unity-experimental")]
pub use unity::*;
#[cfg(feature = "unity-experimental")]
pub mod client;
#[cfg(feature = "datafusion")]
pub mod storage;
#[cfg(feature = "unity-experimental")]
pub mod unity;
pub type DataCatalogResult<T> = Result<T, DataCatalogError>;
#[derive(thiserror::Error, Debug)]
pub enum DataCatalogError {
#[error("Error in {catalog} catalog: {source}")]
Generic {
catalog: &'static str,
source: Box<dyn std::error::Error + Send + Sync + 'static>,
},
#[cfg(feature = "unity-experimental")]
#[error("{source}")]
Retry {
#[from]
source: client::retry::RetryError,
},
#[error("Request error: {source}")]
#[cfg(feature = "unity-experimental")]
RequestError {
#[from]
source: reqwest::Error,
},
#[cfg(feature = "unity-experimental")]
#[error("Missing Unity Catalog environment variable: {var_name}")]
MissingEnvVar {
var_name: String,
},
#[cfg(feature = "unity-experimental")]
#[error("Invalid Databricks personal access token")]
InvalidAccessToken,
#[error("This data catalog doesn't exist: {data_catalog}")]
InvalidDataCatalog {
data_catalog: String,
},
#[error("Unknown configuration key '{catalog}' in '{key}' catalog.")]
UnknownConfigKey {
catalog: &'static str,
key: String,
},
}
#[async_trait::async_trait]
pub trait DataCatalog: Send + Sync + Debug {
async fn get_table_storage_location(
&self,
catalog_id: Option<String>,
database_name: &str,
table_name: &str,
) -> Result<String, DataCatalogError>;
}