File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
catalogs/iceberg-s3tables-catalog/src Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use aws_sdk_s3tables::{
33 error:: SdkError ,
44 operation:: {
55 create_namespace:: CreateNamespaceError , create_table:: CreateTableError ,
6+ delete_namespace:: DeleteNamespaceError , get_namespace:: GetNamespaceError ,
67 delete_table:: DeleteTableError , get_table:: GetTableError ,
78 get_table_metadata_location:: GetTableMetadataLocationError ,
89 list_namespaces:: ListNamespacesError , list_tables:: ListTablesError ,
@@ -21,6 +22,10 @@ pub enum Error {
2122 #[ error( transparent) ]
2223 CreateNamespace ( #[ from] SdkError < CreateNamespaceError , HttpResponse > ) ,
2324 #[ error( transparent) ]
25+ DeleteNamespace ( #[ from] SdkError < DeleteNamespaceError , HttpResponse > ) ,
26+ #[ error( transparent) ]
27+ GetNamespace ( #[ from] SdkError < GetNamespaceError , HttpResponse > ) ,
28+ #[ error( transparent) ]
2429 ListTables ( #[ from] SdkError < ListTablesError , HttpResponse > ) ,
2530 #[ error( transparent) ]
2631 ListNamespaces ( #[ from] SdkError < ListNamespacesError , HttpResponse > ) ,
Original file line number Diff line number Diff line change @@ -93,9 +93,18 @@ impl Catalog for S3TablesCatalog {
9393 Ok ( HashMap :: new ( ) )
9494 }
9595 /// Drop a namespace in the catalog
96- async fn drop_namespace ( & self , _namespace : & Namespace ) -> Result < ( ) , IcebergError > {
97- todo ! ( )
96+ async fn drop_namespace ( & self , namespace : & Namespace ) -> Result < ( ) , IcebergError > {
97+ self . client
98+ . delete_namespace ( )
99+ . table_bucket_arn ( & self . arn )
100+ . namespace ( namespace[ 0 ] . as_str ( ) )
101+ . send ( )
102+ . await
103+ . map_err ( Error :: from) ?;
104+
105+ Ok ( ( ) )
98106 }
107+
99108 /// Load the namespace properties from the catalog
100109 async fn load_namespace (
101110 & self ,
@@ -113,8 +122,15 @@ impl Catalog for S3TablesCatalog {
113122 todo ! ( )
114123 }
115124 /// Check if a namespace exists
116- async fn namespace_exists ( & self , _namespace : & Namespace ) -> Result < bool , IcebergError > {
117- todo ! ( )
125+ async fn namespace_exists ( & self , namespace : & Namespace ) -> Result < bool , IcebergError > {
126+ Ok ( self . client
127+ . get_namespace ( )
128+ . table_bucket_arn ( & self . arn )
129+ . namespace ( namespace[ 0 ] . as_str ( ) )
130+ . send ( )
131+ . await
132+ . map_err ( Error :: from)
133+ . is_ok ( ) )
118134 }
119135 async fn list_tabulars ( & self , namespace : & Namespace ) -> Result < Vec < Identifier > , IcebergError > {
120136 let mut tabulars = Vec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments