pub async fn try_new(uri: &str, region: String) -> Result<Self> {
        let region_enum = Region::from_str(&region).unwrap();
        let storage_backend: Box<dyn StorageBackend> =
            Box::new(S3StorageBackend::new_with(S3Client::new(region_enum), None));
        let mut delta_table = DeltaTable::new(&uri, storage_backend)?;
        delta_table.load().await?;
        let uri_split = uri.split("/").collect::<Vec<_>>();
        let bucket = uri_split[2].to_owned();
        let root = uri_split[3..].join("/") + "/";
        Ok(Self {
            delta_table,
            bucket,
            root,
            region,
        })
    }
/// Create a catalog from a Delta S3 URI and a region.
Create a catalog from a Delta S3 URI and a region.
Create a catalog from a Delta S3 URI and a region .
pub async fn try_new(uri: &str, region: String) -> Result<Self> {
        let region_enum = Region::from_str(&region).unwrap();
        let storage_backend: Box<dyn StorageBackend> =
            Box::new(S3StorageBackend::new_with(S3Client::new(region_enum), None));
        let mut delta_table = DeltaTable::new(&uri, storage_backend)?;
        delta_table.load().await?;
        let uri_split = uri.split("/").collect::<Vec<_>>();
        let bucket = uri_split[2].to_owned();
        let root = uri_split[3..].join("/") + "/";
        Ok(Self {
            delta_table,
            bucket,
            root,
            region,
        })
    }
pub async fn try_new ( uri : & str , region : String ) -> Result < Self > { let region_enum = Region :: from_str ( & region ) . unwrap ( ) ; let storage_backend : Box < dyn StorageBackend > = Box :: new ( S3StorageBackend :: new_with ( S3Client :: new ( region_enum ) , None ) ) ; let mut delta_table = DeltaTable :: new ( & uri , storage_backend ) ? ; delta_table . load ( ) . await ? ; let uri_split = uri . split ( " " ) . collect :: < Vec < _ > > ( ) ; let bucket = uri_split [ 2 ] . to_owned ( ) ; let root = uri_split [ 3 .. ] . join ( " " ) + " " ; Ok ( Self { delta_table , bucket , root , region , } ) }
Create a catalog from a Delta S3 URI and a region.
Create a catalog from a Delta S3 URI and a region .
uri
&str
region
String
uri
&str
region
String